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/02/26 02:03:37 UTC

how to insert data into 'validation disabled' part of XML using xmlbeans..

How do I insert data under 'noValidation' element
given the below schema?
 <xs:element name="noValidation">
  <xs:complexType mixed="true">
   <xs:sequence>
    <xs:any processContents='skip' minOccurs="0"
   maxOccurs="unbounded"/>
   </xs:sequence>
  </xs:complexType>
 </xs:element>

I looked at the XML beans generated java classes and
it doesn't seem straightforward. One hint could be to
use XmlObject interface. If anyone has any sample
code, that would be great.

I may have some String object containing an XML
instance that should go under 'noValidation' element
OR
I may construct a Jdom document and insert under
'noValidation'. Either way, I would appreciate how I
can make use of XmlBeans apis to insert such external
data. Am already making use of xmlbeans apis to
populate the data in other parts of my XML which is
getting validated. Hence, XmlBeans has get/set apis
for those parts of XML. 

Thanks for the tip
Dave
--- Wing Yew Poon <wp...@bea.com> wrote:

> Dave,
> the xs:any can have a namespace attribute, which, if
> not present,
> defaults to "##any", which means that the content
> can be in any
> namespace whatsoever or no namespace.
> I think that solves your problem.
> - Wing Yew
> 
> -----Original Message-----
> From: dave [mailto:ceek63@yahoo.com] 
> Sent: Tuesday, February 12, 2008 1:00 PM
> To: Henry S. Thompson
> Cc: user@xmlbeans.apache.org
> Subject: Re: how to restrict validation to part of
> the W3C schema?
> 
> 
> is there a way to instruct the validator to ignore
> namespace as well for this 'noValidation' element's
> children?
> 
> Thanks
> -D
> 
> --- "Henry S. Thompson" <ht...@inf.ed.ac.uk> wrote:
> 
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> > 
> > dave writes:
> > 
> > >  1. How would I specify in the Schema that
> > > 'noValidation' element should not get validated?
> > Is
> > > using ANY a valid use case in this situation
> > although
> > > it's not used for Schema extension purpose here?
> > CDATA
> > > may not be a good choice because I would NOT be
> > able
> > > to parse anything under 'noValidation'. 
> > 
> > <xs:element name="noValidation">
> >  <xs:complexType mixed="true">
> >   <xs:sequence>
> >    <xs:any processContents='skip' minOccurs="0"
> > maxOccurs="unbounded"/>
> >   </xs:sequence>
> >  </xs:complexType>
> > </xs:element>



      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 


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