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 Shirish Kulkarni <sh...@yahoo.com> on 2003/03/19 08:47:40 UTC
To access DOMParser object from EntityReolver
Hi,
The xerces DOMParser is observed to be crashing ( as a
known bug
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8011
) if specified Schema file is missing.
To avoid this, I am having the following proposal
+ if the file to be opened is found to be missing
+ then disable the schema / namespace validation for
the parser
This will be implemented within resolveEntity()
callback. Following is the code snippet.
LocalFileInputSource * local_file_input_source =
new
LocalFileInputSource(path_dom_string.rawBuffer());
BinFileInputStream binary_file_input_steam =
local_file_input_source->makeStream();
bool is_open =
binary_file_input_steam.getIsOpen();
if ( is_open == false )
{
/*
ValSchemes gValScheme = Val_Never;
bool gDoNamespaces = false;
bool gDoSchema = false;
setValidationScheme(gValScheme);
setDoNamespaces(gDoNamespaces);
setDoSchema(gDoSchema);
*/
}
I am not sure, how to access the parser object from
which resolveEntity callback has got initiated. I
searched all the public APIs / DOMParser.hpp /
HandlerBase.hpp, but there seems to be no direct way.
Please suggest some work-around.
With best regards,
Shirish
__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
RE: To access DOMParser object from EntityReolver
Posted by Erik Rydgren <er...@mandarinen.se>.
There isn't a way to do this in the API. You'll have to use a double
reference and register the entityresolver into the parser and the parser
into the entityresolver. Which of course frells up the possibility of using
reentrant entityresolvers, which can be connected to several parsers at a
given time.
Regards
Erik Rydgren
Mandarinen systems AB
Sweden
-----Original Message-----
From: Shirish Kulkarni [mailto:shirish_kul@yahoo.com]
Sent: den 19 mars 2003 08:48
To: xerces-c-dev@xml.apache.org
Subject: To access DOMParser object from EntityReolver
Hi,
The xerces DOMParser is observed to be crashing ( as a
known bug
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8011
) if specified Schema file is missing.
To avoid this, I am having the following proposal
+ if the file to be opened is found to be missing
+ then disable the schema / namespace validation for
the parser
This will be implemented within resolveEntity()
callback. Following is the code snippet.
LocalFileInputSource * local_file_input_source =
new
LocalFileInputSource(path_dom_string.rawBuffer());
BinFileInputStream binary_file_input_steam =
local_file_input_source->makeStream();
bool is_open =
binary_file_input_steam.getIsOpen();
if ( is_open == false )
{
/*
ValSchemes gValScheme = Val_Never;
bool gDoNamespaces = false;
bool gDoSchema = false;
setValidationScheme(gValScheme);
setDoNamespaces(gDoNamespaces);
setDoSchema(gDoSchema);
*/
}
I am not sure, how to access the parser object from
which resolveEntity callback has got initiated. I
searched all the public APIs / DOMParser.hpp /
HandlerBase.hpp, but there seems to be no direct way.
Please suggest some work-around.
With best regards,
Shirish
__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
---------------------------------------------------------------------
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