Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » QName validation(QName attributes are not validated)
QName validation [message #545223] Wed, 07 July 2010 08:59 Go to next message
Tsvetan Stoyanov is currently offline Tsvetan StoyanovFriend
Messages: 10
Registered: July 2009
Junior Member
Hi all,

I noticed that the literal values of QName attributes are not validated.
Here's an example:

In one schema:
<simpleType name="My;SimpleType" .../>


In another schema:
<element name="e1" type="sch1:My;SimpleType"/>


Notice that the value of the name and type attributes is not correct - it contains ;.

As expected the validation of the first schema fails because of the incorrect value, but the second schema validation is OK - even if the type attribute value is incorrect the type itself is resolved.

Is this an expected behavior? Shouldn't be the literal attribute value the one that must be validated first?

[Updated on: Wed, 07 July 2010 09:00]

Report message to a moderator

Re: QName validation [message #545324 is a reply to message #545223] Wed, 07 July 2010 12:53 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
I'm not sure what's to be gained from repeating that error on each use?
A single error at the point of definition would seem more useful;
resolving the name properly regardless of the ill formed nature of its
characters helps with fixing such an error...


Tsvetan Stoyanov wrote:
> Hi all,
>
> I noticed that the literal values of QName attributes are not validated.
> Here's an example:
>
> In one schema:
> <simpleType name="My;SimpleType" .../>
>
> In another schema:
> <element name="e1" type="sch1:My;SimpleType"/>
>
> Notice that the value of the name and type attributes is not correct -
> it contains ;.
>
> As expected the validation of the first schema fails because of the
> incorrect value, but the second schema validation is OK - even if the
> type attribute value is incorrect the type itself is resolved.
>
> Is this an expected behavior? Shouldn't be the literal attribute value
> the one that must be validated first?
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: QName validation [message #545348 is a reply to message #545324] Wed, 07 July 2010 13:41 Go to previous messageGo to next message
Tsvetan Stoyanov is currently offline Tsvetan StoyanovFriend
Messages: 10
Registered: July 2009
Junior Member
Hi Ed,

I think these are two errors - one for the definition and one for the usage. And hiding (skipping) the usage error makes the whole schema valid, which in actually not true.
In a hypothetic UI editor, the second schema will look as valid since the type is resolved and no validation errors are reported, but actually the attribute value remains invalid in respect to its schema.

Best Regards,
Tsvetan
Re: QName validation [message #545385 is a reply to message #545348] Wed, 07 July 2010 15:08 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Tsvetan,

What does Xerces do in this situation? I suppose we should try to do
much the same thing.


Tsvetan Stoyanov wrote:
> Hi Ed,
>
> I think these are two errors - one for the definition and one for the
> usage. And hiding (skipping) the usage error makes the whole schema
> valid, which in actually not true.
> In a hypothetic UI editor, the second schema will look as valid since
> the type is resolved and no validation errors are reported, but
> actually the attribute value remains invalid in respect to its schema.
>
> Best Regards,
> Tsvetan


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: QName validation [message #604673 is a reply to message #545324] Wed, 07 July 2010 13:41 Go to previous message
Tsvetan Stoyanov is currently offline Tsvetan StoyanovFriend
Messages: 10
Registered: July 2009
Junior Member
Hi Ed,

I think these are two errors - one for the definition and one for the usage. And hiding (skipping) the usage error makes the whole schema valid, which in actually not true.
In a hypothetic UI editor, the second schema will look as valid since the type is resolved and no validation errors are reported, but actually the attribute value remains invalid in respect to its schema.

Best Regards,
Tsvetan
Re: QName validation [message #604677 is a reply to message #545348] Wed, 07 July 2010 15:08 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Tsvetan,

What does Xerces do in this situation? I suppose we should try to do
much the same thing.


Tsvetan Stoyanov wrote:
> Hi Ed,
>
> I think these are two errors - one for the definition and one for the
> usage. And hiding (skipping) the usage error makes the whole schema
> valid, which in actually not true.
> In a hypothetic UI editor, the second schema will look as valid since
> the type is resolved and no validation errors are reported, but
> actually the attribute value remains invalid in respect to its schema.
>
> Best Regards,
> Tsvetan


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:QName validation
Next Topic:XML parsers
Goto Forum:
  


Current Time: Fri Apr 19 23:40:52 GMT 2024

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

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

Back to the top