| Author |
xml to xml conversion using xslt
|
manish ahuja
Ranch Hand
Joined: Oct 23, 2003
Posts: 312
|
|
Hi All I am rendering a new xml from an existing xml using XSLT. In the xslt i was able to create the xml document when all I had to do was fetch values from the source xml & create just new elements in the destination xml. Now I have to create an xml element which also has an attribute & because the java SAX parser transformation fails giving errors like expected to terminate element tag started earlier. If I remove this piece everything goes well This is the part which is creating the problem in the xsl ------------ <channel channelType="subChannel" vcmName="<xsl:value-of select='$includeParent'/><xsl:value-of select='node_name'/>"> </channel> ------------ First of all it errors out saying < cannot be used & to use "<" which i did. If i use the same xsl piece as element value & not attributes everything works fine. The problem occurs only when I m trying to create element attribute values Do post your thoughts on the same Regards,
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16479
|
|
|
I think that you could use Attribute Value Templates like this:Here's the link to an entry in the XSLT FAQ that talks about them.
|
 |
manish ahuja
Ranch Hand
Joined: Oct 23, 2003
Posts: 312
|
|
Hey Paul, Thanks a lot. That worked. Regards,
|
 |
 |
|
|
subject: xml to xml conversion using xslt
|
|
|