Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 17th, 2010, 08:43 AM
Registered User
 
Join Date: Nov 2010
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Question How can I handle multiple XML declarations in XML File

Hi ,

I have one XML file. In that XML file it consist of multiple XML declarations. While transforming that XML file into another format (like HTML ) I can't able to handle those multiple declartions in the XML file.

Pls see the example code below :
Code:
<root>
      <class>
               <name> Gopi </name>
                <Eid>455</Eid>
    <Addr>  Andhra Pradesh  <?xml version="1.0" encoding="UTF-8"?></Addr> 
       </class>
        <class>
               <name> Krishna </name>
                <Eid>456</Eid>
                <Addr>  Kerala  <?xml version="1.0" encoding="UTF-8"?></Addr>  </class>
</root>
In the above code XML Version Declaration is appeared inside the <Addr> element.

I hope you can understand whats the problem I was facing.
When I transforming the above XML file into HTML by using XSLT I can't able to handle XML declartions in the XML file.

Could you please assist me to resolve the above issue.


Thanks in Advance for ur valuable suggesions
 
Old November 17th, 2010, 08:47 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

XML has its strict syntax rules, what you have violates the rules so any XML parser will complain. You will need to fix the input to be able to parse it successfully as XML and use it as input to XSLT.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
 
Old November 17th, 2010, 09:49 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

>In that XML file it consist of multiple XML declarations.

If there is more than one XML declaration, then it isn't an XML file.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help to handle namespace tags in xml file gkrishna.tibco XSLT 2 November 9th, 2010 01:48 PM
Multiple input xml / get data from other xml file elayaraja.s XSLT 3 July 25th, 2008 06:59 AM
One XML to Multiple XML file dineshrout XSLT 3 May 11th, 2006 12:24 PM
Chap 18 XML,error: multiple DOCTYPE declarations cJeffreywang BOOK: Beginning ASP 3.0 1 November 9th, 2005 03:54 PM
Multiple XML File Problem jhunsake XSLT 1 July 7th, 2004 05:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.