ObfusCo
>
The List
>
xsd
XSD Blog
- 3) Face it, although the idea of validating against
a schema is nice and anal, the reality is that we end
up with very large documents (partly simply because XML
is verbose) which choke the tools we have available to
us (or at least take a really long time to process,
and require that you have scads of memory). So the
distance between the fantasy and the reality is larger
than it should be, and insufficiently acknowledged.
- 2) The XML parsers I've gotten my hands on all suck
eggs when it comes to error messages. Well, the exception is the Oracle
parser.
- 1) Are none of them happy with the W3C DTD for XML Schema? Is
it because the parsers bite, or is it that the DTD bites? Who can tell?
XML Spy doesn't barf on the DTD; I'm pretty much assuming it is just that
all the parsers really do, in fact, bite. (I used the latest versions of
the parsers as of like 8/25/00.)
My Source
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsd:schema PUBLIC "-//W3C//DTD XMLSCHEMA 19991216//EN" "http://www.w3.org/1999/XMLSchema.dtd" [
<!ENTITY % p 'xsd:'>
<!ENTITY % s ':xsd'>
]>
<xsd:schema xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<!-- (name, value) pair -->
<xsd:element name="pair" >
<xsd:complexType content="elementOnly">
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="value" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>
The Oracle Parser
Parsing file:///c:/dev/testsource/SchemaTest.xsd
http://www.w3.org/1999/part2.dtd: XML-0201: (Fatal Error) Expected name instead of %.
http://www.w3.org/1999/part2.dtd: XML-0192: (Fatal Error) Unexpected text in DTD.
Parser Exception: Expected name instead of %.
The Xerces-J Parser
String index out of range: 17
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:878)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:900)
at com.ibm.xml.parsers.NonValidatingDOMParser.parse(NonValidatingDOMParser.java:231)
at com.auctia.util.DOMParser.xerces(DOMParser.java:48)
at com.auctia.util.DOMParser.main(DOMParser.java:26)
The Microsoft Parser
Warning: Entity 'p' already defined, using the first definition.
Exception in thread "main" com.ms.xml.parser.ParseException: Missing entity 'xsdannotation'.
at com.ms.xml.parser.Parser.error(Parser.java, Compiled Code)
at com.ms.xml.parser.Parser.scanEntityRef(Parser.java)
at com.ms.xml.parser.Parser.nextToken(Parser.java:120, Compiled Code)
at com.ms.xml.parser.ContentModel.parseNode(ContentModel.java)
at com.ms.xml.parser.ContentModel.parseList(ContentModel.java:120, Compiled Code)
at com.ms.xml.parser.ContentModel.parseRootNode(ContentModel.java)
at com.ms.xml.parser.ContentModel.parseModel(ContentModel.java:122, Compiled Code)
at com.ms.xml.parser.ElementDecl.parseModel(ElementDecl.java:120, Compiled Code)
at com.ms.xml.parser.Parser.parseElementDecl(Parser.java:119, Compiled Code)
at com.ms.xml.parser.Parser.parseInternalSubset(Parser.java, Compiled Code)
at com.ms.xml.parser.Parser.loadDTD(Parser.java)
at com.ms.xml.parser.Parser.scanEntityRef(Parser.java)
at com.ms.xml.parser.Parser.parseInternalSubset(Parser.java:120, Compiled Code)
at com.ms.xml.parser.Parser.loadDTD(Parser.java)
at com.ms.xml.parser.Parser.tryDocTypeDecl(Parser.java)
at com.ms.xml.parser.Parser.parseProlog(Parser.java)
at com.ms.xml.parser.Parser.parseDocument(Parser.java)
at com.ms.xml.parser.Parser.safeParse(Parser.java)
at com.ms.xml.parser.Parser.parse(Parser.java)
at com.ms.xml.om.Document.load(Document.java)
at com.ms.xml.om.Document.load(Document.java)
at com.auctia.util.DOMParser.microsoft(DOMParser.java:35)
at com.auctia.util.DOMParser.main(DOMParser.java:28)