Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] ValidityException: cvc-elt.1: Cannot find the declaration of 'receive'

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Radu <radu.marian AT us.ing.com>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] ValidityException: cvc-elt.1: Cannot find the declaration of 'receive'
  • Date: Wed, 29 Nov 2006 21:41:27 +0000 (UTC)

Hello,

I am just trying to use the xml schema validation example from
http://dsd.lbl.gov/nux/api/nux/xom/pool/BuilderFactory.html
----------modified source code-----------
// W3C XML Schema validation
Map schemaLocations = new HashMap();
schemaLocations.put(new File("/tmp/p2pio.xsd"),
"http://dsd.lbl.gov/p2pio-1.0";);
Builder builder = new BuilderFactory().createW3CBuilder(schemaLocations);
Document doc = builder.build(new File("/tmp/p2pio.xml"));
System.out.println(doc.toXML());
----------end of modified source code ----------

I am getting the following error:
nu.xom.ValidityException: cvc-elt.1: Cannot find the declaration of element
'receive'. at line 1, column 24 in file:///C:/tmp/p2pio.xml
at nu.xom.Builder$ValidityRequired.error(Builder.java:1260)
at ...
-------------

I also couldn't find a matching p2pio.xsd so I generated one:
----------
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
elementFormDefault="qualified">
<xs:element name="receive">
<xs:complexType>
<xs:sequence>
<xs:element ref="transactionID"/>
<xs:element ref="min"/>
<xs:element ref="max"/>
<xs:element ref="timeout"/>
</xs:sequence>
<xs:attribute name="mode" use="required" type="xs:NCName"/>
</xs:complexType>
</xs:element>
<xs:element name="transactionID" type="xs:string"/>
<xs:element name="min" type="xs:integer"/>
<xs:element name="max" type="xs:integer"/>
<xs:element name="timeout" type="xs:NMTOKEN"/>
</xs:schema>
-------------

TIA,
Radu





Archive powered by MHonArc 2.6.24.

Top of Page