Connecting Tech Pros Worldwide Help | Site Map

Re: Parsing an XML file with namespace

  #1  
Old September 22nd, 2008, 08:35 AM
Steve
Guest
 
Posts: n/a
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.
  #2  
Old September 22nd, 2008, 10:05 AM
Stanimir Stamenkov
Guest
 
Posts: n/a

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
  #3  
Old September 22nd, 2008, 10:55 AM
Steve
Guest
 
Posts: n/a

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.
  #4  
Old September 22nd, 2008, 12:05 PM
Stanimir Stamenkov
Guest
 
Posts: n/a

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Parsing an XML file with namespace Martin Honnen answers 3 September 23rd, 2008 06:55 PM
Parsing an html/aspx file Neil.Smith@cityofbristol.ac.uk answers 4 November 29th, 2006 09:35 AM
Loading an XML file into a DB Steven Blair answers 1 November 16th, 2005 05:21 PM
Populating a combobox from an XML file Billy Smith answers 2 July 23rd, 2005 10:32 PM