Sorry, my mistake: the correct attribute name is just xsi:schemaLocation.
If you still get errors, try using an absoluta path, without using the ~ shortcut

Alberto

Rackl, Robert G wrote:
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";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:namespaceSchemaLocation="http://www.w3schools.com
~/practice/ADINB_PanelData.xsd">
        <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?

  -_r4_\.
___`o-#^o`__

-----Original Message-----
From: Alberto Massari [mailto:[email protected]] Sent: Monday, July 27, 2009 09:56
To: [email protected]
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
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`__




Reply via email to