• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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
 
Marshal
Posts: 28193
95
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.
 
On top of spaghetti all covered in cheese, there was this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic