aspose file tools*
The moose likes XML and Related Technologies and the fly likes xsl does not work if input xml has attributes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "xsl does not work if input xml has attributes" Watch "xsl does not work if input xml has attributes" New topic
Author

xsl does not work if input xml has attributes

manish ahuja
Ranch Hand

Joined: Oct 23, 2003
Posts: 312
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,
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18911
    
    8

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: xsl does not work if input xml has attributes