Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

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: 26293
80
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