W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2012

RE: XSD 1.1: not okay to have an xs:assert at the attribute level?

From: Costello, Roger L. <costello@mitre.org>
Date: Sun, 23 Sep 2012 21:39:49 +0000
To: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Message-ID: <B5FEE00B53CF054AA8439027E8FE17751E65F87A@IMCMBX04.MITRE.ORG>
> <xsd:assert test="QName('http://www.w3.org/2001/XMLSchema',
> string(@name)) eq xsd:QName('xsd:element')"/>

Nice work Mukul. 

You used XERCES, right? 

I tried that with SAXON and got errors.

So either XERCES is accepting as valid something that it shouldn't or SAXON is not accepting as valid something that it should.  

XML Schema Working Group: what is the truth?

/Roger



-----Original Message-----
From: Mukul Gandhi [mailto:gandhi.mukul@gmail.com] 
Sent: Sunday, September 23, 2012 12:59 PM
To: Costello, Roger L.
Cc: xmlschema-dev@w3.org
Subject: Re: XSD 1.1: not okay to have an xs:assert at the attribute level?

Hi Roger,
    The following <assert>,

<xsd:assert test="QName('http://www.w3.org/2001/XMLSchema',
string(@name)) eq xsd:QName('xsd:element')"/>

seems to give me the result that you want.

On Sun, Sep 23, 2012 at 9:03 PM, Costello, Roger L. <costello@mitre.org> wrote:
> Hello Mukul,
>
>> <xsd:assert test="string(@name) eq 'xsd:element'" />
>
> That's a good idea, but the value of @name is not a string, it is a QName. Thus, I should be able to change the namespace prefix:
>
> <xsd:assert test="string(@name) eq 'xs:element'" />
>
> and the assertion should still work.
>
> /Roger




-- 
Regards,
Mukul Gandhi
Received on Sunday, 23 September 2012 21:40:16 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 23 September 2012 21:40:16 GMT