The entity resolver is a functionality actually stolen from SAX to DOM and
if I'm not mistaken it is proposed as a DOM standard as well.
It is not DOM standard yet, but it has been a part of Xerces DOM for a long
time.

Lemme check how you can plug it in...
*lots of muffled dissorganized searching*
... yepp here it is.

void DOMBuilder::setEntityResolver(DOMEntityResolver* const handler);

Just create a DOMEntityResolver object (like the one I sent you).

  CString DTD = LoadDTDIntoString("somePath/someDTD.DTD");
  DOMEntityResolver* myResolver = new MyEntityResolver();
  myResolver->AddEntity("",
"http://server/complex/path/to/a/dir/someDTD.DTD";, DTD);

And call the function setEntityResolver.

  myParser.setEntityResolver(myResolver);

Then just parse away.

  myParser.parse(whatever);

If the xml file requests the entity
http://server/complex/path/to/a/dir/someDTD.DTD then the EntityResolver will
just return the data associated with that systemid. Problem solved.

/ Erik

-----Original Message-----
From: Leitner, Sarah M. [Contractor] [mailto:[EMAIL PROTECTED]]
Sent: den 16 januari 2003 16:13
To: '[EMAIL PROTECTED]'
Subject: still can't find DTD for my DOM program


Hey!  Erik has suggested I use an EntityResolver (and even given me code for
that). BUT I thought I could only do that with SAX. Can I do it with DOM? If
so, how?



Sarah

---------------------------------------------------------------------
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