[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xml to xml transformation
Lainaus Steven Curry <scurry1@xxxxxxx>: | I need to do a minor transformation of large documents scheduled daily | where | the result will be the same as the original except one repeating element is | | transformed. What is the best way to transform just these elements while | leaving the rest of the document the same? (I'm an xslt newbie by the way) | | Is xslt appropriate performance wise? | | Also, I haven't been able to get the transformation right. I need to take | | the value of an attribute and make it the element name as follows: | | Transform: | <customFieldValue name="cust_1">Custom Field Value 1</customFieldValue> | <customFieldValue name="cust_2">Custom Field Value 2</customFieldValue> | | To: | <cust_1>Custom Field Value 1</cust_1> | <cust_2>Custom Field Value 2</cust_2> | | Thanks, | | Steve | | | | _________________________________________________________________ | The new MSN 8: advanced junk mail protection and 2 months FREE* | http://join.msn.com/?page=features/junkmail | | | XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list | | <xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> <xsl:output method="xml"/> <xsl:template match="/"> <xsl:for-each select="//customFieldValue"> <xsl:element name="{@name}"><xsl:value-of select="."/></xsl:element> </xsl:for-each> </xsl:template> </xsl:stylesheet> RESULTTREE: <?xml version="1.0" encoding="UTF-8"?> <cust_1>Custom Field Value 1</cust_1> <cust_2>Custom Field Value 2</cust_2> </Jarkko> *************************************************** * Jarkko Moilanen * * Project Researcher, ITCM (www.itcm.org) * * Profound XML technology Expert * * University of Tampere * * Hypermedia Laboratory * *************************************************** XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|