• 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

XSL transformation

 
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
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
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
Posts: 270
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks again. I appreciate your help
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic