xerces-c-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rackl, Robert G" <robert.g.ra...@boeing.com>
Subject RE: Using Schema in DOMCount
Date Mon, 27 Jul 2009 17:53:16 GMT
Thank you, Alberto.
Modified the command like so:

./DOMCount.g++ -v=always -n -s -f ~/practice/SamplePanelDat.xml

Modified the first few lines of the input file as follows:

<?xml version="1.0" encoding="UTF-8"?>
<PanelData xmlns="http://www.w3schools.com"
	<Identification ID="12345" Case="Sample for demonstrating XML
format, successful aero data extraction, fictitious data"/>
Schema file not changed.

I am still getting the same errors. Do you see anything else wrong?


-----Original Message-----
From: Alberto Massari [mailto:amassari@datadirect.com] 
Sent: Monday, July 27, 2009 09:56
To: c-users@xerces.apache.org
Subject: Re: Using Schema in DOMCount

Two things are wrong here:
1) you need the -n option to enable namespaces
2) the schema is for the namespace http://www.w3schools.com, the XML
document uses that namespace, but you bind them by using the
xsi:noNamespaceSchemaLocation (that should be used for documents that
don't use namespaces). You should use an attribute


Rackl, Robert G wrote:
> After having used xml on Windows, I am now trying to use xml in Linux 
> using xerces. I am new to xerces and fairly new to C++. Successfully 
> compiled the DOMCount sample program. But I am unsuccessful in trying 
> to have DOMCount validate the input xml file using the command
> ./DOMCount -v=always -s -f ~/practice/SamplePanelDat.xml
> (tried various combinations of -n, -s, -f options - to no avail)
> Many errors are reported as if the schema file did not exist (but it 
> does). The first few lines of the input file are thus:
> <?xml version="1.0" encoding="UTF-8"?> <PanelData 
> xmlns="http://www.w3schools.com"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xsi:noNamespaceSchemaLocation="~/practice/ADINB_PanelData.xsd">
> 	<Identification ID="12345" Case="Sample for demonstrating XML
> successful aero data extraction, fictitious data"/>
> The first few lines of the schema file ADINB_PanelData.xsd are thus:
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- edited with XMLSpy v2008 rel. 2 sp1 (http://www.altova.com) by 
> xmlns="http://www.w3schools.com"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://www.w3schools.com"
> elementFormDefault="qualified" attributeFormDefault="unqualified">
> 	<xs:element name="PanelData">
> 		<xs:complexType>
> 			<xs:sequence>
> 				<xs:element ref="Identification"/>
> What's wrong, please?
>   -_r4_\.
> ___`o-#^o`__

View raw message