PHP Authors: Liz McMillan, Carmen Gonzalez, Hovhannes Avoyan, Lori MacVittie, Trevor Parsons

RSS Feed Item

RE: XML Schema: Extension and Restriction from a Mixed Complex

Hi George,

Thanks for the explanation.

It's interesting to note that of the whole collection of parsers I'm using (Saxon-SA, libXML, MS XML 6.0, .NET, XSV, Xerces) only Xerces throws the error.


-----Original Message-----
From: George Cristian Bina [mailto:[email protected]]
Sent: Fri 25-7-2008 11:30
To: Paul Hermans
Cc: [email protected]
Subject: Re:  XML Schema: Extension and Restriction from a Mixed Complex Type Base Type
Hi Paul,

Xerces follows the rules specified in the XML Schema 1.0 specification 
and in your case there is clearly no complete mapping from

<xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>


<xs:element name="a" type="xs:date"/>
<xs:element name="b" type="xs:date" minOccurs="0"/>

See point 2 from
2 There is a complete ·order-preserving· functional mapping from the 
particles in the {particles} of R to the particles in the {particles} of 
B such that all of the following must be true:
2.1 Each particle in the {particles} of R is a ·valid restriction· of 
the particle in the {particles} of B it maps to as defined by Particle 
Valid (Restriction) (§3.9.6).
2.2 All particles in the {particles} of B which are not mapped to by any 
particle in the {particles} of R are ·emptiable· as defined by Particle 
Emptiable (§3.9.6).

If you change the extended type as below then the restriction should work:

<xs:complexType name="SimpleLiteralExtended">
         <xs:complexContent mixed="true">
             <xs:extension base="SimpleLiteral">
                     <xs:any processContents="lax"/>
                     <xs:any processContents="lax" minOccurs="0" 

Best Regards,
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger

Paul Hermans wrote:
> I need to start and derive from following datatype.
> <xs:complexType name="SimpleLiteral">
>     <xs:annotation>
>       <xs:documentation xml:lang="en"> This is the default type. It
>         permits text content only with optional xml:lang attribute. 
>         Text is allowed because
>         mixed="true", but sub-elements are disallowed because minOccurs="0" and maxOccurs="0" are on
>         the xs:any tag. 
>         This complexType allows for restriction or extension permitting child
>         elements. </xs:documentation>
>     </xs:annotation>
>     <xs:complexContent mixed="true">
>       <xs:restriction base="xs:anyType">
>         <xs:sequence>
>           <xs:any processContents="lax" minOccurs="0" maxOccurs="0"/>
>         </xs:sequence>
>         <xs:attribute ref="xml:lang" use="optional"/>
>       </xs:restriction>
>     </xs:complexContent>
>   </xs:complexType>
>   This is fine for instance elements such as:
>   <a xml:lang="en">abcdefg</a>
>   But in one case I need to have following model:
>   <a>
>     <b>2008-12-12</b>
>     <c>2008-12-14</c> <!-- optional -->
>   </a>
>   In a normal world modeled as:
>   <xs:complexType name="Temporal">
>     <xs:sequence>
>       <xs:element name="a" type="xs:date"/>
>       <xs:element name="b" type="xs:date" minOccurs="0"/>
>     </xs:sequence>
>   </xs:complexType>
>   Now my derivation approach:
>   1) First extending by allowing elements
>   <xs:complexType name="SimpleLiteralExtended">
>     <xs:complexContent mixed="true">
>       <xs:extension base="SimpleLiteral">
>         <xs:sequence>
>           <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
>         </xs:sequence>
>       </xs:extension>
>     </xs:complexContent>
>   </xs:complexType>
>   So far, so good.
>   2) Restricting, getting rid of mixed, of the xml:lang attribute, and being more specific for the elements.
>   <xs:complexType name="SimpleLiteralExtendedRestricted">
>     <xs:complexContent>
>       <xs:restriction base="SimpleLiteralExtended">
>         <xs:sequence>
>           <xs:element name="a" type="xs:date"/>
>           <xs:element name="b" type="xs:date" minOccurs="0"/>
>         </xs:sequence>
>         <xs:attribute ref="xml:lang" use="prohibited"/>
>       </xs:restriction>
>     </xs:complexContent>
>   </xs:complexType>
>   In Xerces-Java this leads to following error:
>   "E [Xerces] derivation-ok-restriction.5.4.2: Error for type 'SimpleLiteralExtendedRestricted'.  
>   The particle of the type is not a valid restriction of the particle of the base."
>   If I comment out the second line, the error disappears.
>   <xs:sequence>
>           <xs:element name="a" type="xs:date"/>
>           <!-- <xs:element name="b" type="xs:date" minOccurs="0"/> -->
>   </xs:sequence>
>   Can someone explain this behavior or is it a Xerces issue?
>   The same works without problems in Saxon-SA.
>   Paul
> _______________________________________________________________________
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: [email protected]
> subscribe: [email protected]
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php

Read the original blog entry...

IoT & Smart Cities Stories
René Bostic is the Technical VP of the IBM Cloud Unit in North America. Enjoying her career with IBM during the modern millennial technological era, she is an expert in cloud computing, DevOps and emerging cloud technologies such as Blockchain. Her strengths and core competencies include a proven record of accomplishments in consensus building at all levels to assess, plan, and implement enterprise and cloud computing solutions. René is a member of the Society of Women Engineers (SWE) and a m...
DXWordEXPO New York 2018, colocated with CloudEXPO New York 2018 will be held November 11-13, 2018, in New York City and will bring together Cloud Computing, FinTech and Blockchain, Digital Transformation, Big Data, Internet of Things, DevOps, AI, Machine Learning and WebRTC to one location.
In an era of historic innovation fueled by unprecedented access to data and technology, the low cost and risk of entering new markets has leveled the playing field for business. Today, any ambitious innovator can easily introduce a new application or product that can reinvent business models and transform the client experience. In their Day 2 Keynote at 19th Cloud Expo, Mercer Rowe, IBM Vice President of Strategic Alliances, and Raejeanne Skillern, Intel Vice President of Data Center Group and G...
DXWorldEXPO LLC announced today that All in Mobile, a mobile app development company from Poland, will exhibit at the 22nd International CloudEXPO | DXWorldEXPO. All In Mobile is a mobile app development company from Poland. Since 2014, they maintain passion for developing mobile applications for enterprises and startups worldwide.
DXWorldEXPO | CloudEXPO are the world's most influential, independent events where Cloud Computing was coined and where technology buyers and vendors meet to experience and discuss the big picture of Digital Transformation and all of the strategies, tactics, and tools they need to realize their goals. Sponsors of DXWorldEXPO | CloudEXPO benefit from unmatched branding, profile building and lead generation opportunities.
Founded in 2000, Chetu Inc. is a global provider of customized software development solutions and IT staff augmentation services for software technology providers. By providing clients with unparalleled niche technology expertise and industry experience, Chetu has become the premiere long-term, back-end software development partner for start-ups, SMBs, and Fortune 500 companies. Chetu is headquartered in Plantation, Florida, with thirteen offices throughout the U.S. and abroad.
The standardization of container runtimes and images has sparked the creation of an almost overwhelming number of new open source projects that build on and otherwise work with these specifications. Of course, there's Kubernetes, which orchestrates and manages collections of containers. It was one of the first and best-known examples of projects that make containers truly useful for production use. However, more recently, the container ecosystem has truly exploded. A service mesh like Istio addr...
CloudEXPO New York 2018, colocated with DXWorldEXPO New York 2018 will be held November 11-13, 2018, in New York City and will bring together Cloud Computing, FinTech and Blockchain, Digital Transformation, Big Data, Internet of Things, DevOps, AI, Machine Learning and WebRTC to one location.
@DevOpsSummit at Cloud Expo, taking place November 12-13 in New York City, NY, is co-located with 22nd international CloudEXPO | first international DXWorldEXPO and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The widespread success of cloud computing is driving the DevOps revolution in enterprise IT. Now as never before, development teams must communicate and collaborate in a dynamic, 24/7/365 environment. There is no time t...
SYS-CON Events announced today that DatacenterDynamics has been named “Media Sponsor” of SYS-CON's 18th International Cloud Expo, which will take place on June 7–9, 2016, at the Javits Center in New York City, NY. DatacenterDynamics is a brand of DCD Group, a global B2B media and publishing company that develops products to help senior professionals in the world's most ICT dependent organizations make risk-based infrastructure and capacity decisions.