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 "Fjerstad, Jim (LNG-MBC)" <ji...@capsoft.com> on 2000/08/09 21:17:20 UTC
Unparsed entities problem (again)
I asked this question before, but I think my communication was too vague, so
I didn't get a response.
I have either found a bug in the Xerces SAX parser (Win32, v1.2a), or I have
a misunderstanding of the XML spec with respect to unparsed entities. When
the parser reads an entity attribute that identifies an unparsed entity, it
fails with an error. However, the way I read the XML spec, it seems that the
entity reference should be OK. The part of the XML specification I'm
referring to is section 3.3.1, "Validity Constraint: Entity Name." The
specific portion I'm referring to says (in part):
"... each Name must match the name of an unparsed entity declared in
the DTD."
This seems to contradict the error message I get.
If anyone knows if this is a bug or just my misunderstanding, I'd really
appreciate the feedback. Below is a specific example illustrating the
problem.
Thanks for all your help.
Jim Fjerstad
***********************************************
EXAMPLE:
<?xml version = "1.0" encoding="UTF-8" standalone = "yes"?>
<!DOCTYPE TestRoot [
<!NOTATION TestFmt SYSTEM "c:\testapp.exe">
<!ELEMENT TestRoot ANY>
<!ELEMENT TestElement EMPTY>
<!ATTLIST TestElement
data ENTITY #REQUIRED
app NOTATION (TestFmt) #REQUIRED>
<!ENTITY TestFile SYSTEM "c:\test.tst" NDATA TestFmt>
]>
<TestRoot>
<TestElement data = "&TestFile;" app = "TestFmt"/>
</TestRoot>
SAXPrint gives me the following error:
Fatal Error at file D:\test\xml\test2.xml, line 12, char 33
Message: Unparsed entitty references, 'TestFile', not valid here
Re: Unparsed entities problem (again)
Posted by Dean Roddey <dr...@charmedquark.com>.
I think this issue is that is supposed to be like this:
> <TestRoot>
> <TestElement data = "TestFmt" app = "TestFmt"/>
> </TestRoot>
I.e. you don't do an entity reference, you use the notation name itself. By
having said that the attribute is of type notation, it knows to look for the
name of a notation. But you are trying to make it parse an entity at that
place.
--------------------------
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: "Fjerstad, Jim (LNG-MBC)" <ji...@capsoft.com>
To: <xe...@xml.apache.org>
Sent: Wednesday, August 09, 2000 12:17 PM
Subject: Unparsed entities problem (again)
> I asked this question before, but I think my communication was too vague,
so
> I didn't get a response.
>
> I have either found a bug in the Xerces SAX parser (Win32, v1.2a), or I
have
> a misunderstanding of the XML spec with respect to unparsed entities. When
> the parser reads an entity attribute that identifies an unparsed entity,
it
> fails with an error. However, the way I read the XML spec, it seems that
the
> entity reference should be OK. The part of the XML specification I'm
> referring to is section 3.3.1, "Validity Constraint: Entity Name." The
> specific portion I'm referring to says (in part):