users@jaxb.java.net

com.sun.xml.bind.v2.runtime.unmarshaller.ValidatingUnmarshaller does not skip any-content

From: Voß, Marko <Marko.Voss_at_fiz-Karlsruhe.de>
Date: Mon, 10 Sep 2012 14:07:07 +0000

Hello,

We have the following XML structure. First, we are using the SRW/U schema for the search response from Apache Lucene.

http://www.loc.gov/standards/sru/sru1-1archive/xml-files/srw-types.xsd

The recordData element contains the custom XML data. The stringOrXmlFragment complex type used processContents=lax.

Our custom XML data is an additional search result element, which contains additional data about the search result. It is also using an any element where we can store the final resource to. This any element uses processContent=skip.

So finally we have the resource, which got indexed and returned by the search response. It is also using some space for user XML data. This any-element uses processContent=skip.

Example:

<srw:recordData>
  <search:search-result> <-- lax
    <my:resource> <-- skip
      <any:content-in-resource/> <-- skip
    </>
  </>
</>


Ok. A customer put some XML into this resource, which uses xsi:type. We get the following exception:

XML invalid. Cvc-elt.4.2: Cannot resolve 'foo:bar' to a type definition for element 'some:thing'.

Why does the ValidatingUnmarshaller validate this xsi:type in a content, which should be skipped?


We are using CXF 2.6.2 with JAXB for un-/marshalling.



Best regards,
Marko


-------------------------------------------------------

Fachinformationszentrum Karlsruhe, Gesellschaft für wissenschaftlich-technische Information mbH.
Sitz der Gesellschaft: Eggenstein-Leopoldshafen, Amtsgericht Mannheim HRB 101892.
Geschäftsführerin: Sabine Brünger-Weilandt.
Vorsitzender des Aufsichtsrats: MinDirig Dr. Thomas Greiner.