Example #1
0
void NsSAX2Reader::entityDecl(const DTDEntityDecl& entityDecl,
			       const_bool isPEDecl,
			       const_bool isIgnored)
{
	if (fReadingIntSubset) {
		//add these chars to internalSubset variable
		fSubset.append(chOpenAngle);
		fSubset.append(chBang);
		fSubset.append(XMLUni::fgEntityString);
		fSubset.append(chSpace);

		fSubset.append(entityDecl.getName());

		const XMLCh* id = entityDecl.getPublicId();
		if (id != 0) {
			fSubset.append(chSpace);
			fSubset.append(XMLUni::fgPubIDString);
			fSubset.append(chSpace);
			fSubset.append(chDoubleQuote);
			fSubset.append(id);
			fSubset.append(chDoubleQuote);
		}
		id = entityDecl.getSystemId();
		if (id != 0) {
			fSubset.append(chSpace);
			fSubset.append(XMLUni::fgSysIDString);
			fSubset.append(chSpace);
			fSubset.append(chDoubleQuote);
			fSubset.append(id);
			fSubset.append(chDoubleQuote);

		}
		id = entityDecl.getNotationName();
		if (id != 0) {
			fSubset.append(chSpace);
			fSubset.append(XMLUni::fgNDATAString);
			fSubset.append(chSpace);
			fSubset.append(id);
		}
		id = entityDecl.getValue();
		if (id !=0) {
			fSubset.append(chSpace);
			fSubset.append(chDoubleQuote);
			fSubset.append(id);
			fSubset.append(chDoubleQuote);
		}

		fSubset.append(chCloseAngle);
	}
}
void SAXParser::entityDecl( const   DTDEntityDecl&  entityDecl
                            , const bool
                            , const bool            isIgnored)
{
    //
    //  If we have a DTD handler, and this entity is not ignored, and
    //  its an unparsed entity, then send this one.
    //
    if (fDTDHandler && !isIgnored)
    {
        if (entityDecl.isUnparsed())
        {
            fDTDHandler->unparsedEntityDecl
            (
                entityDecl.getName()
                , entityDecl.getPublicId()
                , entityDecl.getSystemId()
                , entityDecl.getNotationName()
            );
        }
    }
}