Problem

XML parser error, because the type's content type is empty

Solution

Starting with the Java XML parser Xerces-J 2.6.2, which brings stricter enforcement of XML validation, XML elements with an empty content schema definition are no longer tolerated in the begin/end element syntax, e.g.


      <MyElem myAttr="abc">
      </MyElem>

must be replaced with

      <MyElem myAttr="abc"/>.

With the wrong XML, the parser will throw an exception:


      XML parser error: Line=15, Column=20: cvc-complex-type.2.1: Element 'BulkDataReceiver' must have no character or element information item [children], because the type's content type is empty.

The referenced W3C schema spec is here. See also: http://www.herongyang.com/XML-Schema/complexType-Empty-Element-Declaration.html

-- GianlucaChiozzi - 10 Jul 2006

Related articles

Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.



Related issues