E
eric
Dear c++ experts:
I tried to using Xerxes and its SAX2 to parsing some xml with
namespace. some pieces codes I copied from
book(c++ cookbook), page 497, 498, 499, 500, 501
, especially its main xml file is
-----------
<?xml version="1.0" encoding="UTF-8"?>
<!-- Feldman Family Circus Animals with Namespaces -->
<ffc:animalList xmlns:ffc="http://www.feldman-family-circus.com">
<ffc:animal>
<ffc:name>Herby</ffc:name>
<ffc:species>elephant</ffc:species>
<ffc:dateOfBirth>1992-04-23</ffc:dateOfBirth>
<ffc:veterinarian name="Dr. Hal Brown" phone="(801)595-9627"/>
<ffc:trainer name="Bob Fisk" phone="(801)881-2260"/>
</ffc:animal>
<ffc:animal>
<ffc:name>Sheldon</ffc:name>
<ffc:species>parrot</ffc:species>
<ffc:dateOfBirth>1998-09-30</ffc:dateOfBirth>
<ffc:veterinarian name="Dr. Kevin Wilson"
phone="(801)466-6498"/>
<ffc:trainer name="Eli Wendel" phone="(801)929-2506"/>
</ffc:animal>
<ffc:animal>
<ffc:name>Dippy</ffc:name>
<ffc:species>penguin</ffc:species>
<ffc:dateOfBirth>2001-06-08</ffc:dateOfBirth>
<ffc:veterinarian name="Dr. Barbara Swayne"
phone="(801)495-7746"/>
<ffc:trainer name="Ben Waxman" phone="(801)882-3549"/>
</ffc:animal>
<!-- etc. -->
</ffc:animalList>
------------------------------------------------------------------------
but I got result as (on my g++4.5.2 in linux2.6.38-10 kernel)
---
root@eric-laptop:/home/eric/cppcookbook/ch14# ./a.out
worng namespace uri: http://www.feldman-family-circus.com
----
is that the right result?
I suspect it.
because in the same chapter, previous section, which example using
Tinyxml to parse some more simpler
xml file(without namespace), I got pretty reasonable result, which
Echo the content in xml file orderly.
so
please give your comment and thanks a lot in advance, Eric
I tried to using Xerxes and its SAX2 to parsing some xml with
namespace. some pieces codes I copied from
book(c++ cookbook), page 497, 498, 499, 500, 501
, especially its main xml file is
-----------
<?xml version="1.0" encoding="UTF-8"?>
<!-- Feldman Family Circus Animals with Namespaces -->
<ffc:animalList xmlns:ffc="http://www.feldman-family-circus.com">
<ffc:animal>
<ffc:name>Herby</ffc:name>
<ffc:species>elephant</ffc:species>
<ffc:dateOfBirth>1992-04-23</ffc:dateOfBirth>
<ffc:veterinarian name="Dr. Hal Brown" phone="(801)595-9627"/>
<ffc:trainer name="Bob Fisk" phone="(801)881-2260"/>
</ffc:animal>
<ffc:animal>
<ffc:name>Sheldon</ffc:name>
<ffc:species>parrot</ffc:species>
<ffc:dateOfBirth>1998-09-30</ffc:dateOfBirth>
<ffc:veterinarian name="Dr. Kevin Wilson"
phone="(801)466-6498"/>
<ffc:trainer name="Eli Wendel" phone="(801)929-2506"/>
</ffc:animal>
<ffc:animal>
<ffc:name>Dippy</ffc:name>
<ffc:species>penguin</ffc:species>
<ffc:dateOfBirth>2001-06-08</ffc:dateOfBirth>
<ffc:veterinarian name="Dr. Barbara Swayne"
phone="(801)495-7746"/>
<ffc:trainer name="Ben Waxman" phone="(801)882-3549"/>
</ffc:animal>
<!-- etc. -->
</ffc:animalList>
------------------------------------------------------------------------
but I got result as (on my g++4.5.2 in linux2.6.38-10 kernel)
---
root@eric-laptop:/home/eric/cppcookbook/ch14# ./a.out
worng namespace uri: http://www.feldman-family-circus.com
----
is that the right result?
I suspect it.
because in the same chapter, previous section, which example using
Tinyxml to parse some more simpler
xml file(without namespace), I got pretty reasonable result, which
Echo the content in xml file orderly.
so
please give your comment and thanks a lot in advance, Eric