Hi Yoann,

Are you using a binary built from the XML Schema 1.1 development branch
[1]? We're still working on implementing these features. It's possible
support for xs:error isn't there yet or isn't correct. I haven't looked at
this much though. Khaled, Mukul and/or Hiranya would probably have more
insight.

Thanks.

[1] http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrgla...@ca.ibm.com
E-mail: mrgla...@apache.org

yoann moranville <yoann.moranvi...@gmail.com> wrote on 05/03/2010 09:03:45
AM:

> Dear all,
>
> I am facing an issue while validating using XSD1.1.
> I want to decide on the type of an element depending on one of its
> attribute value:
>
> <xs:element name="myElement">
>     <xs:alternative test="@attribute = 'value1'"
type="myElement.value1" />
>     <xs:alternative test="@attribute = 'value2'"
type="myElement.value2" />
> </xs:element>
>
> Now that works, both types "myElement.value1" and "myElement.value2"
> are complex types.
>
> However, I realized that if I have @attribute = 'value3', no errors
> are being thrown so I wanted to add a new alternative rule:
>     <xs:alternative test="(@attribute ne 'value1') or (@attribute ne
> 'value2')" type="xs:error" />
>
> But when that occurs, the validation error begin thrown are not what I
> am waiting for, it says that my attributes are not correct since the
> type of myElement is of simple type.
>
> So how could I throw an error saying that my @attribute is not of
> correct values?
>
> Thank you,
> Yoann
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org
> For additional commands, e-mail: j-users-h...@xerces.apache.org

Reply via email to