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 Karl Beauchamp <Ka...@IxiaSoft.com> on 2002/05/14 21:31:21 UTC

External entity

Hi,

Here is an xml document which contains an internal DTD and a link over an
external DTD. My xml document contains an entity that is not declared into
the internal DTD. 

==================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Test SYSTEM "E:\Test.dtd" [
<!ELEMENT Test (#PCDATA)>
]>
<Test>Some text... &entityExternallyDefined;</Test>
==================================

I use a SAXParser to get all the xml content. I register an xml document
handler by calling installAdvDocHandler and I register a DTD handler by
calling setDTDHandler. Since I don't want the parser to open the external
DTD, I register an EntityResolver and put the following code into the
function called "resolveEntity":

==================================
InputSource* Test::resolveEntity(const XMLCh *const publicId,const XMLCh
*const systemId)
{
    return new MemBufInputSource( reinterpret_cast<const XMLByte*>("") , 0,
"TEST", false );
}
==================================

Now, here is my question:
How can I get the entity called "entityExternallyDefined"??? I mean, I don't
want to write its value but I want to be notified by the parser when it
encounters an unresolved entity... I didn't find any callback method that
notifies me when it find an unresolved entity. I get all the xml stuff
except this: "&entityExternallyDefined;".

Does anyone know how to do that?

Thanks

Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org