wood burning stoves 2.0*
The moose likes XML and Related Technologies and the fly likes XSL transformation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSL transformation" Watch "XSL transformation" New topic
Author

XSL transformation

Jeppe Sommer
Ranch Hand

Joined: Jan 07, 2004
Posts: 270
Hello.

I am trying to make a XSL transformation. I already have a XSL that works fine on my XML file, but I needed to change the XML file with a new root element and then I´m unable to make it work.

The old XML file looks like this:


The old XSL looks like this:


The NEW XML file looks like this:


The NEW XSL file which doesn't work looks like this:


In the new XSL I need a <xsl:for-each statement for each Invoice element, but I have problems to identify the Invoice element, possibly because of the template below:
><xsl:template match="udk:Invoice| pip:Invoice | pie:Invoice | pcm:Invoice |tpcm:Invoice |tpcp:Invoice|tpie:Invoice|tpip:Invoice | pcp:Invoice ">

Any help would be appreciated.

Thanks in advance.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Not even correct XSLT. The <xsl:template> elements must be top-level elements. Nesting them isn't allowed.

I would just take your old transformation and add this new template into it:


That matches the Root element and recursively tries to find and apply templates which match its children. You already have a template that matches the various Invoice elements, I believe.
Jeppe Sommer
Ranch Hand

Joined: Jan 07, 2004
Posts: 270
Thanks again. I appreciate your help
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XSL transformation
 
Similar Threads
xPath and namespace problem
How to count ?
Can Not XSL-Transform Something so Simple.
is it possible?
Get namespace of root element