Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 20th, 2007, 03:41 PM
Authorized User
 
Join Date: Jul 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default no idea ! help

i'm very very very new to xsl, i don't even know the question that i'm going to ask lie at what topic. but please give me some idea.

question1:
this is the code look like xml, but not: (use the same method to load)
<HEADERDATA>Label</HEADERDATA><HEADERDATA>Short Description</HEADERDATA><HEADERDATA>Account</HEADERDATA>

xls:
<xsl:for-each select="HEADERDATA">
<TD align="center"><b><xsl:value-of select="."/></b></TD>
</xsl:for-each>

right now i just want to get the word "Label" how can i get that word?

question 2:
related to the above, it's getting the Label, right now i need to get the content
    <LINE><DATA>Journal1</DATA><DATA>Journal1</DATA><DATA>3000</DATA><DEBIT>400</DEBIT><CREDIT></CREDIT></LINE>
<LINE><DATA>Journal1</DATA><DATA>Journal1</DATA><DATA>4000</DATA><DEBIT></DEBIT><CREDIT>400</CREDIT></LINE>
<LINE><DATA>J1</DATA><DATA>j11</DATA><DATA>3000</DATA><DEBIT>100</DEBIT><CREDIT></CREDIT></LINE>
<LINE><DATA>J1</DATA><DATA>j11</DATA><DATA>4000</DATA><DEBIT></DEBIT><CREDIT>100</CREDIT></LINE>

print the content beside the label "Journal1" also "J1"

so the result will look like this:

Label: Journal1

how can i do that ?
please teach me

 
Old July 20th, 2007, 04:04 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I'm not sure I understand your question. You say your input isn't XML, presumably because it lacks an outer wrapper element. The first thing you have to do is to make it into well-formed XML.

Your code for getting the content of the HEADERDATA looks fine provided you execute it in the right context.

You second question I don't understand at all. How does it relate to the first question. You have two entries for Journal1 and two for J1 here, I haven't a clue what it all means.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old July 22nd, 2007, 10:11 PM
Authorized User
 
Join Date: Jul 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ah...sorry...let me make my question clearly:
    <LINE><DATA>Journal1</DATA><DATA>Journal1</DATA><DATA>3000</DATA><DEBIT>400</DEBIT><CREDIT></CREDIT></LINE>
<LINE><DATA>Journal1</DATA><DATA>Journal1</DATA><DATA>4000</DATA><DEBIT></DEBIT><CREDIT>400</CREDIT></LINE>
<LINE><DATA>J1</DATA><DATA>j11</DATA><DATA>3000</DATA><DEBIT>100</DEBIT><CREDIT></CREDIT></LINE>
<LINE><DATA>J1</DATA><DATA>j11</DATA><DATA>4000</DATA><DEBIT></DEBIT><CREDIT>100</CREDIT></LINE>

i need to get the contenet in line 3 first content which is J1.
if i use "." it will get everything from line 1 to line 4.
i just want to get the content of line 3 and skip the rest. is that possible ? is that possible ?

 
Old July 23rd, 2007, 02:37 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You can get the content of line 3 using the path expression LINE[3].

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old July 23rd, 2007, 09:55 AM
Authorized User
 
Join Date: Jul 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

how can i do that ?
can you show me how ?






Similar Threads
Thread Thread Starter Forum Replies Last Post
Brilliant idea, no idea how! imaginitive-idea-guy Ajax 9 January 14th, 2007 05:32 AM
Idea about project. shivanshub C# 0 August 15th, 2006 03:07 PM
MSHFlexGrid Idea Rudner Pro VB Databases 1 November 20th, 2004 06:12 AM
Help! No idea what the problem is. ltdanp21 SQL Server 2000 1 May 23rd, 2004 11:05 PM
DataSet idea melvik ADO.NET 3 May 5th, 2004 12:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.