Connecting Tech Pros Worldwide Help | Site Map

Re: Parsing an XML file with namespace

Steve
Guest
 
Posts: n/a
#1: Sep 22 '08
On Sep 22, 12:49 am, Peter Flynn <peter.n...@m.silmaril.iewrote:
Quote:
Actually it doesn't. It starts like this:
>
<?xml version="1.0" encoding="UTF-8"?>
<gesmes:Envelope xmlns:gesmes="http://www.gesmes.org/xml/2002-08-01"
xmlns="http://www.ecb.int/vocabulary/2002-08-01/eurofxref">
<gesmes:subject>Reference rates</gesmes:subject>
>
The root element shows the namespaces, so that you can instruct your
processor that gesmes equates to "http://www.gesmes.org/xml/2002-08-01"
and that the default namespace (used for all element types that do not
have a prefix) is "http://www.ecb.int/vocabulary/2002-08-01/eurofxref"
>
///Peter
Thank you Peter, could you have a little more patience with me and
explain how I can instruct my processor that gesmes equates to
"http://www.gesmes.org/xml/2002-08-01" and that the default namespace
(used for all element types that do not have a prefix) is "http://
www.ecb.int/vocabulary/2002-08-01/eurofxref"

Regards, Steve.
Stanimir Stamenkov
Guest
 
Posts: n/a
#2: Sep 22 '08

re: Re: Parsing an XML file with namespace


Mon, 22 Sep 2008 00:31:52 -0700 (PDT), /Steve/:
Quote:
Thank you Peter, could you have a little more patience with me and
explain how I can instruct my processor that gesmes equates to
"http://www.gesmes.org/xml/2002-08-01" and that the default namespace
(used for all element types that do not have a prefix) is
"http://www.ecb.int/vocabulary/2002-08-01/eurofxref"
Have you tried to read through "Namespaces in XML"
<http://www.w3.org/TR/xml-names>?

You may find some tutorial like articles, also:

http://www.google.com/search?q=names...n+xml+tutorial

--
Stanimir
Steve
Guest
 
Posts: n/a
#3: Sep 22 '08

re: Re: Parsing an XML file with namespace


On Sep 22, 11:03 am, Stanimir Stamenkov <s7a...@netscape.netwrote:
Quote:
Mon, 22 Sep 2008 00:31:52 -0700 (PDT), /Steve/:
>
Quote:
Thank you Peter, could you have a little more patience with me and
explain how I can instruct my processor that gesmes equates to
"http://www.gesmes.org/xml/2002-08-01" and that the default namespace
(used for all element types that do not have a prefix) is
"http://www.ecb.int/vocabulary/2002-08-01/eurofxref"
>
Have you tried to read through "Namespaces in XML"
<http://www.w3.org/TR/xml-names>?
>
You may find some tutorial like articles, also:
>
http://www.google.com/search?q=names...n+xml+tutorial
>
--
Stanimir
Hi Stanimir,

I have read through these tutorials but this is still not clear to me,
and I think from googling around that there are many people having
this problem with this particular European Central Bank XML document.
It is my understanding that the ECB document has already declared the
default namespace of elements that do not have a prefix, ie the <Cube>
elements, with the line :
<gesmes:Envelope xmlns:gesmes="http://www.gesmes.org/xml/2002-08-01"
xmlns="http://www.ecb.int/vocabulary/2002-08-01/eurofxref">

So how to access the <Cubeelements?

Regards, Steve.
Stanimir Stamenkov
Guest
 
Posts: n/a
#4: Sep 22 '08

re: Re: Parsing an XML file with namespace


Mon, 22 Sep 2008 02:45:18 -0700 (PDT), /Steve/:
Quote:
It is my understanding that the ECB document has already declared the
default namespace of elements that do not have a prefix, ie the <Cube>
elements, with the line :
<gesmes:Envelope xmlns:gesmes="http://www.gesmes.org/xml/2002-08-01"
xmlns="http://www.ecb.int/vocabulary/2002-08-01/eurofxref">
>
So how to access the <Cubeelements?
As Martin Honnen pointed in another replay, you need to be more
specific. How do you process the document, do you load it as DOM
and then traverse it, or something else? I guess you need to supply
an example code you use.

--
Stanimir
Closed Thread