Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Detecting errors in XSD Parsing
Detecting errors in XSD Parsing [message #13698] Tue, 11 March 2003 11:31 Go to next message
Hayden Marchant is currently offline Hayden MarchantFriend
Messages: 90
Registered: July 2009
Member
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
Re: Detecting errors in XSD Parsing [message #13719 is a reply to message #13698] Tue, 11 March 2003 12:22 Go to previous message
Eclipse UserFriend
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
Re: Detecting errors in XSD Parsing [message #566222 is a reply to message #13698] Tue, 11 March 2003 12:22 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
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


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Detecting errors in XSD Parsing
Next Topic:representation of empty entensions
Goto Forum:
  


Current Time: Thu Apr 25 21:26:55 GMT 2024

Powered by FUDForum. Page generated in 0.02893 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top