473,398 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Re: Parsing an XML file with namespace

On Sep 22, 12:49 am, Peter Flynn <peter.n...@m.silmaril.iewrote:
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.
Sep 22 '08 #1
3 3399
Mon, 22 Sep 2008 00:31:52 -0700 (PDT), /Steve/:
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
Sep 22 '08 #2
On Sep 22, 11:03 am, Stanimir Stamenkov <s7a...@netscape.netwrote:
Mon, 22 Sep 2008 00:31:52 -0700 (PDT), /Steve/:
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.
Sep 22 '08 #3
Mon, 22 Sep 2008 02:45:18 -0700 (PDT), /Steve/:
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
Sep 22 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Mike McGavin | last post by:
Hi everyone. I've been trying for several hours now to get minidom to parse namespaces properly from my stream of XML, so that I can use DOM methods such as getElementsByTagNameNS(). For some...
1
by: Greg Wogan-Browne | last post by:
Hi all, I am having some trouble figuring out what is going on here - is this a bug, or correct behaviour? Basically, when I create an XML document with a namespace using xml.dom.minidom.parse()...
4
by: Erik Moore | last post by:
I am both producing and parsing an xml document that needs to be validated against a schema. I wanted some consumers of the document to have the option of not performing a validation, so I left the...
2
by: Jean-Marie Vaneskahian | last post by:
Reading - Parsing Records From An LDAP LDIF File In .Net? I am in need of a .Net class that will allow for the parsing of a LDAP LDIF file. An LDIF file is the standard format for representing...
1
by: christian.eickhoff | last post by:
Hi, I have a general question regarding the parsing of XSD files, referenced within the namespace using Apache Xerces 2.7.0 (CDT). My current c++ application can parse and validate an XML file...
4
by: Neil.Smith | last post by:
I can't seem to find any references to this, but here goes: In there anyway to parse an html/aspx file within an asp.net application to gather a collection of controls in the file. For instance...
2
by: nicky123 | last post by:
Hi everyone, This is a brief description that I have provided for parsing & displaying an XML document using DOM API. Please feel free to post your own comments & views regarding...
3
by: =?Utf-8?B?RGFuYQ==?= | last post by:
I am re-posting this message after registering my posting alias. When I specify an end tag for the clear element of namespaces in my web.config file, the parser error "Unrecognized element 'add'"...
0
by: Gordon Fraser | last post by:
Hi, I'm trying to parse Python code to an AST, apply some changes to the AST and then compile and run the AST, but I'm running into problems when trying to evaluate/execute the resulting code...
0
by: Orestis Markou | last post by:
Have you tried passing in empty dicts for globals and locals? I think that the defaults will be the *current* globals and locals, and then of course your namespace is broken... On Tue, Oct 7,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.