Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Issue with an XML Page
Mihir
I have created a component which calls an external class, gets an xml from the class reformats the xml and generates and output like below:
<glossary>
<item>
<word></definition>
<definition></definition>
</item>
</glossary>
I created a new page in Livesite of type XML and added this component to that page. When I preview this page now I am getting invalid xml because the xml declaration is added twice once for the page and then for the component, I am not sure if this is a bug. When I place this component on an html page there is no XML declaration in the final output, the xml generated by component is directly inserted in page, why isn't this happening similarly on xml page.
Below is the view source of the XML page with component after preview:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<?xml version="1.0" encoding="UTF-8">
<glossary>
<item>
<word>A</word>
<definition>A is for apple</definition>
</item>
</glossary>
The page appends the output of the component to a root node, but puts the xml declaration again...which is invalid xml. Any insight on how to get around this???
Find more posts tagged with
Comments
Mihir
I found a fix never mind thanks...
I added
<xsl
utput method="xml" encoding="UTF-8" omit-xml-declaration="yes"/>
to the component so that it would stop generating the xml declaration again.