Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 20th, 2007, 04:41 PM
Authorized User
 
Join Date: Jul 2007
Location: , , .
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

Reply With Quote
  #2 (permalink)  
Old July 20th, 2007, 05:04 PM
mhkay's Avatar
Wrox Author
Points: 18,280, Level: 58
Points: 18,280, Level: 58 Points: 18,280, Level: 58 Points: 18,280, Level: 58
Activity: 33%
Activity: 33% Activity: 33% Activity: 33%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,934
Thanks: 0
Thanked 282 Times in 277 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
Reply With Quote
  #3 (permalink)  
Old July 22nd, 2007, 11:11 PM
Authorized User
 
Join Date: Jul 2007
Location: , , .
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 ?

Reply With Quote
  #4 (permalink)  
Old July 23rd, 2007, 03:37 AM
mhkay's Avatar
Wrox Author
Points: 18,280, Level: 58
Points: 18,280, Level: 58 Points: 18,280, Level: 58 Points: 18,280, Level: 58
Activity: 33%
Activity: 33% Activity: 33% Activity: 33%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,934
Thanks: 0
Thanked 282 Times in 277 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
Reply With Quote
  #5 (permalink)  
Old July 23rd, 2007, 10:55 AM
Authorized User
 
Join Date: Jul 2007
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 04: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 24th, 2004 12:05 AM
DataSet idea melvik ADO.NET 3 May 5th, 2004 01:06 AM



All times are GMT -4. The time now is 07:43 PM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.