Another question regarding External schema validation

Is there a way to specify an absolute path to the schema file?

It seems as though the only option is the current directory xerces is
running in.

I am try to do this under unix.

I have tried various combinations like:

 /opt/local/data/schema.xsd

  or

 file:///opt/local/data/schema.xsd


all variations throw the same exception
Warning at file , line 0, char 0
  Message: An exception occurred! Type:RuntimeException,
Message:Warning: The primary document  entity could not be opened.
Id=schema.xsd


Thanks

Randy


-----Original Message-----
From: WATTS, RANDY (ATTSI) 
Sent: Tuesday, June 12, 2007 10:37 AM
To: [email protected]
Subject: RE: Re: SAX2 External Schema validation problem


Boris,

That was it.

Thanks

Randy

-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Boris Kolpackov
Sent: Friday, June 08, 2007 1:57 PM
To: [email protected]
Subject: Re: SAX2 External Schema validation problem


Hi Randy,

"WATTS, RANDY (ATTSI)" <[EMAIL PROTECTED]> writes:

>
parser->setProperty(XMLUni::fgXercesSchemaExternalSchemaLocation,
>         "http://schemas.xmlsoap.org/soap/envelope/ envelope.xsd");

You need to convert the second argument to XMLCh-based string. Something
along these lines:

XMLCh* str (XMLString::transcode (
              "http://schemas.xmlsoap.org/soap/envelope/
envelope.xsd"));

parser->setProperty(XMLUni::fgXercesSchemaExternalSchemaLocation, str);

XMLString::release (str);


> The schemas and XML documents I am working with work ok with the SAX1
> parser so I do not think I there are issues with the input data.

That's quite strange.


hth,
-boris


-- 
Boris Kolpackov
Code Synthesis Tools CC
http://www.codesynthesis.com
Open-Source, Cross-Platform C++ XML Data Binding

Reply via email to