XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old July 17th, 2003, 05:12 PM
plrkannan plrkannan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 3 plrkannan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
basic xslt : nodename and nodevalue

How to get the node name and node value of an xml using xslt with out hard coding the node name?


<table>
<row>
<name>one</name>
<id>26</id>
<rownum>9876</rownum>
</row>
<row>
<name>two</name>
<id>26</id>
<rownum>9875</rownum>
</row>
</table>


i want the following format from the above xml,

nodename nodevalue
table ---
row ---
name one
id 26
rownum 9876
row ---
name two
id 26
rownum 9875


Regards,
PLR.Kannan

Last edited by plrkannan : July 17th, 2003 at 05:15 PM.

Reply With Quote
  #2  
Old July 18th, 2003, 02:21 AM
Wizard2003's Avatar
Wizard2003 Wizard2003 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 206 Wizard2003 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 h 29 m 24 sec
Reputation Power: 6
If you dont't want to use the names I guess you have to use the position of the element in the tree.
Something like:
Code:
<xsl:value-of select="name(/*[1])"/> <xsl:value-of select="/*[1]"/>
<xsl:value-of select="name(/*[1]/*[1])"/> <xsl:value-of select="/*[1]/*[1]"/>
<xsl:value-of select="name(/*[1]/*[2])"/> <xsl:value-of select="/*[1]/*[2]"/>
...

Perhaps this will help you

Reply With Quote
  #3  
Old July 18th, 2003, 03:49 PM
plrkannan plrkannan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 3 plrkannan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > basic xslt : nodename and nodevalue


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway