• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Generate XML / DOM using XSL and Xpath

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 28397
100
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic