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 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Archie CampbellSubject: Instead of repeating code, can I have position() part of the resulting node names
Author: Archie Campbell
Date: 07 Nov 2006 10:05 PM
The attached .xsl file translates one XML file to another.
The .xsl file will handle a source XML in which "Item" repeats no more that 9 times.
Is there a way that I could just have one loop where the names of the resulting nodes are dynamically set?

Thanks


UnknownTolkoToForm9.xsl
Problem XSLT file

Postnext
Tony LavinioSubject: Instead of repeating code, can I have position() part of the resulting node names
Author: Tony Lavinio
Date: 07 Nov 2006 11:08 PM
Instead of this:
<exp_sl_manufacturer_business_num1>
<xsl:value-of select="Manufacture"/>
</exp_sl_manufacturer_business_num1>
try this:
<xsl:element name="{concat('exp_sl_manufacturer_business_num', position())}">
<xsl:value-of select="Manufacture"/>
</xsl:element>

Posttop
Archie CampbellSubject: Instead of repeating code, can I have position() part of the resulting node names
Author: Archie Campbell
Date: 08 Nov 2006 10:47 AM
Excellent!
Thanks Toni.

ps
The combination of Stylus Studio and having this forum allows me to continue down this "new technology" path.

Much appreciated.
Archie

 
Topic Page 1 2 3 4 5 6 7 8 9 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.