You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Bala Ayres <ba...@XSeLlence.com> on 2000/07/27 22:15:26 UTC

DTD parsing error

I use the MemParse sample with a little twist - the DTD is read from a
disk file concatenated with a dummy XML document (notwithstanding the
validity of such a document). The intent is to get hold of the DTD and
the elements,attributes thereof and store them in a memory area for
later use.

The program reads and stores the DTD in a string buffer correctly -
however fails to parse the DTD along with the dummy data...It errors out
with the following message
"PE refs are not allowed inside markup in the internal subset"
There is a line number and a character position to the error.
Consequently element count, attribute count are all 0.

If you need to see the DTD please let me know...i will mail it
separately.

The DTD has at the top an Entity Parameter include as follows
<!ENTITY % commoncodelist SYSTEM    "/tmp/004010X12.code.dtd">
%commoncodelist;

followed by rest of the DTD
<!ELEMENT Service-Characteristics-Qualifier (#PCDATA)>
......
......
and so on.
The DTD is 111,500 bytes.

Thanks

BAyres
Xsellence inc


Re: DTD parsing error

Posted by Dean Roddey <dr...@charmedquark.com>.
You cannot just take an external subset DTD and make it an internal subset.
Some things, according ot the XML spec, are not legal in the internal
subset, and that's one of them. You'll still have to use a DOCTYPE to
reference the DTD data, even if its just all done internally in memory. So,
you can make a small text file on the fly that references the DTD with a
public id, load up the DTD into memory also, install an entity resolver and
resolve the public id that you used for the DTD to the memory buffer that
you loaded the DTD into.

--------------------------
Dean Roddey
The CIDLib C++ Frameworks
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com

"You young, and you gotcha health. Whatchoo wanna job fer?"


----- Original Message -----
From: "Bala Ayres" <ba...@XSeLlence.com>
To: <xe...@xml.apache.org>
Sent: Thursday, July 27, 2000 1:15 PM
Subject: DTD parsing error


> I use the MemParse sample with a little twist - the DTD is read from a
> disk file concatenated with a dummy XML document (notwithstanding the
> validity of such a document). The intent is to get hold of the DTD and
> the elements,attributes thereof and store them in a memory area for
> later use.
>
> The program reads and stores the DTD in a string buffer correctly -
> however fails to parse the DTD along with the dummy data...It errors out
> with the following message
> "PE refs are not allowed inside markup in the internal subset"
> There is a line number and a character position to the error.
> Consequently element count, attribute count are all 0.
>
> If you need to see the DTD please let me know...i will mail it
> separately.
>
> The DTD has at the top an Entity Parameter include as follows
> <!ENTITY % commoncodelist SYSTEM    "/tmp/004010X12.code.dtd">
> %commoncodelist;
>
> followed by rest of the DTD
> <!ELEMENT Service-Characteristics-Qualifier (#PCDATA)>
> ......
> ......
> and so on.
> The DTD is 111,500 bytes.
>
> Thanks
>
> BAyres
> Xsellence inc
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>