Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: XML schema

From: "Michael Kay" <mike@--------.--->
To: =?iso-8859-1?Q?'Bence_Tak=E1cs'?= <takacs.bence@-----.--->,
Date: 10/19/2009 4:03:00 PM
This looks correct (from visual inspection).
 
To run it you will need Saxon 9.2 or the development version of Xerces (I
can't speak for Xerces). Most schema tools do not yet support XSD 1.1, and
both these two are incomplete implementations.
 
You don't need to change the xs:schema element in order to use XSD 1.1. All
you need to do is to use an XSD 1.1 processor.
 
Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


  _____  

From: xmlschema-dev-request@w... [mailto:xmlschema-dev-request@w...] On
Behalf Of Bence Takács
Sent: 19 October 2009 16:22
To: xmlschema-dev@w...
Subject: Re: XML schema


Hi, Michael

Would it be something like this?
<xs:attribute name="attribute_id" use="required">
   <xs:simpleType>
       <xs:restriction base="xs:string">                   

           <xs:assert test="@attribute_id=Attributes/Attribute/@id or
@attribute_id='id'"> 
       </xs:restriction>
   </xs:simpleType>
</xs:attribute>

We are using saxon8 to parse and eclipse and altova xml spy to edit xml.
Are they support 1.1?

Is 1.1 backward compatible with 1.0? I mean: is it enough to change the
header of the xml and xsd or the whole xsd and xml should have been changed?

Is this the correct header for xsd?
<?xml version="1.1" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault=" 
unqualified">

Because both eclipse and xml spy says that it is not valid.

Thanks for help.

Regards:
   Bence




On Mon, Oct 19, 2009 at 12:27 AM, Michael Kay <mike@s...> wrote:


I don't think this can be done in XSD 1.0

It can be done in XSD 1.1, of course, using assertions.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay


> -----Original Message-----
> From: xmlschema-dev-request@w...
> [mailto:xmlschema-dev-request@w...] On Behalf Of btakacs
> Sent: 18 October 2009 11:32
> To: xmlschema-dev@w...
> Subject: XML schema
>
> Hi
>
> I have an xml schema which restricts the
> Indexes/Tag/@attribute_id values to the ones are defined in
> the parent element's Attributes/Attribute/@id. Is there a way
> to extend this and enable one (or more) different static
> values for example "id"?
> There are more Indexes/Tag and Attributes/Attribute tags and
> i would like to use this restriction only for thoose that has
> the same parent.
>
> Here is my current configuration:
>
> ....
> <xs:element name="Attributes">
>   <xs:complexType>
>     <xs:sequence>
>       <xs:element name="Attribute" maxOccurs="unbounded">
>       <xs:complexType>
>         <xs:complexContent>
>           <xs:extension base="Attribute_Type">
>             <xs:attribute name="typedef_id" type="xs:string"
> use="required"/>
>              </xs:extension>
>         </xs:complexContent>
>       </xs:complexType>
>       </xs:element>
>     </xs:sequence>
>   </xs:complexType>
> </xs:element>
> ....
> <xs:element name="Indexes" minOccurs="0">
>   <xs:complexType>
>     <xs:sequence>
>       <xs:element name="Tag" maxOccurs="unbounded">
>       <xs:complexType>
>           <xs:attribute name="attribute_id" use="required">
>               <xs:simpleType>
>                 <xs:restriction base="xs:string">
>                   <xs:pattern value="[a-z0-9]([a-z0-9.]|(_[a-z]))*"/>
>                      </xs:restriction>
>                   </xs:simpleType>
>                 </xs:attribute>
>              </xs:complexType>
>            </xs:element>
>         </xs:sequence>
>    </xs:complexType>
> </xs:element>
> ....
> ....
> <xs:key name="ATTRIBUTE">
>     <xs:selector xpath="Attributes/Attribute"/>
>     <xs:field xpath="@id"/>
> </xs:key>
> <xs:keyref name="X001" refer="ATTRIBUTE">
>    <xs:selector xpath="Indexes/Tag"/>
>    <xs:field xpath="@attribute_id"/>
> </xs:keyref>
> ....
>
>
> Thanks:
>    Bence
> --
> View this message in context:
> http://www.nabble.com/XML-schema-tp25945562p25945562.html
> Sent from the w3.org - xmlschema-dev mailing list archive at
> Nabble.com.
>
>
>






transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent