Skip to main content



      Home
Home » Archived » XML Schema Definition (XSD) » QName validation(QName attributes are not validated)
QName validation [message #545223] Wed, 07 July 2010 04:59 Go to next message
Eclipse UserFriend
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 05:00] by Moderator

Re: QName validation [message #545324 is a reply to message #545223] Wed, 07 July 2010 08:53 Go to previous messageGo to next message
Eclipse UserFriend
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?
>
Re: QName validation [message #545348 is a reply to message #545324] Wed, 07 July 2010 09:41 Go to previous messageGo to next message
Eclipse UserFriend
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 11:08 Go to previous message
Eclipse UserFriend
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
Re: QName validation [message #604673 is a reply to message #545324] Wed, 07 July 2010 09:41 Go to previous message
Eclipse UserFriend
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 11:08 Go to previous message
Eclipse UserFriend
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
Previous Topic:QName validation
Next Topic:XML parsers
Goto Forum:
  


Current Time: Thu Jul 03 08:28:36 EDT 2025

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

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

Back to the top