Hi, Jason,

      The entityNode itself does NOT maintain the --value--, and if it is
referenced,
the DOMParser will be notified by the Scanner (startEntityReference()), and
it will
decide if entityReferenceNode to be created or not (based on the
fCreateEntityReferenceNodes),
in case this is true, an entityReferenceNode is created, and the entityNode
will setEntityRef() to point to the entityReferenceNode created.

      That entityReferenceNode may give you back the -value- of the
entityNode (though
i am working hard trying to find out how it is done).

      Besides, if you run your sample with the latest version of XercesLib,
you may find
that those predefined entities are no longer kept in the DocumentType, and
neither the
populateDocumentType().



Regards,

Peiyong Zhang
____________________________________________
XML Parsers Development
IBM Toronto Laboratory email: [EMAIL PROTECTED]
Phone: (416)448-4088; Fax: (416)448-4414; T/L: 778-4088



[EMAIL PROTECTED] (Jason E. Stewart)@openinformatics.com> on
05/07/2001 08:22:39 PM

Please respond to [EMAIL PROTECTED]

Sent by:  "Jason E. Stewart" <[EMAIL PROTECTED]>


To:   [EMAIL PROTECTED]
cc:
Subject:  Re: getEntities() failure


"Jason E. Stewart" <[EMAIL PROTECTED]> writes:

> "Jason E. Stewart" <[EMAIL PROTECTED]> writes:
>
> > I've been wrestling with printing out the values of Entities defined
> > in the internal subset of the DOCTYPE. I've discovered that to get the
> > info I need to have setCreateEntityReferenceNodes(TRUE). I would love
> > to know where this is documented anywhere in Xerces. And what do
> > entity reference nodes have to do with this? I'm retrieving data from
> > the doctype, not asking for the entities used in the document, or
> > maybe I'm confused about what entity reference nodes really are...
>
> To add to the illogic of the situation. If I add an entity to the
> doctype, but do not use it in the text of the document, it has no
> value when I access it in the doctype.
>


OK. After digging a bit I find this:

void DOMParser::populateDocumentType()
{

           NameIdPoolEnumerator<DTDEntityDecl> entityPoolEnum =
((DTDValidator*)fValidator)->getEntityEnumerator();

           while(entityPoolEnum.hasMoreElements()) {
                     DTDEntityDecl* entityDecl =
&entityPoolEnum.nextElement();
                     EntityImpl* entity = ((DocumentImpl*)fDocument.fImpl)
->createEntity(entityDecl->getName());
                     entity->setPublicId(entityDecl->getPublicId());
                     entity->setSystemId(entityDecl->getSystemId());
                     entity->setNotationName(entityDecl->getNotationName
());
                     fDocumentType->entities->setNamedItem( entity );
           }
}

So the entities that get created here only have their name set, which
is what I have seen. But nowhere can I find how the child text nodes
get added in some cases.

I'd really appreciate some assistance with this one,
jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to