You are viewing a plain text version of this content. The canonical link for it is here.
Posted to p-dev@xerces.apache.org by "Skarupa, Steven" <ss...@epotec.com> on 2002/07/17 00:17:51 UTC

setExternalSchemaLocation help

Hi.
 
I'm relatively new to mod_perl and Xerces. I am currently using the Xerces
parser in order to take advantage of the ability to bounce some xml
documents against schemas for the purpose of simple validation.
 
I need to set the schema location dynamically at runtime and can not figure
out how to convert the C++ setExternalSchemaLocation call to Perl.  
 
Here is the related code:
 
 eval {
         open INPUT_FILE, $file or die "could not open file because $!";
         # Do some file slurping here.
         undef $/;
         my $file_contents =<INPUT_FILE>;
         close INPUT_FILE;
         $parser->setExternalSchemaLocation("http://www.test.com
<http://www.test.com>  is_blank.xsd");
         $parser->parse
(XML::Xerces::MemBufInputSource->new($file_contents));
    };

I receive the following error at STDOUT:
 
    Can't locate auto/XML/Xerces/SAX2XMLReader/setExternal.al in @INC (@INC
 
I have:
   > Studied the C++ API documentation (but I'm not a C++ coder so it's only
faintly understandable to me)
   > Read through the schema information on
http://xml.apache.org/xerces-c/schema.html
<http://xml.apache.org/xerces-c/schema.html>  <http://www.apache.org/xml> 
   > Searched the xerces-p-dev archives - no luck.
   > tried to get a grip on what the Xerces.pm wrapper module is doing
(that's where I found the setExternalSchemaLocation call).
   > mungled the SAX2Count.pl script into my own version that works
"dynamically" and it seems to work fine if I remove the offending
setExternalSchemaLocation call and add the schema line to the xml file
itself.
 
Can anyone help me?  
 
Thanks!
-Steve


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************