Thursday 15 May 2014

org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'ReceiptTime' -


I am trying to validate an XML file here, my XSD is:

  & Lt ;? XML version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Xs: schema xmlns: xs = "http://www.w3.org/2001/XMLSchema" & gt; & Lt; Xs: element name = "EXTRACT" & gt; & Lt; XS: complexType & gt; & Lt; XS: Sequence & gt; & Lt; Xs: element ref = "HEAD" /> & Lt; / XS: sequence & gt; & Lt; / XS: complexType & gt; & Lt; / XS: element & gt; & Lt; Xs: element name = "head" & gt; & Lt; XS: complexType & gt; & Lt; XS: Sequence & gt; & Lt; Xs: element name = "request id" type = "xs: integer" /> & Lt; Xs: element name = "request" inbox "type =" x: string "/>           

This is my XML file

   1 & lt; / RequestId> & lt; RequestsInBatch & gt; 1,2 & lt; / RequestsInBatch & gt; & lt; PeriodDate & gt; 2013 -03-31 & lt; / PeriodDate & gt; & lt; type & gt; monthly & lt; / type & gt; & gt; StartDate & gt; 2013-03-01 & lt; / StartDate & gt; & LT ; EndDate> 2013-03-31 & lt; / EndDate & gt; & Lt; PricingDate & gt; 2013-03-29 & lt; / PricingDate & gt; & Lt; ReceiptTime & gt; 2013-04-02 12: 30: 00 & lt; / Receipt time & gt; & Lt; CreateTime & gt; 2013-04-02 16: 00: 00 & lt; / CreateTime & gt; & Lt; RecordCount & gt; 3 & lt; / RecordCount & gt; & Lt; ExceptionCount & gt; 1 & lt; / ExceptionCount & gt; & Lt; ExtractType & gt; Flo & lt; / ExtractType & gt; & Lt; ExtractCurrency & gt; Dollar & lt; / ExtractCurrency & gt; & Lt; / HEAD> & Lt; / EXTRACT & gt;   

I do not care about other tags, which I thought was

      

But when I run in Java, I get the following error org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: Wild Wildcard is strict , But no announcement can be made for the 'Receipt Time' element.

How can I validate this file so that I will not declare any element in my XSD because I do not need them , But they XML document anyway? I can not control the content of the XML document, so I need to focus on the data that I want to remove.

processContents = "lax" Try setting default Strict which may mean that it can be any element, unless it is defined somewhere in your schema.

  & lt; X: any process resource = "loose" minOccurs = "0" />   

Checkout.

No comments:

Post a Comment