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 "Leitner, Sarah M. [Contractor]" <le...@spawar.navy.mil> on 2003/01/16 16:12:39 UTC
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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
Re: still can't find DTD for my DOM program
Posted by Colin Paul Adams <co...@colina.demon.co.uk>.
>>>>> "Erik" == Erik Rydgren <er...@mandarinen.se> writes:
Erik> The entity resolver is a functionality actually stolen from
Erik> SAX to DOM and if I'm not mistaken it is proposed as a DOM
Erik> standard as well. It is not DOM standard yet, but it has
Erik> been a part of Xerces DOM for a long time.
it is in the proposed 3.0 draft. But it depends upon DOMInputSource,
which isn't fully implemented in Xerces yet (in fact, it's useless as
far as I can see).
--
Colin Paul Adams
Preston Lancashire
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
RE: still can't find DTD for my DOM program
Posted by Erik Rydgren <er...@mandarinen.se>.
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:leitners@spawar.navy.mil]
Sent: den 16 januari 2003 16:13
To: 'xerces-c-dev@xml.apache.org'
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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org