Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsDetecting errors in XSD Parsing
https://www.eclipse.org/forums/index.php/mv/msg/4547/13698/#msg_13698
there is an XSD with a snippet like this:
I would like the parser to notify me somehow that the first thing in the
sequence is not a legal xsd construct. Instead it continues parsing with
complex type and says it has just one element. I tried calling
XSDSchema.getDiagnostics() but got an empty list. Does anyone know under
what conditions getDiagnostics returns errors?
Obviously there are a lot more things that can go wrong with parsing - can
anyone point me in the right direction?
Thanks,
Hayden Marchant]]>Hayden Marchant2003-03-11T11:31:00-00:00Re: Detecting errors in XSD Parsing
https://www.eclipse.org/forums/index.php/mv/msg/4547/13719/#msg_13719
Originally posted by: merks.ca.ibm.com
Hayden,
If you call XSDConcreteComponent.validate on your XSDSchema, it will validate
the whole schema. For this particular case, it will produce a diagnostic
indicating that gfgfd is not permitted.
Hayden Marchant wrote:
> I need to be able to detect bad xsd's during parsing. For example, if
> there is an XSD with a snippet like this:
>
> <xsd:complexType name="stim">
> <xsd:sequence>
> <xsd:gfgfd name="This" type="xsd:string"/>
> <xsd:element name="that" type="xsd:string"/>
> </xsd:sequence>
> </xsd:complexType>
>
> I would like the parser to notify me somehow that the first thing in the
> sequence is not a legal xsd construct. Instead it continues parsing with
> complex type and says it has just one element. I tried calling
> XSDSchema.getDiagnostics() but got an empty list. Does anyone know under
> what conditions getDiagnostics returns errors?
>
> Obviously there are a lot more things that can go wrong with parsing - can
> anyone point me in the right direction?
>
> Thanks,
>
> Hayden Marchant]]>2003-03-11T12:22:07-00:00Re: Detecting errors in XSD Parsing
https://www.eclipse.org/forums/index.php/mv/msg/4547/566222/#msg_566222
If you call XSDConcreteComponent.validate on your XSDSchema, it will validate
the whole schema. For this particular case, it will produce a diagnostic
indicating that gfgfd is not permitted.
Hayden Marchant wrote:
> I need to be able to detect bad xsd's during parsing. For example, if
> there is an XSD with a snippet like this:
>
> <xsd:complexType name="stim">
> <xsd:sequence>
> <xsd:gfgfd name="This" type="xsd:string"/>
> <xsd:element name="that" type="xsd:string"/>
> </xsd:sequence>
> </xsd:complexType>
>
> I would like the parser to notify me somehow that the first thing in the
> sequence is not a legal xsd construct. Instead it continues parsing with
> complex type and says it has just one element. I tried calling
> XSDSchema.getDiagnostics() but got an empty list. Does anyone know under
> what conditions getDiagnostics returns errors?
>
> Obviously there are a lot more things that can go wrong with parsing - can
> anyone point me in the right direction?
>
> Thanks,
>
> Hayden Marchant]]>Ed Merks2003-03-11T12:22:07-00:00