> I am trying to do the equivalent of the EnumVal sample, except using a
> SchemaValidator instead of a DTDValidator. My program compiles, but just
> crashes when it tries to parse the start tag.
>
> Should I expect this to work yet? Any hints? I don't know my way around
> Xerces awfully well yet...
>
> Thanks in advance
>

Yes,
Seems that you ran into the same problem as I did when wrote the same sample
as you.
I wanted to open a bug but forgot :(
The workaround is the following:

- Don't use the Schema validator in a way they do for DTD validator

    Instead of

    //SchemaValidator* valToUse = new SchemaValidator;
    // SAXParser parser(valToUse);
...
    //SchemaGrammar* grammar = (SchemaGrammar*) valToUse->getGrammar();

    write:
    SAXParser parser;

    and later, access the Grammar as

    SchemaGrammar* grammar = (SchemaGrammar*)
parser.getValidator().getGrammar();

If you wish, you may use and rewrite my initial Schema sample (see the
attachment)

Best regards,

Peter A. Volchek
Software Engineer
Metis International, Inc.
[EMAIL PROTECTED]


SEnumVal.cpp

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to