• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

xml to xml conversion using xslt

 
manish ahuja
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Paul,

Thanks a lot. That worked.

Regards,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic