• 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 does not work if input xml has attributes

 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Currently we are using a xsl piece of code we found on the internet for breaking a huge xml into smaller files.
This code works fine but it works only when the root xml element has no attributes. The code fails to render the output wehn the input xml file has an xml root element with attribute.
To illustrate the code works fine if I have the following input xml
---------------------- THIS WORKS --------------
<header>...
<instances>
<instance>...</instance>
<instance>...</instance>
...
<instance>...</instance>
</instances>
</header>
---------------------- THIS WORKS --------------

---------------------- THIS DOES NOT WORK --------------
<header xmlns="http://www.vignette.com/xmlschemas/importexport" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vignette.com/xmlschemas/importexport 7202/packageBody.xsd">...
<instances>
<instance>...</instance>
<instance>...</instance>
...
<instance>...</instance>
</instances>
</header>
---------------------- THIS DOES NOT WORK --------------


The xsl code we are using very similar to one found on this location
--------------------------
http://www.biglist.com/lists/xsl-list/archives/200407/msg00949.html
--------------------------

Do post your suggestions on the same.


Regards,
 
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
I think the problem is not that the root element contains attributes, but that it contains namespace declarations. (And perhaps declaring a default declaration is the problem.) So that is where I think you need to look.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic