ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> xml-sig
xml-sig
Re: [XML-SIG] Problem using schema instead of DTD
by Mike Brown other posts by this author
Jan 14 2005 9:20AM messages near this date
Re: [XML-SIG] Problem using schema instead of DTD | Re: [XML-SIG] Problem using schema instead of DTD
& XSLT Tim van Erven wrote:
>  And the output of my program looks like this, which won't validate:
>  
>  <?xml version="1.0" encoding="UTF-8"?>
>  <!DOCTYPE ltp> 
>  <ltp xmlns="http://www.example.org/info"
>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  xsi:schemaLocation="http://www.example.org/info someschema.xsd">
>   
>  <text>This is some modified sample text.</text>
>  </ltp>
>  
>  Does anyone know how to get rid of the !DOCTYPE line? Is that the right
>  thing to do anyway?
>  
>  I'm rather new to xml, so any conceptual corrections would be much
>  appreciated as well.

What are you parsing your generated XML with, and what is the error you are 
getting? It could be happening for a couple of reasons. Whatever you are using 
to do the parsing and validation of that XML may be assuming (incorrectly) 
that if it sees a DOCTYPE, it has to do DTD-based validation. Whether or not 
validation is being done, and what kind of validation, is up to the user of 
the tool doing the parsing. (Note: Pointing to or directly providing schematic info is just 
one of several 
capabilities of a the document type declaration; it is also a source of entity 
and default attribute declarations, and is normally checked for those 
regardless of whether validation is being done.)

Another possibility is that the tool you are using does not recognize the 
minimal DOCTYPE declaration that is being added to your document. Such a 
declaration serves no real purpose, but is permitted to exist by the XML spec. 
It is an often-overlooked 'feature' of XML though; some parsers may reject it 
out of ignorance.

-Mike
_______________________________________________
XML-SIG maillist  -  XML-SIG@[...].org
http://mail.python.org/mailman/listinfo/xml-sig
Thread:
Tim van Erven
Andrew Clover
Mike Brown
Tim van Erven
Tim van Erven

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved