Actually, that isn't a valid XML DTD. This content model is valid in SGML but not XML:
<!ELEMENT TERM (EFFECT?, (#PCDATA|REFP)+) >
See section 3.2.2 in the XML standard:
http://www.w3.org/TR/REC-xml/#sec-mixed-content
In XML, the #PCDATA must come first. XMetal can validate SGML, so perhaps it thinks it is SGML?
Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net
----- Original Message -----
From: JingJun Long
To: xep-support@renderx.com
Sent: Thursday, February 08, 2007 10:49 PM
Subject: [xep-support] DTD validation
Hi there,
I am using XEP as my engine to generate PDF. I encounter a problem related to render an XML file with DTD.
The situation on my side is like the following:
I have a DTD and an XML file. There a doctype definition row in the XML like the following:
<!DOCTYPE Book PUBLIC 'XXXXXXXXXXX' 'XXXXXX.dtd'[]>
I can edit this XML file in XMetaL. XMetaL tells me the XML file is OK when I validate the XML file. From this point, I think the DTD and XML are both correct.
I have an XSL for rendering the XML to PDF. When I try to use XEP 4.9 (JDK1.5) to render it to PDF. I got the following error.
[error] Error reported by XML parser; SystemID: file:/D:/XXXXXX.dtd; Line#: 214; Column#: 27
[error] javax.xml.transform.TransformerException: Error reported by XML parser
error: formatting failed: javax.xml.transform.TransformerException: org.xml.sax.
SAXParseException: Not a name start character, U+23
The content at 214 is like the following:
<!ELEMENT TERM (EFFECT?, (#PCDATA|REFP)+) >
The XML parser tells me the DTD is incorrect. I changed above line into the following. The error disappears.
<!ELEMENT TERM (EFFECT?, (REFP)+) >
It seems the XML parser did not recognize #PCDATA. It still try to treat it as an element.
Do you have any idea about this?
Thanks very much
Long
-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html
Received on Fri Feb 9 00:59:44 2007
This archive was generated by hypermail 2.1.8 : Fri Feb 09 2007 - 00:59:45 PST