You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by dave <ce...@yahoo.com> on 2008/04/07 18:44:24 UTC

overriding the schema at runtime..

Is it possible to override the w3c XSD at runtime?
For e.g., I would like to make 'processContents' =
Skip or Lax instead of Strict in the following schema
during run time:
<xs:complexType name="ExtType">
	<xs:sequence>
	   <xs:any namespace="##any" processContents="strict"
minOccurs="0" maxOccurs="50"/>
	</xs:sequence>
</xs:complexType>


In other words, I am trying to avoid changing the
schema and thus create a new schema version just for
this small change. I primarily introduced 'ExtType'
above for schema extension so that any further changes
(like application specific) to the schema using this
part should not affect the validation. I tried adding
an extra element (both with and without namespace)
using the above type and the schema validation failed.
Finally found out that making processContents = 'skip'
is the solution to introduce any new application
specific elements with no namespace.



-D


      ____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: Re:overriding the schema at runtime..

Posted by dave <ce...@yahoo.com>.
XmlBeans is really future-proof in intelligently
forecasting such common mistakes from the newbies!

Thanks to the XmlBeans developers.

-D
--- Radu Preotiuc-Pietro <ra...@bea.com> wrote:

> In XMLBeans, when validating, there is an option
> XmlOptions.setValidateTreatLaxAsSkip() because this
> is a common mistake.
> Other than that, you need to create a new version
> for your schema.
> 
> XMLBeans will not have a problem with maxOccurs=50
> because it uses a
> non-deterministic state machine.
> 
> Radu
> 
> On Mon, 2008-04-07 at 19:45 +0100, Pete Cordell
> wrote:
> > There's no real way to override
> processContents="strict".  I think you just 
> > have to accept that the schema contains a bug in
> it.  As it happens using 
> > processContents = 'skip' is also the right way to
> go for including elements 
> > with namespaces.
> > 
> > One other thing, I've seen some reports of
> processors having problems with 
> > schemas that specify specific, but high values for
> maxOccurs (e.g. 50 as 
> > opposed to unbounded).  This is because they try
> to build a state machine 
> > with as many states as maxOccurs dictates.  I'm
> not sure at the point where 
> > the problems start arising, so maybe 50 is OK. 
> Just thought I'd mention it 
> > as something to bear in mind!
> > 
> > HTH,
> > 
> > Pete Cordell
> > Codalogic
> > For XML C++ data binding visit
> http://www.codalogic.com/lmx/
> > 
> > ----- Original Message ----- 
> > From: "dave" <ce...@yahoo.com>
> > To: <us...@xmlbeans.apache.org>;
> <xm...@lists.xml.org>
> > Sent: Monday, April 07, 2008 5:44 PM
> > Subject: [xml-dev] overriding the schema at
> runtime..
> > 
> > 
> > >
> > > Is it possible to override the w3c XSD at
> runtime?
> > > For e.g., I would like to make 'processContents'
> =
> > > Skip or Lax instead of Strict in the following
> schema
> > > during run time:
> > > <xs:complexType name="ExtType">
> > > <xs:sequence>
> > >    <xs:any namespace="##any"
> processContents="strict"
> > > minOccurs="0" maxOccurs="50"/>
> > > </xs:sequence>
> > > </xs:complexType>
> > >
> > >
> > > In other words, I am trying to avoid changing
> the
> > > schema and thus create a new schema version just
> for
> > > this small change. I primarily introduced
> 'ExtType'
> > > above for schema extension so that any further
> changes
> > > (like application specific) to the schema using
> this
> > > part should not affect the validation. I tried
> adding
> > > an extra element (both with and without
> namespace)
> > > using the above type and the schema validation
> failed.
> > > Finally found out that making processContents =
> 'skip'
> > > is the solution to introduce any new application
> > > specific elements with no namespace.
> > >
> > >
> > >
> > > -D
> > >
> > >
> > > 
> > >
>
____________________________________________________________________________________
> > > You rock. That's why Blockbuster's offering you
> one month of Blockbuster 
> > > Total Access, No Cost.
> > >
> http://tc.deals.yahoo.com/tc/blockbuster/text5.com
> > >
> > >
>
_______________________________________________________________________
> > >
> > > 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:
> xml-dev-unsubscribe@lists.xml.org
> > > subscribe: xml-dev-subscribe@lists.xml.org
> > > List archive:
> http://lists.xml.org/archives/xml-dev/
> > > List Guidelines:
> http://www.oasis-open.org/maillists/guidelines.php
> > >
> > > 
> > 
> > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@xmlbeans.apache.org
> > For additional commands, e-mail:
> user-help@xmlbeans.apache.org
> > 
> 
> Notice:  This email message, together with any
> attachments, may contain information  of  BEA
> Systems,  Inc.,  its subsidiaries  and  affiliated
> entities,  that may be confidential,  proprietary, 
> copyrighted  and/or legally privileged, and is
> intended solely for the use of the individual or
> entity named in this message. If you are not the
> intended recipient, and have received this message
> in error, please immediately return this by email
> and then delete it.
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail:
> user-help@xmlbeans.apache.org
> 
> 



      ____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: Re:overriding the schema at runtime..

Posted by Radu Preotiuc-Pietro <ra...@bea.com>.
In XMLBeans, when validating, there is an option
XmlOptions.setValidateTreatLaxAsSkip() because this is a common mistake.
Other than that, you need to create a new version for your schema.

XMLBeans will not have a problem with maxOccurs=50 because it uses a
non-deterministic state machine.

Radu

On Mon, 2008-04-07 at 19:45 +0100, Pete Cordell wrote:
> There's no real way to override processContents="strict".  I think you just 
> have to accept that the schema contains a bug in it.  As it happens using 
> processContents = 'skip' is also the right way to go for including elements 
> with namespaces.
> 
> One other thing, I've seen some reports of processors having problems with 
> schemas that specify specific, but high values for maxOccurs (e.g. 50 as 
> opposed to unbounded).  This is because they try to build a state machine 
> with as many states as maxOccurs dictates.  I'm not sure at the point where 
> the problems start arising, so maybe 50 is OK.  Just thought I'd mention it 
> as something to bear in mind!
> 
> HTH,
> 
> Pete Cordell
> Codalogic
> For XML C++ data binding visit http://www.codalogic.com/lmx/
> 
> ----- Original Message ----- 
> From: "dave" <ce...@yahoo.com>
> To: <us...@xmlbeans.apache.org>; <xm...@lists.xml.org>
> Sent: Monday, April 07, 2008 5:44 PM
> Subject: [xml-dev] overriding the schema at runtime..
> 
> 
> >
> > Is it possible to override the w3c XSD at runtime?
> > For e.g., I would like to make 'processContents' =
> > Skip or Lax instead of Strict in the following schema
> > during run time:
> > <xs:complexType name="ExtType">
> > <xs:sequence>
> >    <xs:any namespace="##any" processContents="strict"
> > minOccurs="0" maxOccurs="50"/>
> > </xs:sequence>
> > </xs:complexType>
> >
> >
> > In other words, I am trying to avoid changing the
> > schema and thus create a new schema version just for
> > this small change. I primarily introduced 'ExtType'
> > above for schema extension so that any further changes
> > (like application specific) to the schema using this
> > part should not affect the validation. I tried adding
> > an extra element (both with and without namespace)
> > using the above type and the schema validation failed.
> > Finally found out that making processContents = 'skip'
> > is the solution to introduce any new application
> > specific elements with no namespace.
> >
> >
> >
> > -D
> >
> >
> > 
> > ____________________________________________________________________________________
> > You rock. That's why Blockbuster's offering you one month of Blockbuster 
> > Total Access, No Cost.
> > http://tc.deals.yahoo.com/tc/blockbuster/text5.com
> >
> > _______________________________________________________________________
> >
> > 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: xml-dev-unsubscribe@lists.xml.org
> > subscribe: xml-dev-subscribe@lists.xml.org
> > List archive: http://lists.xml.org/archives/xml-dev/
> > List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
> >
> > 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 

Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re:overriding the schema at runtime..

Posted by Pete Cordell <pe...@codalogic.com>.
There's no real way to override processContents="strict".  I think you just 
have to accept that the schema contains a bug in it.  As it happens using 
processContents = 'skip' is also the right way to go for including elements 
with namespaces.

One other thing, I've seen some reports of processors having problems with 
schemas that specify specific, but high values for maxOccurs (e.g. 50 as 
opposed to unbounded).  This is because they try to build a state machine 
with as many states as maxOccurs dictates.  I'm not sure at the point where 
the problems start arising, so maybe 50 is OK.  Just thought I'd mention it 
as something to bear in mind!

HTH,

Pete Cordell
Codalogic
For XML C++ data binding visit http://www.codalogic.com/lmx/

----- Original Message ----- 
From: "dave" <ce...@yahoo.com>
To: <us...@xmlbeans.apache.org>; <xm...@lists.xml.org>
Sent: Monday, April 07, 2008 5:44 PM
Subject: [xml-dev] overriding the schema at runtime..


>
> Is it possible to override the w3c XSD at runtime?
> For e.g., I would like to make 'processContents' =
> Skip or Lax instead of Strict in the following schema
> during run time:
> <xs:complexType name="ExtType">
> <xs:sequence>
>    <xs:any namespace="##any" processContents="strict"
> minOccurs="0" maxOccurs="50"/>
> </xs:sequence>
> </xs:complexType>
>
>
> In other words, I am trying to avoid changing the
> schema and thus create a new schema version just for
> this small change. I primarily introduced 'ExtType'
> above for schema extension so that any further changes
> (like application specific) to the schema using this
> part should not affect the validation. I tried adding
> an extra element (both with and without namespace)
> using the above type and the schema validation failed.
> Finally found out that making processContents = 'skip'
> is the solution to introduce any new application
> specific elements with no namespace.
>
>
>
> -D
>
>
> 
> ____________________________________________________________________________________
> You rock. That's why Blockbuster's offering you one month of Blockbuster 
> Total Access, No Cost.
> http://tc.deals.yahoo.com/tc/blockbuster/text5.com
>
> _______________________________________________________________________
>
> 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: xml-dev-unsubscribe@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org