XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
manjunath AngadiSubject: how to get the xpath of xml element by xsl
Author: manjunath Angadi
Date: 31 Aug 2006 08:31 AM
hi,
I need to populate the output xmls with the hardcoded tags say <xpath> as the value of xpath of each elements in the input xml.
eg:
input xml:
<root_tag>
<section_1>
<tag_1>tag1Value</tag_1>
<tag_2>tag2Value</tag_2>
</section_1>
<section_1>
<tag_1>tag1Value</tag_1>
<tag_2>tag2Value</tag_2>
</section_1>
</root_tag>

The expected output xml is:
<xpath>root_tag/section_1[1]/tag_1</xpath>
<value>tag1Value</value>
<xpath>root_tag/section_1[1]/tag_2</xpath>
<value>tag2Value</value>
<xpath>root_tag/section_1[2]/tag_1</xpath>
<value>tag1Value</value>
<xpath>root_tag/section_1[2]/tag_2</xpath>
<value>tag2Value</value>

Please reply me with the logic of code can be used in xsl to get the required output specified above.

Thanks,
Manjunath

Posttop
Ivan PedruzziSubject: how to get the xpath of xml element by xsl
Author: Ivan Pedruzzi
Date: 31 Aug 2006 06:52 PM


See attached solution.

Ivan Pedruzzi
Stylus Studio Team


Documentmeta.xsl

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.