Hello all, I have a question about validating a document that contains both a DOCTYPE and an XML Schema. My scenerio is that I'm producing the document in C++, and the consumer (which I have no control over) uses Java (xerces-j). It is convenient for me to use a couple of internal entities, but the consumer program recently switched from a DOCTYPE to an XML Schema.
So, enough background. Aside from using both a complete DTD and a complete XML Schema, is there anyway to do have a document like the one below? This validates with xerces-c (using sample program SAX2Count), but not with xerces-j (using sample program sax.Counter -n -f -s -v). Which is right? My reading of the XML spec says that in a well formed document a doctypedecl is optional, and if it's included, it's allowed to contain only '<!DOCTYPE entschema>'. xerces-j also gives an error in this case. http://www.w3.org/TR/REC-xml#NT-prolog It's been a long week, so maybe I'm reading something wrong. Many thanks, Dave ======================================== <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE entschema [ <!ENTITY replace "my replacement text"> ]> <entschema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="entschema.xsd"> <text>&replace; here</text> </entschema> ======================================== <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="entschema"> <xs:complexType> <xs:sequence> <xs:element name="text" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> Dave Broudy [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]