You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Khaled Noaman <kn...@ca.ibm.com> on 2007/11/09 23:01:02 UTC

[Request] Xerces-J: XML Schema 1.1 feature feedback

Hi,

The W3C Schema WG has released a last call working draft of XML Schema 1.1 
Part 1: Structures. We are considering implementing features from this 
draft in Xerces-J. We would like to understand which features users are 
most interested in and what scenarios they plan on using them in.

Here's a summary of the major features introduced in the spec:

All Group 
XML Schema 1.0 imposed many restrictions on <all> groups. XML Schema 1.1 
has relaxed several of those constraints:
<all> groups can now be extended by adding more members to them.
Wildcards are now allowed.
Particles in <all> groups can now have the value of maxOccurs be greater 
than 1.

<xs:complexType name="applianceType">
 <xs:all>
  <xs:element name="item" type="xs:string"/>
  <xs:element name="description" type="xs:string"/>
 </xs:all>
</xs:complexType>

<xs:complexType name="heaterType">
 <xs:complexContent>
  <xs:extension base="applianceType">
   <xs:all>
    <xs:element name="power_in_watt" type="xs:integer"/>
    <xs:any processContents="lax"/>
   </xs:all>
  </xs:extension>
 </xs:complexContent>
</xs:complexType>

Assertions
A form of co-occurrence constraint, using XPath 2.0 expressions, that is 
associated with a complex type to constrain element and attribute values. 
The list of assertions is evaluated when a complex type is used to 
validate an element. 

<xs:complexType name="intRange">
 <xs:attribute name="min" type="xs:int"/>
 <xs:attribute name="max" type="xs:int"/>
 <xs:assert test="@min le @max"/>
</xs:complexType>

The value of the ?min? attribute must be less than the value of the ?max? 
attribute.

<xs:complexType name="arrayType">
 <xs:sequence>
  <xs:element name="entry" minOccurs="0" maxOccurs="unbounded"/>
 </xs:sequence>
 <xs:attribute name="length" type="xs:int"/>
 <xs:assert test="@length eq fn:count(./entry)"/>
</xs:complexType>

The value of the ?length? attribute must be equal to the number of 
occurrences of the ?entry? sub-elements.

Open Content Models
A new mechanism to allow content models to accept elements other than 
those explicitly defined. The schema author controls the degree of 
openness of the content model. They can specify whether elements should be 
accepted everywhere or at the end of the content model.

<xs:complexType name="name">
  <xs:openContent mode="suffix">
    <xs:any namespace="##other" processContents="skip"/>
  </xs:openContent>
  <xs:sequence>
    <xs:element name="given" type="xs:string"/>
    <xs:element name="middle" type="xs:string" minOccurs="0"/>
    <xs:element name="family" type="xs:string"/>
  </xs:sequence>
</xs:complexType>

A schema author can also define a default open content at the schema 
document level, thus saving many copy/paste if the open content is the 
same across the complex types.

<xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.example.com/example">
  . . .
  <xs:defaultOpenContent mode="interleave">
    <xs:any processContents="lax"/>
  </xs:defaultOpenContent>
  . . .
</xs:schema>

Enhanced Wildcards
In XML Schema 1.0, a schema author was only allowed to exclude elements 
and attributes from one namespace, the target namespace,  by using 
##other. In XML Schema 1.1, a schema author can define wildcards that 
exclude:
Elements and attributes from a set of namespaces by using [notNamespace]
A particular set of qualified elements and attributes by using [notQName]
?not-in-schema? elements and attributes (those that do not match any 
declaration in the schema)  by including the ##defined keyword in 
[notQName]

<xs:any namespace="http://www.w3.org/1999/XSL/Transform"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        notQName="xsl:comment xsl:fallback"/>

<xs:anyAttribute xmlns:ns1="http://ns1"
  notNamespace="ns1 ##targetNamespace"/>

Complex Type Restriction
The rules for checking validity of complex-type restrictions have been 
simplified. The set of elements or attributes accepted by a restriction 
must be a subset of those accepted by its base type.

Conditional Type Assignment
A form of co-occurrence constraint, using XPath 2.0, that allows for a 
type to be assigned to an element instance based on its properties 
(typically attribute values).

<xs:complexType name="valueType">
 <xs:simpleContent>
  <xs:extenstion base="xs:long">
   <xs:attribute name="kind" type="xs:string"/>
  </xs:extension>
 </xs:simpleContent>
</xs:complexType>

<xs:element name="value" type="valueType">
 <xs:alternative test="@kind='int'" type="xs:int"/>
 <xs:alternative test="@kind='short'" type="xs:short"/>
 <xs:alternative test="@kind='byte'" type="xs:byte"/>
</xs:element>

Default Attributes
A new mechanism that makes it easier for schema authors to include common 
attributes like xml:base and xml:lang in all their content models.

<xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.example.com/example" 
    defaultAttributes="defaultAttrGroup">
  . . .
</xs:schema>

Conditional Inclusion
A mechanism that allows conforming XML Schema 1.1 processors to 
successfully ignore new constructs introduced in future version of the 
spec. It also allows schema authors to define schemas with newer 
constructs and be able to fall back to older versions when the newer 
constructs are not available.

<xsd:schema 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning">

  <xsd:element name="e" vc:minVersion="3.2">
    <!--* declaration suitable for 3.2 
        * and later processors *-->
  </xsd:element>
  <xsd:element name="e" 
    vc:minVersion="1.1"
    vc:maxVersion="3.1">
    <!--* declaration suitable for processors
        * supporting versions 1.1 through 3.1
        *-->
  </xsd:element>
  ...
</xsd:schema>


We would appreciate your feedback.
 
Regards,
Khaled


Re: [Request] Xerces-J: XML Schema 1.1 feature feedback

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Hi Prashant,

Historically JAXP has just referenced the relevant W3C (and other)
specifications for the majority of its conformance requirements. I'd be a
bit surprised if it said anything about this (if no doc from the Schema
Working Group does).

If the schema 1.0 processor you're using doesn't support conditional
inclusion natively you could probably write an XSLT stylesheet which does
the preprocessing; feeding the schema documents through a Transformer and
the output from that to the SchemaFactory.

Thanks.

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

Prashant Reddy <pr...@pramati.com> wrote on 11/16/2007 12:03:01 AM:

> Hello Michael,
>
> Thank you for the clarification.
>
> Does this mean that the JAXP specification needs to be cognizant of this
> feature ?
>
> Thank you,
> -Prashant
>
> On Thu, 2007-11-15 at 23:19 -0500, Michael Glavassevich wrote:
> > Probably worth pointing out that in order to be immediately useful to
> > users, the conditional inclusion [1] feature would need to be supported
in
> > XML Schema 1.0 processors as well.
> >
> > [1] http://www.w3.org/TR/2007/WD-xmlschema11-1-20070830/#cip
> >
> > Michael Glavassevich
> > XML Parser Development
> > IBM Toronto Lab
> > E-mail: mrglavas@ca.ibm.com
> > E-mail: mrglavas@apache.org
> >
> > Prashant Reddy <pr...@pramati.com> wrote on 11/12/2007 03:16:38 AM:
> >
> > > Hello:
> > >
> > > 1. Conditional Inclusion
> > > 2. Assertions
> > >
> > > These features are what we are most interested in.
> > >
> > > Scenarios :
> > >
> > > 1. Conditional Inclusion : The example XML snippet which employs the
> > > "condition inclusion" along with XMLSchema-versioning is a very
> > > compelling use case for us.
> > >
> > > 2. Assertions : Similar validation code currently exists in factory
> > > methods that create the data objects from an XML instance document.
> > > Putting these in Schema with help of Assertion is makes it more
> > > portable.
> > >
> > > Appreciate the effort of collecting feedback while the specification
is
> > > evolving. Thank you.
> > >
> > > -Prashant
> > >
> > >
> > > On Fri, 2007-11-09 at 17:01 -0500, Khaled Noaman wrote:
> > > >
> > > > Hi,
> > > >
> > > > The W3C Schema WG has released a last call working draft of XML
Schema
> > > > 1.1 Part 1: Structures. We are considering implementing features
from
> > > > this draft in Xerces-J. We would like to understand which features
> > > > users are most interested in and what scenarios they plan on using
> > > > them in.
> > > >
> > > > Here's a summary of the major features introduced in the spec:
> > > >
> > > > All Group
> > > > XML Schema 1.0 imposed many restrictions on <all> groups. XML
Schema
> > > > 1.1 has relaxed several of those constraints:
> > > >       * <all> groups can now be extended by adding more members to
> > > >         them.
> > > >       * Wildcards are now allowed.
> > > >       * Particles in <all> groups can now have the value of
maxOccurs
> > > >         be greater than 1.
> > > >
> > > > <xs:complexType name="applianceType">
> > > >  <xs:all>
> > > >   <xs:element name="item" type="xs:string"/>
> > > >   <xs:element name="description" type="xs:string"/>
> > > >  </xs:all>
> > > > </xs:complexType>
> > > >
> > > > <xs:complexType name="heaterType">
> > > >  <xs:complexContent>
> > > >   <xs:extension base="applianceType">
> > > >    <xs:all>
> > > >     <xs:element name="power_in_watt" type="xs:integer"/>
> > > >     <xs:any processContents="lax"/>
> > > >    </xs:all>
> > > >   </xs:extension>
> > > >  </xs:complexContent>
> > > > </xs:complexType>
> > > >
> > > > Assertions
> > > > A form of co-occurrence constraint, using XPath 2.0 expressions,
that
> > > > is associated with a complex type to constrain element and
attribute
> > > > values. The list of assertions is evaluated when a complex type is
> > > > used to validate an element.
> > > >
> > > > <xs:complexType name="intRange">
> > > >  <xs:attribute name="min" type="xs:int"/>
> > > >  <xs:attribute name="max" type="xs:int"/>
> > > >  <xs:assert test="@min le @max"/>
> > > > </xs:complexType>
> > > >
> > > > The value of the ?min? attribute must be less than the value of the
> > > > ?max? attribute.
> > > >
> > > > <xs:complexType name="arrayType">
> > > >  <xs:sequence>
> > > >   <xs:element name="entry" minOccurs="0" maxOccurs="unbounded"/>
> > > >  </xs:sequence>
> > > >  <xs:attribute name="length" type="xs:int"/>
> > > >  <xs:assert test="@length eq fn:count(./entry)"/>
> > > > </xs:complexType>
> > > >
> > > > The value of the ?length? attribute must be equal to the number of
> > > > occurrences of the ?entry? sub-elements.
> > > >
> > > > Open Content Models
> > > > A new mechanism to allow content models to accept elements other
than
> > > > those explicitly defined. The schema author controls the degree of
> > > > openness of the content model. They can specify whether elements
> > > > should be accepted everywhere or at the end of the content model.
> > > >
> > > > <xs:complexType name="name">
> > > >   <xs:openContent mode="suffix">
> > > >     <xs:any namespace="##other" processContents="skip"/>
> > > >   </xs:openContent>
> > > >   <xs:sequence>
> > > >     <xs:element name="given" type="xs:string"/>
> > > >     <xs:element name="middle" type="xs:string" minOccurs="0"/>
> > > >     <xs:element name="family" type="xs:string"/>
> > > >   </xs:sequence>
> > > > </xs:complexType>
> > > >
> > > > A schema author can also define a default open content at the
schema
> > > > document level, thus saving many copy/paste if the open content is
the
> > > > same across the complex types.
> > > >
> > > > <xs:schema
> > > >     xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > > >     targetNamespace="http://www.example.com/example">
> > > >   . . .
> > > >   <xs:defaultOpenContent mode="interleave">
> > > >     <xs:any processContents="lax"/>
> > > >   </xs:defaultOpenContent>
> > > >   . . .
> > > > </xs:schema>
> > > >
> > > > Enhanced Wildcards
> > > > In XML Schema 1.0, a schema author was only allowed to exclude
> > > > elements and attributes from one namespace, the target namespace,
by
> > > > using ##other. In XML Schema 1.1, a schema author can define
wildcards
> > > > that exclude:
> > > >       * Elements and attributes from a set of namespaces by using
> > > >         [notNamespace]
> > > >       * A particular set of qualified elements and attributes by
using
> > > >         [notQName]
> > > >       * ?not-in-schema? elements and attributes (those that do not
> > > >         match any declaration in the schema)  by including the
> > > >         ##defined keyword in [notQName]
> > > >
> > > > <xs:any namespace="http://www.w3.org/1999/XSL/Transform"
> > > >         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > > >         notQName="xsl:comment xsl:fallback"/>
> > > >
> > > > <xs:anyAttribute xmlns:ns1="http://ns1"
> > > >   notNamespace="ns1 ##targetNamespace"/>
> > > >
> > > > Complex Type Restriction
> > > > The rules for checking validity of complex-type restrictions have
been
> > > > simplified. The set of elements or attributes accepted by a
> > > > restriction must be a subset of those accepted by its base type.
> > > >
> > > > Conditional Type Assignment
> > > > A form of co-occurrence constraint, using XPath 2.0, that allows
for a
> > > > type to be assigned to an element instance based on its properties
> > > > (typically attribute values).
> > > >
> > > > <xs:complexType name="valueType">
> > > >  <xs:simpleContent>
> > > >   <xs:extenstion base="xs:long">
> > > >    <xs:attribute name="kind" type="xs:string"/>
> > > >   </xs:extension>
> > > >  </xs:simpleContent>
> > > > </xs:complexType>
> > > >
> > > > <xs:element name="value" type="valueType">
> > > >  <xs:alternative test="@kind='int'" type="xs:int"/>
> > > >  <xs:alternative test="@kind='short'" type="xs:short"/>
> > > >  <xs:alternative test="@kind='byte'" type="xs:byte"/>
> > > > </xs:element>
> > > >
> > > > Default Attributes
> > > > A new mechanism that makes it easier for schema authors to include
> > > > common attributes like xml:base and xml:lang in all their content
> > > > models.
> > > >
> > > > <xs:schema
> > > >     xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > > >     targetNamespace="http://www.example.com/example"
> > > >     defaultAttributes="defaultAttrGroup">
> > > >   . . .
> > > > </xs:schema>
> > > >
> > > > Conditional Inclusion
> > > > A mechanism that allows conforming XML Schema 1.1 processors to
> > > > successfully ignore new constructs introduced in future version of
the
> > > > spec. It also allows schema authors to define schemas with newer
> > > > constructs and be able to fall back to older versions when the
newer
> > > > constructs are not available.
> > > >
> > > > <xsd:schema
> > > >   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > > >   xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning">
> > > >
> > > >   <xsd:element name="e" vc:minVersion="3.2">
> > > >     <!--* declaration suitable for 3.2  >         * and later
> > > processors *-->
> > > >   </xsd:element>
> > > >   <xsd:element name="e"
> > > >     vc:minVersion="1.1"
> > > >     vc:maxVersion="3.1">
> > > >     <!--* declaration suitable for processors >         *> >
> supporting versions 1.1 through 3.1 >         *-->
> > > >   </xsd:element>
> > > >   ...
> > > > </xsd:schema>
> > > >
> > > >
> > > > We would appreciate your feedback.
> > > >
> > > > Regards,
> > > > Khaled
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> > > For additional commands, e-mail: j-users-help@xerces.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> > For additional commands, e-mail: j-users-help@xerces.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Re: [Request] Xerces-J: XML Schema 1.1 feature feedback

Posted by Prashant Reddy <pr...@pramati.com>.
Hello Michael,

Thank you for the clarification.

Does this mean that the JAXP specification needs to be cognizant of this
feature ? 

Thank you,
-Prashant

On Thu, 2007-11-15 at 23:19 -0500, Michael Glavassevich wrote:
> Probably worth pointing out that in order to be immediately useful to
> users, the conditional inclusion [1] feature would need to be supported in
> XML Schema 1.0 processors as well.
> 
> [1] http://www.w3.org/TR/2007/WD-xmlschema11-1-20070830/#cip
> 
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
> 
> Prashant Reddy <pr...@pramati.com> wrote on 11/12/2007 03:16:38 AM:
> 
> > Hello:
> >
> > 1. Conditional Inclusion
> > 2. Assertions
> >
> > These features are what we are most interested in.
> >
> > Scenarios :
> >
> > 1. Conditional Inclusion : The example XML snippet which employs the
> > "condition inclusion" along with XMLSchema-versioning is a very
> > compelling use case for us.
> >
> > 2. Assertions : Similar validation code currently exists in factory
> > methods that create the data objects from an XML instance document.
> > Putting these in Schema with help of Assertion is makes it more
> > portable.
> >
> > Appreciate the effort of collecting feedback while the specification is
> > evolving. Thank you.
> >
> > -Prashant
> >
> >
> > On Fri, 2007-11-09 at 17:01 -0500, Khaled Noaman wrote:
> > >
> > > Hi,
> > >
> > > The W3C Schema WG has released a last call working draft of XML Schema
> > > 1.1 Part 1: Structures. We are considering implementing features from
> > > this draft in Xerces-J. We would like to understand which features
> > > users are most interested in and what scenarios they plan on using
> > > them in.
> > >
> > > Here's a summary of the major features introduced in the spec:
> > >
> > > All Group
> > > XML Schema 1.0 imposed many restrictions on <all> groups. XML Schema
> > > 1.1 has relaxed several of those constraints:
> > >       * <all> groups can now be extended by adding more members to
> > >         them.
> > >       * Wildcards are now allowed.
> > >       * Particles in <all> groups can now have the value of maxOccurs
> > >         be greater than 1.
> > >
> > > <xs:complexType name="applianceType">
> > >  <xs:all>
> > >   <xs:element name="item" type="xs:string"/>
> > >   <xs:element name="description" type="xs:string"/>
> > >  </xs:all>
> > > </xs:complexType>
> > >
> > > <xs:complexType name="heaterType">
> > >  <xs:complexContent>
> > >   <xs:extension base="applianceType">
> > >    <xs:all>
> > >     <xs:element name="power_in_watt" type="xs:integer"/>
> > >     <xs:any processContents="lax"/>
> > >    </xs:all>
> > >   </xs:extension>
> > >  </xs:complexContent>
> > > </xs:complexType>
> > >
> > > Assertions
> > > A form of co-occurrence constraint, using XPath 2.0 expressions, that
> > > is associated with a complex type to constrain element and attribute
> > > values. The list of assertions is evaluated when a complex type is
> > > used to validate an element.
> > >
> > > <xs:complexType name="intRange">
> > >  <xs:attribute name="min" type="xs:int"/>
> > >  <xs:attribute name="max" type="xs:int"/>
> > >  <xs:assert test="@min le @max"/>
> > > </xs:complexType>
> > >
> > > The value of the ?min? attribute must be less than the value of the
> > > ?max? attribute.
> > >
> > > <xs:complexType name="arrayType">
> > >  <xs:sequence>
> > >   <xs:element name="entry" minOccurs="0" maxOccurs="unbounded"/>
> > >  </xs:sequence>
> > >  <xs:attribute name="length" type="xs:int"/>
> > >  <xs:assert test="@length eq fn:count(./entry)"/>
> > > </xs:complexType>
> > >
> > > The value of the ?length? attribute must be equal to the number of
> > > occurrences of the ?entry? sub-elements.
> > >
> > > Open Content Models
> > > A new mechanism to allow content models to accept elements other than
> > > those explicitly defined. The schema author controls the degree of
> > > openness of the content model. They can specify whether elements
> > > should be accepted everywhere or at the end of the content model.
> > >
> > > <xs:complexType name="name">
> > >   <xs:openContent mode="suffix">
> > >     <xs:any namespace="##other" processContents="skip"/>
> > >   </xs:openContent>
> > >   <xs:sequence>
> > >     <xs:element name="given" type="xs:string"/>
> > >     <xs:element name="middle" type="xs:string" minOccurs="0"/>
> > >     <xs:element name="family" type="xs:string"/>
> > >   </xs:sequence>
> > > </xs:complexType>
> > >
> > > A schema author can also define a default open content at the schema
> > > document level, thus saving many copy/paste if the open content is the
> > > same across the complex types.
> > >
> > > <xs:schema
> > >     xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > >     targetNamespace="http://www.example.com/example">
> > >   . . .
> > >   <xs:defaultOpenContent mode="interleave">
> > >     <xs:any processContents="lax"/>
> > >   </xs:defaultOpenContent>
> > >   . . .
> > > </xs:schema>
> > >
> > > Enhanced Wildcards
> > > In XML Schema 1.0, a schema author was only allowed to exclude
> > > elements and attributes from one namespace, the target namespace,  by
> > > using ##other. In XML Schema 1.1, a schema author can define wildcards
> > > that exclude:
> > >       * Elements and attributes from a set of namespaces by using
> > >         [notNamespace]
> > >       * A particular set of qualified elements and attributes by using
> > >         [notQName]
> > >       * ?not-in-schema? elements and attributes (those that do not
> > >         match any declaration in the schema)  by including the
> > >         ##defined keyword in [notQName]
> > >
> > > <xs:any namespace="http://www.w3.org/1999/XSL/Transform"
> > >         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > >         notQName="xsl:comment xsl:fallback"/>
> > >
> > > <xs:anyAttribute xmlns:ns1="http://ns1"
> > >   notNamespace="ns1 ##targetNamespace"/>
> > >
> > > Complex Type Restriction
> > > The rules for checking validity of complex-type restrictions have been
> > > simplified. The set of elements or attributes accepted by a
> > > restriction must be a subset of those accepted by its base type.
> > >
> > > Conditional Type Assignment
> > > A form of co-occurrence constraint, using XPath 2.0, that allows for a
> > > type to be assigned to an element instance based on its properties
> > > (typically attribute values).
> > >
> > > <xs:complexType name="valueType">
> > >  <xs:simpleContent>
> > >   <xs:extenstion base="xs:long">
> > >    <xs:attribute name="kind" type="xs:string"/>
> > >   </xs:extension>
> > >  </xs:simpleContent>
> > > </xs:complexType>
> > >
> > > <xs:element name="value" type="valueType">
> > >  <xs:alternative test="@kind='int'" type="xs:int"/>
> > >  <xs:alternative test="@kind='short'" type="xs:short"/>
> > >  <xs:alternative test="@kind='byte'" type="xs:byte"/>
> > > </xs:element>
> > >
> > > Default Attributes
> > > A new mechanism that makes it easier for schema authors to include
> > > common attributes like xml:base and xml:lang in all their content
> > > models.
> > >
> > > <xs:schema
> > >     xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > >     targetNamespace="http://www.example.com/example"
> > >     defaultAttributes="defaultAttrGroup">
> > >   . . .
> > > </xs:schema>
> > >
> > > Conditional Inclusion
> > > A mechanism that allows conforming XML Schema 1.1 processors to
> > > successfully ignore new constructs introduced in future version of the
> > > spec. It also allows schema authors to define schemas with newer
> > > constructs and be able to fall back to older versions when the newer
> > > constructs are not available.
> > >
> > > <xsd:schema
> > >   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > >   xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning">
> > >
> > >   <xsd:element name="e" vc:minVersion="3.2">
> > >     <!--* declaration suitable for 3.2  >         * and later
> > processors *-->
> > >   </xsd:element>
> > >   <xsd:element name="e"
> > >     vc:minVersion="1.1"
> > >     vc:maxVersion="3.1">
> > >     <!--* declaration suitable for processors >         *
> > supporting versions 1.1 through 3.1 >         *-->
> > >   </xsd:element>
> > >   ...
> > > </xsd:schema>
> > >
> > >
> > > We would appreciate your feedback.
> > >
> > > Regards,
> > > Khaled
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> > For additional commands, e-mail: j-users-help@xerces.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Re: [Request] Xerces-J: XML Schema 1.1 feature feedback

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Probably worth pointing out that in order to be immediately useful to
users, the conditional inclusion [1] feature would need to be supported in
XML Schema 1.0 processors as well.

[1] http://www.w3.org/TR/2007/WD-xmlschema11-1-20070830/#cip

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

Prashant Reddy <pr...@pramati.com> wrote on 11/12/2007 03:16:38 AM:

> Hello:
>
> 1. Conditional Inclusion
> 2. Assertions
>
> These features are what we are most interested in.
>
> Scenarios :
>
> 1. Conditional Inclusion : The example XML snippet which employs the
> "condition inclusion" along with XMLSchema-versioning is a very
> compelling use case for us.
>
> 2. Assertions : Similar validation code currently exists in factory
> methods that create the data objects from an XML instance document.
> Putting these in Schema with help of Assertion is makes it more
> portable.
>
> Appreciate the effort of collecting feedback while the specification is
> evolving. Thank you.
>
> -Prashant
>
>
> On Fri, 2007-11-09 at 17:01 -0500, Khaled Noaman wrote:
> >
> > Hi,
> >
> > The W3C Schema WG has released a last call working draft of XML Schema
> > 1.1 Part 1: Structures. We are considering implementing features from
> > this draft in Xerces-J. We would like to understand which features
> > users are most interested in and what scenarios they plan on using
> > them in.
> >
> > Here's a summary of the major features introduced in the spec:
> >
> > All Group
> > XML Schema 1.0 imposed many restrictions on <all> groups. XML Schema
> > 1.1 has relaxed several of those constraints:
> >       * <all> groups can now be extended by adding more members to
> >         them.
> >       * Wildcards are now allowed.
> >       * Particles in <all> groups can now have the value of maxOccurs
> >         be greater than 1.
> >
> > <xs:complexType name="applianceType">
> >  <xs:all>
> >   <xs:element name="item" type="xs:string"/>
> >   <xs:element name="description" type="xs:string"/>
> >  </xs:all>
> > </xs:complexType>
> >
> > <xs:complexType name="heaterType">
> >  <xs:complexContent>
> >   <xs:extension base="applianceType">
> >    <xs:all>
> >     <xs:element name="power_in_watt" type="xs:integer"/>
> >     <xs:any processContents="lax"/>
> >    </xs:all>
> >   </xs:extension>
> >  </xs:complexContent>
> > </xs:complexType>
> >
> > Assertions
> > A form of co-occurrence constraint, using XPath 2.0 expressions, that
> > is associated with a complex type to constrain element and attribute
> > values. The list of assertions is evaluated when a complex type is
> > used to validate an element.
> >
> > <xs:complexType name="intRange">
> >  <xs:attribute name="min" type="xs:int"/>
> >  <xs:attribute name="max" type="xs:int"/>
> >  <xs:assert test="@min le @max"/>
> > </xs:complexType>
> >
> > The value of the ?min? attribute must be less than the value of the
> > ?max? attribute.
> >
> > <xs:complexType name="arrayType">
> >  <xs:sequence>
> >   <xs:element name="entry" minOccurs="0" maxOccurs="unbounded"/>
> >  </xs:sequence>
> >  <xs:attribute name="length" type="xs:int"/>
> >  <xs:assert test="@length eq fn:count(./entry)"/>
> > </xs:complexType>
> >
> > The value of the ?length? attribute must be equal to the number of
> > occurrences of the ?entry? sub-elements.
> >
> > Open Content Models
> > A new mechanism to allow content models to accept elements other than
> > those explicitly defined. The schema author controls the degree of
> > openness of the content model. They can specify whether elements
> > should be accepted everywhere or at the end of the content model.
> >
> > <xs:complexType name="name">
> >   <xs:openContent mode="suffix">
> >     <xs:any namespace="##other" processContents="skip"/>
> >   </xs:openContent>
> >   <xs:sequence>
> >     <xs:element name="given" type="xs:string"/>
> >     <xs:element name="middle" type="xs:string" minOccurs="0"/>
> >     <xs:element name="family" type="xs:string"/>
> >   </xs:sequence>
> > </xs:complexType>
> >
> > A schema author can also define a default open content at the schema
> > document level, thus saving many copy/paste if the open content is the
> > same across the complex types.
> >
> > <xs:schema
> >     xmlns:xs="http://www.w3.org/2001/XMLSchema"
> >     targetNamespace="http://www.example.com/example">
> >   . . .
> >   <xs:defaultOpenContent mode="interleave">
> >     <xs:any processContents="lax"/>
> >   </xs:defaultOpenContent>
> >   . . .
> > </xs:schema>
> >
> > Enhanced Wildcards
> > In XML Schema 1.0, a schema author was only allowed to exclude
> > elements and attributes from one namespace, the target namespace,  by
> > using ##other. In XML Schema 1.1, a schema author can define wildcards
> > that exclude:
> >       * Elements and attributes from a set of namespaces by using
> >         [notNamespace]
> >       * A particular set of qualified elements and attributes by using
> >         [notQName]
> >       * ?not-in-schema? elements and attributes (those that do not
> >         match any declaration in the schema)  by including the
> >         ##defined keyword in [notQName]
> >
> > <xs:any namespace="http://www.w3.org/1999/XSL/Transform"
> >         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> >         notQName="xsl:comment xsl:fallback"/>
> >
> > <xs:anyAttribute xmlns:ns1="http://ns1"
> >   notNamespace="ns1 ##targetNamespace"/>
> >
> > Complex Type Restriction
> > The rules for checking validity of complex-type restrictions have been
> > simplified. The set of elements or attributes accepted by a
> > restriction must be a subset of those accepted by its base type.
> >
> > Conditional Type Assignment
> > A form of co-occurrence constraint, using XPath 2.0, that allows for a
> > type to be assigned to an element instance based on its properties
> > (typically attribute values).
> >
> > <xs:complexType name="valueType">
> >  <xs:simpleContent>
> >   <xs:extenstion base="xs:long">
> >    <xs:attribute name="kind" type="xs:string"/>
> >   </xs:extension>
> >  </xs:simpleContent>
> > </xs:complexType>
> >
> > <xs:element name="value" type="valueType">
> >  <xs:alternative test="@kind='int'" type="xs:int"/>
> >  <xs:alternative test="@kind='short'" type="xs:short"/>
> >  <xs:alternative test="@kind='byte'" type="xs:byte"/>
> > </xs:element>
> >
> > Default Attributes
> > A new mechanism that makes it easier for schema authors to include
> > common attributes like xml:base and xml:lang in all their content
> > models.
> >
> > <xs:schema
> >     xmlns:xs="http://www.w3.org/2001/XMLSchema"
> >     targetNamespace="http://www.example.com/example"
> >     defaultAttributes="defaultAttrGroup">
> >   . . .
> > </xs:schema>
> >
> > Conditional Inclusion
> > A mechanism that allows conforming XML Schema 1.1 processors to
> > successfully ignore new constructs introduced in future version of the
> > spec. It also allows schema authors to define schemas with newer
> > constructs and be able to fall back to older versions when the newer
> > constructs are not available.
> >
> > <xsd:schema
> >   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> >   xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning">
> >
> >   <xsd:element name="e" vc:minVersion="3.2">
> >     <!--* declaration suitable for 3.2  
>         * and later
> processors *-->
> >   </xsd:element>
> >   <xsd:element name="e"
> >     vc:minVersion="1.1"
> >     vc:maxVersion="3.1">
> >     <!--* declaration suitable for processors 
>         *
> supporting versions 1.1 through 3.1 
>         *-->
> >   </xsd:element>
> >   ...
> > </xsd:schema>
> >
> >
> > We would appreciate your feedback.
> >
> > Regards,
> > Khaled
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Re: [Request] Xerces-J: XML Schema 1.1 feature feedback

Posted by Prashant Reddy <pr...@pramati.com>.
Hello:

1. Conditional Inclusion
2. Assertions

These features are what we are most interested in.

Scenarios :

1. Conditional Inclusion : The example XML snippet which employs the
"condition inclusion" along with XMLSchema-versioning is a very
compelling use case for us. 

2. Assertions : Similar validation code currently exists in factory
methods that create the data objects from an XML instance document.
Putting these in Schema with help of Assertion is makes it more
portable.

Appreciate the effort of collecting feedback while the specification is
evolving. Thank you.

-Prashant


On Fri, 2007-11-09 at 17:01 -0500, Khaled Noaman wrote:
> 
> Hi, 
> 
> The W3C Schema WG has released a last call working draft of XML Schema
> 1.1 Part 1: Structures. We are considering implementing features from
> this draft in Xerces-J. We would like to understand which features
> users are most interested in and what scenarios they plan on using
> them in. 
> 
> Here's a summary of the major features introduced in the spec: 
> 
> All Group  
> XML Schema 1.0 imposed many restrictions on <all> groups. XML Schema
> 1.1 has relaxed several of those constraints: 
>       * <all> groups can now be extended by adding more members to
>         them. 
>       * Wildcards are now allowed. 
>       * Particles in <all> groups can now have the value of maxOccurs
>         be greater than 1.
> 
> <xs:complexType name="applianceType"> 
>  <xs:all> 
>   <xs:element name="item" type="xs:string"/> 
>   <xs:element name="description" type="xs:string"/> 
>  </xs:all> 
> </xs:complexType> 
> 
> <xs:complexType name="heaterType"> 
>  <xs:complexContent> 
>   <xs:extension base="applianceType"> 
>    <xs:all> 
>     <xs:element name="power_in_watt" type="xs:integer"/> 
>     <xs:any processContents="lax"/> 
>    </xs:all> 
>   </xs:extension> 
>  </xs:complexContent> 
> </xs:complexType> 
> 
> Assertions 
> A form of co-occurrence constraint, using XPath 2.0 expressions, that
> is associated with a complex type to constrain element and attribute
> values. The list of assertions is evaluated when a complex type is
> used to validate an element.  
> 
> <xs:complexType name="intRange"> 
>  <xs:attribute name="min" type="xs:int"/> 
>  <xs:attribute name="max" type="xs:int"/> 
>  <xs:assert test="@min le @max"/> 
> </xs:complexType> 
> 
> The value of the ‘min’ attribute must be less than the value of the
> ‘max’ attribute. 
> 
> <xs:complexType name="arrayType"> 
>  <xs:sequence> 
>   <xs:element name="entry" minOccurs="0" maxOccurs="unbounded"/> 
>  </xs:sequence> 
>  <xs:attribute name="length" type="xs:int"/> 
>  <xs:assert test="@length eq fn:count(./entry)"/> 
> </xs:complexType> 
> 
> The value of the ‘length’ attribute must be equal to the number of
> occurrences of the ‘entry’ sub-elements. 
> 
> Open Content Models 
> A new mechanism to allow content models to accept elements other than
> those explicitly defined. The schema author controls the degree of
> openness of the content model. They can specify whether elements
> should be accepted everywhere or at the end of the content model. 
> 
> <xs:complexType name="name"> 
>   <xs:openContent mode="suffix"> 
>     <xs:any namespace="##other" processContents="skip"/> 
>   </xs:openContent> 
>   <xs:sequence> 
>     <xs:element name="given" type="xs:string"/> 
>     <xs:element name="middle" type="xs:string" minOccurs="0"/> 
>     <xs:element name="family" type="xs:string"/> 
>   </xs:sequence> 
> </xs:complexType> 
> 
> A schema author can also define a default open content at the schema
> document level, thus saving many copy/paste if the open content is the
> same across the complex types. 
> 
> <xs:schema 
>     xmlns:xs="http://www.w3.org/2001/XMLSchema" 
>     targetNamespace="http://www.example.com/example"> 
>   . . . 
>   <xs:defaultOpenContent mode="interleave"> 
>     <xs:any processContents="lax"/> 
>   </xs:defaultOpenContent> 
>   . . . 
> </xs:schema> 
> 
> Enhanced Wildcards 
> In XML Schema 1.0, a schema author was only allowed to exclude
> elements and attributes from one namespace, the target namespace,  by
> using ##other. In XML Schema 1.1, a schema author can define wildcards
> that exclude: 
>       * Elements and attributes from a set of namespaces by using
>         [notNamespace] 
>       * A particular set of qualified elements and attributes by using
>         [notQName] 
>       * “not-in-schema” elements and attributes (those that do not
>         match any declaration in the schema)  by including the
>         ##defined keyword in [notQName]
> 
> <xs:any namespace="http://www.w3.org/1999/XSL/Transform" 
>         xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
>         notQName="xsl:comment xsl:fallback"/> 
> 
> <xs:anyAttribute xmlns:ns1="http://ns1" 
>   notNamespace="ns1 ##targetNamespace"/> 
> 
> Complex Type Restriction 
> The rules for checking validity of complex-type restrictions have been
> simplified. The set of elements or attributes accepted by a
> restriction must be a subset of those accepted by its base type. 
> 
> Conditional Type Assignment 
> A form of co-occurrence constraint, using XPath 2.0, that allows for a
> type to be assigned to an element instance based on its properties
> (typically attribute values). 
> 
> <xs:complexType name="valueType"> 
>  <xs:simpleContent> 
>   <xs:extenstion base="xs:long"> 
>    <xs:attribute name="kind" type="xs:string"/> 
>   </xs:extension> 
>  </xs:simpleContent> 
> </xs:complexType> 
> 
> <xs:element name="value" type="valueType"> 
>  <xs:alternative test="@kind='int'" type="xs:int"/> 
>  <xs:alternative test="@kind='short'" type="xs:short"/> 
>  <xs:alternative test="@kind='byte'" type="xs:byte"/> 
> </xs:element> 
> 
> Default Attributes 
> A new mechanism that makes it easier for schema authors to include
> common attributes like xml:base and xml:lang in all their content
> models. 
> 
> <xs:schema 
>     xmlns:xs="http://www.w3.org/2001/XMLSchema" 
>     targetNamespace="http://www.example.com/example" 
>     defaultAttributes="defaultAttrGroup"> 
>   . . . 
> </xs:schema> 
> 
> Conditional Inclusion 
> A mechanism that allows conforming XML Schema 1.1 processors to
> successfully ignore new constructs introduced in future version of the
> spec. It also allows schema authors to define schemas with newer
> constructs and be able to fall back to older versions when the newer
> constructs are not available. 
> 
> <xsd:schema  
>   xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
>   xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"> 
> 
>   <xsd:element name="e" vc:minVersion="3.2"> 
>     <!--* declaration suitable for 3.2  
>         * and later processors *--> 
>   </xsd:element> 
>   <xsd:element name="e" 
>     vc:minVersion="1.1" 
>     vc:maxVersion="3.1"> 
>     <!--* declaration suitable for processors 
>         * supporting versions 1.1 through 3.1 
>         *--> 
>   </xsd:element> 
>   ... 
> </xsd:schema> 
> 
> 
> We would appreciate your feedback. 
>   
> Regards, 
> Khaled



---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Re: [Request] Xerces-J: XML Schema 1.1 feature feedback

Posted by Florian Wendland <fl...@freenet.de>.
Hi all,

i would propose these features:

Conditional Inclusion
Assertions
Enhanced Wildcards
All Group
Conditional Type Assignment

These are very interesting improvements for xsd imho
thx
--mfw

Khaled Noaman schrieb:
> 
> Hi,
> 
> The W3C Schema WG has released a last call working draft of XML Schema 
> 1.1 Part 1: Structures. We are considering implementing features from 
> this draft in Xerces-J. We would like to understand which features users 
> are most interested in and what scenarios they plan on using them in.
> 
> Here's a summary of the major features introduced in the spec:
> 
> _All Group _
> XML Schema 1.0 imposed many restrictions on <all> groups. XML Schema 1.1 
> has relaxed several of those constraints:
> 
>     * <all> groups can now be extended by adding more members to them.
>     * Wildcards are now allowed.
>     * Particles in <all> groups can now have the value of maxOccurs be
>       greater than 1.
> 
> 
> <xs:complexType name="applianceType">
>  <xs:all>
>   <xs:element name="item" type="xs:string"/>
>   <xs:element name="description" type="xs:string"/>
>  </xs:all>
> </xs:complexType>
> 
> <xs:complexType name="heaterType">
>  <xs:complexContent>
>   <xs:extension base="applianceType">
>    <xs:all>
>     <xs:element name="power_in_watt" type="xs:integer"/>
>     <xs:any processContents="lax"/>
>    </xs:all>
>   </xs:extension>
>  </xs:complexContent>
> </xs:complexType>
> 
> _Conditional Inclusion_
> A form of co-occurrence constraint, using XPath 2.0 expressions, that is 
> associated with a complex type to constrain element and attribute 
> values. The list of assertions is evaluated when a complex type is used 
> to validate an element.
> 
> <xs:complexType name="intRange">
>  <xs:attribute name="min" type="xs:int"/>
>  <xs:attribute name="max" type="xs:int"/>
>  <xs:assert test="@min le @max"/>
> </xs:complexType>
> 
> The value of the ‘min’ attribute must be less than the value of the 
> ‘max’ attribute.
> 
> <xs:complexType name="arrayType">
>  <xs:sequence>
>   <xs:element name="entry" minOccurs="0" maxOccurs="unbounded"/>
>  </xs:sequence>
>  <xs:attribute name="length" type="xs:int"/>
>  <xs:assert test="@length eq fn:count(./entry)"/>
> </xs:complexType>
> 
> The value of the ‘length’ attribute must be equal to the number of 
> occurrences of the ‘entry’ sub-elements.
> 
> _Open Content Models_
> A new mechanism to allow content models to accept elements other than 
> those explicitly defined. The schema author controls the degree of 
> openness of the content model. They can specify whether elements should 
> be accepted everywhere or at the end of the content model.
> 
> <xs:complexType name="name">
>   <xs:openContent mode="suffix">
>     <xs:any namespace="##other" processContents="skip"/>
>   </xs:openContent>
>   <xs:sequence>
>     <xs:element name="given" type="xs:string"/>
>     <xs:element name="middle" type="xs:string" minOccurs="0"/>
>     <xs:element name="family" type="xs:string"/>
>   </xs:sequence>
> </xs:complexType>
> 
> A schema author can also define a default open content at the schema 
> document level, thus saving many copy/paste if the open content is the 
> same across the complex types.
> 
> <xs:schema
>     xmlns:xs="http://www.w3.org/2001/XMLSchema"
>     targetNamespace="http://www.example.com/example">
>   . . .
>   <xs:defaultOpenContent mode="interleave">
>     <xs:any processContents="lax"/>
>   </xs:defaultOpenContent>
>   . . .
> </xs:schema>
> 
> _Enhanced Wildcards_
> In XML Schema 1.0, a schema author was only allowed to exclude elements 
> and attributes from one namespace, the target namespace,  by using 
> ##other. In XML Schema 1.1, a schema author can define wildcards that 
> exclude:
> 
>     * Elements and attributes from a set of namespaces by using
>       [notNamespace]
>     * A particular set of qualified elements and attributes by using
>       [notQName]
>     * “not-in-schema” elements and attributes (those that do not match
>       any declaration in the schema)  by including the ##defined keyword
>       in [notQName]
> 
> 
> <xs:any namespace="http://www.w3.org/1999/XSL/Transform"
>         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>         notQName="xsl:comment xsl:fallback"/>
> 
> <xs:anyAttribute xmlns:ns1="_http://ns1_"
>   notNamespace="ns1 ##targetNamespace"/>
> 
> _Complex Type Restriction_
> The rules for checking validity of complex-type restrictions have been 
> simplified. The set of elements or attributes accepted by a restriction 
> must be a subset of those accepted by its base type.
> 
> _Conditional Type Assignment_
> A form of co-occurrence constraint, using XPath 2.0, that allows for a 
> type to be assigned to an element instance based on its properties 
> (typically attribute values).
> 
> <xs:complexType name="valueType">
>  <xs:simpleContent>
>   <xs:extenstion base="xs:long">
>    <xs:attribute name="kind" type="xs:string"/>
>   </xs:extension>
>  </xs:simpleContent>
> </xs:complexType>
> 
> <xs:element name="value" type="valueType">
>  <xs:alternative test="@kind='int'" type="xs:int"/>
>  <xs:alternative test="@kind='short'" type="xs:short"/>
>  <xs:alternative test="@kind='byte'" type="xs:byte"/>
> </xs:element>
> 
> _Default Attributes_
> A new mechanism that makes it easier for schema authors to include 
> common attributes like xml:base and xml:lang in all their content models.
> 
> <xs:schema
>     xmlns:xs="http://www.w3.org/2001/XMLSchema"
>     targetNamespace="http://www.example.com/example"
>     defaultAttributes="defaultAttrGroup">
>   . . .
> </xs:schema>
> 
> _Conditional Inclusion_
> A mechanism that allows conforming XML Schema 1.1 processors to 
> successfully ignore new constructs introduced in future version of the 
> spec. It also allows schema authors to define schemas with newer 
> constructs and be able to fall back to older versions when the newer 
> constructs are not available.
> 
> <xsd:schema
>   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>   xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning">
> 
>   <xsd:element name="e" vc:minVersion="3.2">
>     <!--* declaration suitable for 3.2
>         * and later processors *-->
>   </xsd:element>
>   <xsd:element name="e"
>     vc:minVersion="1.1"
>     vc:maxVersion="3.1">
>     <!--* declaration suitable for processors
>         * supporting versions 1.1 through 3.1
>         *-->
>   </xsd:element>
>   ...
> </xsd:schema>
> 
> 
> We would appreciate your feedback.
>  
> Regards,
> Khaled
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Re: [Request] Xerces-J: XML Schema 1.1 feature feedback

Posted by "Eric J. Schwarzenbach" <Er...@wrycan.com>.
My first vote would be for _Complex Type Restriction_. I've spent
countless hours in the past bashing my head against the spec when trying
to do something with restriction that intuitively made sense (and would
be valid according to subset logic) but which ran afoul of the byzantine
rules that govern it in XML Schema 1.0.

My second vote would be Assertions. I'm sorry I don't have any specific
scenarios at the top of my head, as I haven't been writing schemas much
recently, but cases constantly came up when I've written shemas or
worked with other's schemas where some XPath assertions were just the
needed thing (and often ended up getting implemented in other tools for
checks at other stages of content processing).

Eric Schwarzenbach


Khaled Noaman wrote:
>
> Hi,
>
> The W3C Schema WG has released a last call working draft of XML Schema
> 1.1 Part 1: Structures. We are considering implementing features from
> this draft in Xerces-J. We would like to understand which features
> users are most interested in and what scenarios they plan on using
> them in.
>
> Here's a summary of the major features introduced in the spec:
>
> _All Group _
> XML Schema 1.0 imposed many restrictions on <all> groups. XML Schema
> 1.1 has relaxed several of those constraints:
>
>     * <all> groups can now be extended by adding more members to them.
>     * Wildcards are now allowed.
>     * Particles in <all> groups can now have the value of maxOccurs be
>       greater than 1.
>
>
> <xs:complexType name="applianceType">
>  <xs:all>
>   <xs:element name="item" type="xs:string"/>
>   <xs:element name="description" type="xs:string"/>
>  </xs:all>
> </xs:complexType>
>
> <xs:complexType name="heaterType">
>  <xs:complexContent>
>   <xs:extension base="applianceType">
>    <xs:all>
>     <xs:element name="power_in_watt" type="xs:integer"/>
>     <xs:any processContents="lax"/>
>    </xs:all>
>   </xs:extension>
>  </xs:complexContent>
> </xs:complexType>
>
> _Assertions_
> A form of co-occurrence constraint, using XPath 2.0 expressions, that
> is associated with a complex type to constrain element and attribute
> values. The list of assertions is evaluated when a complex type is
> used to validate an element.
>
> <xs:complexType name="intRange">
>  <xs:attribute name="min" type="xs:int"/>
>  <xs:attribute name="max" type="xs:int"/>
>  <xs:assert test="@min le @max"/>
> </xs:complexType>
>
> The value of the ‘min’ attribute must be less than the value of the
> ‘max’ attribute.
>
> <xs:complexType name="arrayType">
>  <xs:sequence>
>   <xs:element name="entry" minOccurs="0" maxOccurs="unbounded"/>
>  </xs:sequence>
>  <xs:attribute name="length" type="xs:int"/>
>  <xs:assert test="@length eq fn:count(./entry)"/>
> </xs:complexType>
>
> The value of the ‘length’ attribute must be equal to the number of
> occurrences of the ‘entry’ sub-elements.
>
> _Open Content Models_
> A new mechanism to allow content models to accept elements other than
> those explicitly defined. The schema author controls the degree of
> openness of the content model. They can specify whether elements
> should be accepted everywhere or at the end of the content model.
>
> <xs:complexType name="name">
>   <xs:openContent mode="suffix">
>     <xs:any namespace="##other" processContents="skip"/>
>   </xs:openContent>
>   <xs:sequence>
>     <xs:element name="given" type="xs:string"/>
>     <xs:element name="middle" type="xs:string" minOccurs="0"/>
>     <xs:element name="family" type="xs:string"/>
>   </xs:sequence>
> </xs:complexType>
>
> A schema author can also define a default open content at the schema
> document level, thus saving many copy/paste if the open content is the
> same across the complex types.
>
> <xs:schema
>     xmlns:xs="http://www.w3.org/2001/XMLSchema"
>     targetNamespace="http://www.example.com/example">
>   . . .
>   <xs:defaultOpenContent mode="interleave">
>     <xs:any processContents="lax"/>
>   </xs:defaultOpenContent>
>   . . .
> </xs:schema>
>
> _Enhanced Wildcards_
> In XML Schema 1.0, a schema author was only allowed to exclude
> elements and attributes from one namespace, the target namespace,  by
> using ##other. In XML Schema 1.1, a schema author can define wildcards
> that exclude:
>
>     * Elements and attributes from a set of namespaces by using
>       [notNamespace]
>     * A particular set of qualified elements and attributes by using
>       [notQName]
>     * “not-in-schema” elements and attributes (those that do not match
>       any declaration in the schema)  by including the ##defined
>       keyword in [notQName]
>
>
> <xs:any namespace="http://www.w3.org/1999/XSL/Transform"
>         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>         notQName="xsl:comment xsl:fallback"/>
>
> <xs:anyAttribute xmlns:ns1="_http://ns1_"
>   notNamespace="ns1 ##targetNamespace"/>
>
> _Complex Type Restriction_
> The rules for checking validity of complex-type restrictions have been
> simplified. The set of elements or attributes accepted by a
> restriction must be a subset of those accepted by its base type.
>
> _Conditional Type Assignment_
> A form of co-occurrence constraint, using XPath 2.0, that allows for a
> type to be assigned to an element instance based on its properties
> (typically attribute values).
>
> <xs:complexType name="valueType">
>  <xs:simpleContent>
>   <xs:extenstion base="xs:long">
>    <xs:attribute name="kind" type="xs:string"/>
>   </xs:extension>
>  </xs:simpleContent>
> </xs:complexType>
>
> <xs:element name="value" type="valueType">
>  <xs:alternative test="@kind='int'" type="xs:int"/>
>  <xs:alternative test="@kind='short'" type="xs:short"/>
>  <xs:alternative test="@kind='byte'" type="xs:byte"/>
> </xs:element>
>
> _Default Attributes_
> A new mechanism that makes it easier for schema authors to include
> common attributes like xml:base and xml:lang in all their content models.
>
> <xs:schema
>     xmlns:xs="http://www.w3.org/2001/XMLSchema"
>     targetNamespace="http://www.example.com/example"
>     defaultAttributes="defaultAttrGroup">
>   . . .
> </xs:schema>
>
> _Conditional Inclusion_
> A mechanism that allows conforming XML Schema 1.1 processors to
> successfully ignore new constructs introduced in future version of the
> spec. It also allows schema authors to define schemas with newer
> constructs and be able to fall back to older versions when the newer
> constructs are not available.
>
> <xsd:schema
>   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>   xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning">
>
>   <xsd:element name="e" vc:minVersion="3.2">
>     <!--* declaration suitable for 3.2
>         * and later processors *-->
>   </xsd:element>
>   <xsd:element name="e"
>     vc:minVersion="1.1"
>     vc:maxVersion="3.1">
>     <!--* declaration suitable for processors
>         * supporting versions 1.1 through 3.1
>         *-->
>   </xsd:element>
>   ...
> </xsd:schema>
>
>
> We would appreciate your feedback.
>  
> Regards,
> Khaled
>

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Re: [Request] Xerces-J: XML Schema 1.1 feature feedback

Posted by Nathan Beyer <nd...@apache.org>.
I don't have any specific scenarios of use at the moment, but the
assertions and conditional inclusions (versioning) features sound the
most appealing to me, for whatever that's worth.

-Nathan

On Nov 9, 2007 4:01 PM, Khaled Noaman <kn...@ca.ibm.com> wrote:
>
> Hi,
>
> The W3C Schema WG has released a last call working draft of XML Schema 1.1
> Part 1: Structures. We are considering implementing features from this draft
> in Xerces-J. We would like to understand which features users are most
> interested in and what scenarios they plan on using them in.
>
> Here's a summary of the major features introduced in the spec:
>
> All Group
> XML Schema 1.0 imposed many restrictions on <all> groups. XML Schema 1.1 has
> relaxed several of those constraints:
>
> <all> groups can now be extended by adding more members to them.
> Wildcards are now allowed.
> Particles in <all> groups can now have the value of maxOccurs be greater
> than 1.
> <xs:complexType name="applianceType">
>  <xs:all>
>   <xs:element name="item" type="xs:string"/>
>   <xs:element name="description" type="xs:string"/>
>  </xs:all>
> </xs:complexType>
>
> <xs:complexType name="heaterType">
>  <xs:complexContent>
>   <xs:extension base="applianceType">
>    <xs:all>
>     <xs:element name="power_in_watt" type="xs:integer"/>
>     <xs:any processContents="lax"/>
>    </xs:all>
>   </xs:extension>
>  </xs:complexContent>
> </xs:complexType>
>
> Assertions
> A form of co-occurrence constraint, using XPath 2.0 expressions, that is
> associated with a complex type to constrain element and attribute values.
> The list of assertions is evaluated when a complex type is used to validate
> an element.
>
> <xs:complexType name="intRange">
>  <xs:attribute name="min" type="xs:int"/>
>  <xs:attribute name="max" type="xs:int"/>
>  <xs:assert test="@min le @max"/>
> </xs:complexType>
>
> The value of the 'min' attribute must be less than the value of the 'max'
> attribute.
>
> <xs:complexType name="arrayType">
>  <xs:sequence>
>   <xs:element name="entry" minOccurs="0" maxOccurs="unbounded"/>
>  </xs:sequence>
>  <xs:attribute name="length" type="xs:int"/>
>  <xs:assert test="@length eq fn:count(./entry)"/>
> </xs:complexType>
>
> The value of the 'length' attribute must be equal to the number of
> occurrences of the 'entry' sub-elements.
>
> Open Content Models
> A new mechanism to allow content models to accept elements other than those
> explicitly defined. The schema author controls the degree of openness of the
> content model. They can specify whether elements should be accepted
> everywhere or at the end of the content model.
>
> <xs:complexType name="name">
>   <xs:openContent mode="suffix">
>     <xs:any namespace="##other" processContents="skip"/>
>   </xs:openContent>
>   <xs:sequence>
>     <xs:element name="given" type="xs:string"/>
>     <xs:element name="middle" type="xs:string" minOccurs="0"/>
>     <xs:element name="family" type="xs:string"/>
>   </xs:sequence>
> </xs:complexType>
>
> A schema author can also define a default open content at the schema
> document level, thus saving many copy/paste if the open content is the same
> across the complex types.
>
> <xs:schema
>     xmlns:xs="http://www.w3.org/2001/XMLSchema"
>     targetNamespace="http://www.example.com/example">
>   . . .
>   <xs:defaultOpenContent mode="interleave">
>     <xs:any processContents="lax"/>
>   </xs:defaultOpenContent>
>   . . .
> </xs:schema>
>
> Enhanced Wildcards
> In XML Schema 1.0, a schema author was only allowed to exclude elements and
> attributes from one namespace, the target namespace,  by using ##other. In
> XML Schema 1.1, a schema author can define wildcards that exclude:
>
> Elements and attributes from a set of namespaces by using [notNamespace]
> A particular set of qualified elements and attributes by using [notQName]
> "not-in-schema" elements and attributes (those that do not match any
> declaration in the schema)  by including the ##defined keyword in [notQName]
> <xs:any namespace="http://www.w3.org/1999/XSL/Transform"
>         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>         notQName="xsl:comment xsl:fallback"/>
>
> <xs:anyAttribute xmlns:ns1="http://ns1"
>   notNamespace="ns1 ##targetNamespace"/>
>
> Complex Type Restriction
> The rules for checking validity of complex-type restrictions have been
> simplified. The set of elements or attributes accepted by a restriction must
> be a subset of those accepted by its base type.
>
> Conditional Type Assignment
> A form of co-occurrence constraint, using XPath 2.0, that allows for a type
> to be assigned to an element instance based on its properties (typically
> attribute values).
>
> <xs:complexType name="valueType">
>  <xs:simpleContent>
>   <xs:extenstion base="xs:long">
>    <xs:attribute name="kind" type="xs:string"/>
>   </xs:extension>
>  </xs:simpleContent>
> </xs:complexType>
>
> <xs:element name="value" type="valueType">
>  <xs:alternative test="@kind='int'" type="xs:int"/>
>  <xs:alternative test="@kind='short'" type="xs:short"/>
>  <xs:alternative test="@kind='byte'" type="xs:byte"/>
> </xs:element>
>
> Default Attributes
> A new mechanism that makes it easier for schema authors to include common
> attributes like xml:base and xml:lang in all their content models.
>
> <xs:schema
>     xmlns:xs="http://www.w3.org/2001/XMLSchema"
>     targetNamespace="http://www.example.com/example"
>     defaultAttributes="defaultAttrGroup">
>   . . .
> </xs:schema>
>
> Conditional Inclusion
> A mechanism that allows conforming XML Schema 1.1 processors to successfully
> ignore new constructs introduced in future version of the spec. It also
> allows schema authors to define schemas with newer constructs and be able to
> fall back to older versions when the newer constructs are not available.
>
> <xsd:schema
>   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>   xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning">
>
>   <xsd:element name="e" vc:minVersion="3.2">
>     <!--* declaration suitable for 3.2
>         * and later processors *-->
>   </xsd:element>
>   <xsd:element name="e"
>     vc:minVersion="1.1"
>     vc:maxVersion="3.1">
>     <!--* declaration suitable for processors
>         * supporting versions 1.1 through 3.1
>         *-->
>   </xsd:element>
>   ...
> </xsd:schema>
>
>
> We would appreciate your feedback.
>
> Regards,
> Khaled
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org