(Repost with XML and XSD files, as requested) Hello!
We are writing a chapter for a book on Xerces-J 2.x, and these need to be
fixed before publication (which is -soon-).
Error Message #1:
Using the SAX parser with XML schema validation on this portion of schema:
<xsd:complexType name="businessCustomerType">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element ref="phoneNumber"
minOccurs="1"
maxOccurs="unbounded"/>
with this portion of XML:
<businessCustomer customerID="SAM132E60"
primaryContact="Ellie"
sequenceID="88742">
<name>Ellen Boxer</name>
<phoneNumber xsi:nil="true"/>
causes this error message:
***Error*** org.xml.sax.SAXParseException: cvc-type.3.1.1: [attributes] of
element 'phoneNumber' must be empty, excepting those whose [namespace name]
is identical to http://www.w3.org/2001/XMLSchema-instance and whose [local
name] is one of type, nil, schemaLocation or noNamespaceSchemaLocation.
The schema namespace is http://www.w3.org/2001/XMLSchema-instance and
phoneNumber is nil, so can we get this error message turned off? Otherwise
our readers will be frustrated by a "non-problem". Thanks!!
Error Message #2:
The gentleman who constructed the XML and schemas for our example is
certain
that they are correct, so we're puzzled as to this second error message:
***Error*** org.xml.sax.SAXParseException: cvc-complex-type.3.2.2:
Attribute
'xsi:noNamespaceSchemaLocation' is not allowed to appear in element
'customerList'.
Here is the opening to our XML:
<?xml version="1.0" encoding="UTF-8"?>
<customerList
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="
http://home.pacifier.com/~binstock/XMLSchemaE
xample/theme/address.xsd"
source="Oracle">
Are you certain that that error message -should- appear?
I thank you for your time... Sincerely,
Christopher Galtenberg
address.xsd
Description: Binary data
<?xml version="1.0" encoding="UTF-8"?> <customerList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://home.pacifier.com/~binstock/XMLSchemaExample/theme/address.xsd" source="Oracle"> <businessCustomer customerID="SAM132E57"> <name>Cliff Binstock</name> <phoneNumber>503-555-0000</phoneNumber> <address> <street>123 Gravel Road</street> <city>Nowheresville</city> <state>OR</state> <country>US</country> <zip>97000</zip> <effectiveDate></effectiveDate> </address> </businessCustomer> <businessCustomer customerID="SAM132E58" primaryContact="Joe Sr."> <name>Joe Schmendrick</name> <phoneNumber>212-555-0000</phoneNumber> <phoneNumber>212-555-1111</phoneNumber> <URL>http://www.Joe.Schmendrick.name</URL> <address> <street>88888 Mega Apartment Bldg</street> <street>Apt 5315</street> <city>New York</city> <state>NY</state> <country>US</country> <zip>10000</zip> <effectiveDate>2001-02-14</effectiveDate> </address> </businessCustomer> <businessCustomer customerID="SAM132E60" primaryContact="Ellie" sequenceID="88742"> <name>Ellen Boxer</name> <phoneNumber xsi:nil="true"/> <address zipPlus4="20000-1234"> <POBox>123</POBox> <city>Small Town</city> <state>VA</state> <country>US</country> <zip>20000</zip> <effectiveDate>2001-02-14</effectiveDate> </address> </businessCustomer> <businessCustomer customerID="SAM132E59" primaryContact="Lydia" sequenceID="88743"> <name>Ralph McKenzie</name> <phoneNumber xsi:nil="true"/> <address> <street>123 Main Street</street> <pmb>12345</pmb> <city>Metropolis</city> <state>CO</state> <country>US</country> <zip>80000</zip> <effectiveDate>2001-02-14</effectiveDate> </address> </businessCustomer> <privateCustomer customerID="SAM01234P" sequenceID="88744"> <name>I. M. Happy</name> <phoneNumber>303-555-0000</phoneNumber> <phoneNumber>303-555-1111</phoneNumber> <address> <street>123 Main Street</street> <pmb>12345</pmb> <city>Metropolis</city> <state>CO</state> <country>US</country> <zip>80000</zip> <effectiveDate>2001-02-14</effectiveDate> </address> </privateCustomer> <privateCustomer customerID="SAM01235P" sequenceID="88745"> <name>I. M. Happy</name> <phoneNumber>303-555-0000</phoneNumber> <phoneNumber>303-555-1111</phoneNumber> <address> <street>123 Main Street</street> <pmb>12345</pmb> <city>Metropolis</city> <state>CO</state> <country>US</country> <zip>80000</zip> <effectiveDate>2001-02-14</effectiveDate> </address> </privateCustomer> </customerList>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
