Ugh. I am so dumb. Nevermind. Before I had this:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<authNotify
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.quikq.com/xsd/authNotify"
xsi:schemaLocation="http://www.quikq.com/xsd/authNotify authNotify.xsd">
I changed it to this:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<authNotify
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.quikq.com/xsd/authNotify"
xsi:schemaLocation="http://www.quikq.com/xsd/authNotify
/home/dfcuser/authNotify.xsd">
Initially it didn't work this way either. I scratched my head
thinking that I knew I had XSD's in my HOME directory, what could be
wrong? Well, my home directory isn't /home/dfcuser and I had no XSDs
there at all. I copied them over and all is good now. If you specify
no path the parser defaults to the same directory as the instance
document. At least I have this email to remind me when dumbness
strikes again. :-)
On Thu, Jan 7, 2010 at 9:55 AM, Kelly Beard <[email protected]> wrote:
> I've just now started using SAX2 because I like the callback method it
> provides. Problem is my xml files are coming in a directory where the
> XSD isn't so parse() is bailing because the document isn't valid. The
> parsing routine is expecting the XSD to be in the same directory as
> the XML. The schemaLocation thing doesn't work like I thought and
> changing this doesn't do anything. So what so I need to do to give
> the parser some direction? I'm setting up my parser like so:
>
> parser = XMLReaderFactory::createXMLReader();
> parser->setFeature(XMLUni::fgSAX2CoreValidation, true);
> parser->setFeature(XMLUni::fgSAX2CoreNameSpaces, true); // optional
> parser->setFeature(XMLUni::fgXercesValidationErrorAsFatal, true);
> parser->setValidationConstraintFatal(true);
> parser->setExitOnFirstFatalError(true);
>
> defaultHandler = new AuthNotifyHandler();
> parser->setContentHandler(defaultHandler);
> parser->setErrorHandler(defaultHandler);
>
> Thanks as usual!
>
> --
> Kelly Beard
>
--
Kelly Beard