users@jaxb.java.net

RE: 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 15:43:25 +0000

I debugged more into this issue and noticed, that JAXB is not being used at this point. The normal javax.xml.validation.Validator is being used and the srw-types schema is passed to it. So I revoke my question.

Sorry.


-----Original Message-----
From: Wolfgang Laun [mailto:wolfgang.laun_at_gmail.com]
Sent: Monday, September 10, 2012 5:06 PM
To: users_at_jaxb.java.net
Subject: Re: com.sun.xml.bind.v2.runtime.unmarshaller.ValidatingUnmarshaller does not skip any-content

srw-types-xsd ends at recordData/stringOrXmlFragment with an xs:any child. Is this the only XML schema you pass to the unmarshaller?

-W




On 10/09/2012, Voß, Marko <Marko.Voss_at_fiz-karlsruhe.de> wrote:
> 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.
>
>
>


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

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.