• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Generate XML / DOM using XSL and Xpath

 
sonali ag
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to generate XML based on XSL and Xpaths.
The XSL file may look like:
<rootNode namespace...>
<mainNode>
<element1>
</element2>
</optionalElement>
</element1>
</element3>
</elemet4>
---
</mainNode>
</rootNode>

And I have map of Xpaths (like "/rootNode/mainNode/element3" ) and corresponding text values .
So how to use XSL and xpath to generate XML / DOM with nodes having run time text values.
Also the final xml document may contain multiple 'mainNode' s.

Thank you.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have had several questions like this recently!

What is generating this strange requirement? Is this some class homework.

Since you don't have a DOM, any xpath style statements are just a bunch of Strings.

Bill
 
Paul Clapham
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William Brogden wrote:What is generating this strange requirement?


I ask myself that every time I see this question. If it's a real business requirement, then yeah, it's a really strange one.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic