You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Sandy Gao <sa...@ca.ibm.com> on 2003/08/05 23:36:01 UTC

Re: Any problems with validating against schemas using "any" elements?

There are 3 kinds of "any"s (wildcards): strict, lax, and skip. If you
specify "skip", then for sure there won't be validation errors inside the
element that matches this "any". If you specify "lax", then you might get
some error (if there happen to exist an element declaration that matches
one of the elements to be hidden, or if there is an xsi:type on one of
those elements). If you specify "strict" (the default), then 99% you'll get
some error.

So use <any processContents="skip" ...> and you are set.

HTH,
Sandy Gao
Software Developer, IBM Canada
(1-905) 413-3255
sandygao@ca.ibm.com



                                                                                                                                
                      "Karr, David"                                                                                             
                      <David.Karr@wamu.        To:       xerces-j-user@xml.apache.org                                           
                      net>                     cc:                                                                              
                                               Subject:  Any problems with validating against schemas using "any" elements?     
                      07/31/2003 01:01                                                                                          
                      PM                                                                                                        
                      Please respond to                                                                                         
                      xerces-j-user                                                                                             
                                                                                                                                
                                                                                                                                



I would search the archives for information about this, but the archives
appear to be down (I think they've been down for a while).

I'm about to get into a situation where a particular group is producing
XML along with a schema, but some of the elements are defined to have
"any" content in the schema.  The people producing the XML decided that
that meant they needed to "hide" the XML structure of that content,
particularly by "escaping" the content ("<" to "&lt;", for instance).

I've already prototyped code to "fix" this escaped content before
transformation, but I also remembered an article written last year on
XML.com about "Dealing with change" that I believe addresses this.  I've
recovered the article, but I haven't reviewed it yet.

In short, if I'm using recently released versions of Xerces and Xalan,
and my schema specifies "any" content for specific elements, should I
expect any problem (validation, etc.) if the XML content for those
elements is NOT escaped?  If this should work, then I'll build a
prototype to demonstrate it, so I can convince them to not generate
their content this way.


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





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