xsl-list
[Top] [All Lists]

Re: xml to xml transformation

2003-04-28 15:35:28
Steven Curry wrote:
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?

It depends. A SAX filter is likely more performant but can be much harder
to maintain. You'll have to consider the tradeoff between perhaps throwing
a bit more expensive hardware at the problem and more software cost.


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>

 <xsl:template match="customFieldValue">
   <xsl:element name="{(_at_)name}">
     <xsl:apply-templates/>
   </xsl:element>
 </xsl:template>

J.Pietschmann


XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>