[EMAIL PROTECTED] (ewitness - Ben Fowler) wrote:Yes, you can use &#number;, and this sometimes proves easier.
I'm not sure want you are trying to say... Do you still edit your XML files with a plain text editor?
[ snip ]
> I don't suppose that SKS could post a short complete file which > would have this as its meat. > <para>“Hello World!”</para>
OK I was in error in expecting you to do my work for me. I am trying to write something like:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<!DOCTYPE example [
<!ENTITY ldquo "“"> <!-- -->
<!ENTITY rdquo "”"> <!-- RIGHT DOUBLE QUOTATION MARK -->
<title>A Canonical Greeting</title>
Which is an XML document having a root element (as it must), and some very simple content.
Less usually, I want to declare some ENTITYs in the internal subset so I that I can use them without specifying an external subset.
When I try to parse it with ElfData XML Editor <URL: http://www.elfdata.com/xmleditor/ >, I get this error
XML-Validity: Your XML is a well-formed document, but it conflicts with the DTD:
Invalid DOCTYPE tag. The root 'example' specified in the DOCTYPE, was not defined in the DTD.
(I get the same error if I have no structure to the root element, as: <?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<!DOCTYPE para [ <!ENTITY ldquo "“"> <!-- --> <!ENTITY rdquo "”"> <!-- RIGHT DOUBLE QUOTATION MARK --> ]>
<para>“Hello World!”</para> ).
My problem being "What DTD?". Sure, I declare that my document is of type example, and use that as the root element, but I never specify what a document's being an 'example' means beyond how I have uses tags and other content within it. Personally, I wouldn't recognise the DOCTYPE tag as invalid, see <URL: http://www.xml.com/pub/a/98/08/xmlqna2.html >, and perhaps more useful <URL: http://www.oreillynet.com/pub/faqs/xml_faq_validwf >, but I may be wrong.
When I try to parse this document with SAX, I get this
SystemId Unknown; Line 0; Column 0; SystemId Unknown; Line 0; Column 0; SAX Exception
which again again I thought was odd, because I specifically didn't have SystemId (but that is consistent in a blunt sort of way with the SystemId's being unknown). I could easily have written the DOCTYPE as <!DOCTYPE example SYSTEM "./docbookx.dtd"> which is most precisely which I did not want to do. (SAX does parse (correctly) the elided version).
In short, how do I best declare ENTITYs in a standalone XML document?
If you wish, you could point me to a page reference in either the Chick book, or the Duck book as I have both beside me.