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
Rick ScofieldSubject: XML Attribute Element output from XSLT
Author: Rick Scofield
Date: 31 Aug 2011 08:28 PM
I'm sure a very simple solution exists for for this...but it escapes me. I have a input file transformation that looks like this:
-root
--row
---season
---style
---color

my output file needs to look like this:
<Provision>
<Store code="XYZ">
<InventoryProductSettings_Update product_code="A02_BLK_OFA">
<TrackInventory>Yes</TrackInventory>
...more tags...etc
</InventoryProductSettings_Update>
</Store>
</Provision>

where the attribute element 'product_code' needs the value of 'style' from the input file. Not sure how to out the value of 'style' within the XML node/tag

The XSLT starts out like:
<xsl:for-each select="root/row">
<InventoryProductSettings_Update product_code= value="style">
<row>
...
</xsl:for-each>

Any help would be appreciated.
Rick

Posttop
Ivan PedruzziSubject: XML Attribute Element output from XSLT
Author: Ivan Pedruzzi
Date: 01 Sep 2011 03:06 PM

Using an attribute value temple

<InventoryProductSettings_Update product_code="{style}">

if style is an attribute use

<InventoryProductSettings_Update product_code="{@style}">


Have a look at the XSLT mapping tab it will help in these simple cases

Hope this helps
Ivan Pedruzzi
Stylus Studio Team

 
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.