[xep-support] DTD validation
Bob Stayton
bobs at sagehill.net
Fri Feb 9 00:26:23 PST 2007
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 at sagehill.net
----- Original Message -----
From: JingJun Long
To: xep-support at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20070209/b001b334/attachment.html>
More information about the Xep-support
mailing list