xerces-c-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alberto Massari <amass...@datadirect.com>
Subject Re: Using Schema in DOMCount
Date Mon, 27 Jul 2009 16:56:17 GMT
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 
xsi:namespaceSchemaLocation="http://www.w3schools.com 
~/practice/ADINB_PanelData.xsd"

Alberto

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
> format, 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
> WILLIAM ANDERSON (BOEING SHARED SERVICES GROUP) -->
> <xs:schema 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`__
>
>   


Mime
View raw message