Re: Parsing an XML file with namespace

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve

    Re: Parsing an XML file with namespace

    On Sep 22, 12:49 am, Peter Flynn <peter.n...@m.s ilmaril.iewrote :
    Actually it doesn't. It starts like this:
    >
    <?xml version="1.0" encoding="UTF-8"?>
    <gesmes:Envelop e xmlns:gesmes="h ttp://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

    #2
    Re: Parsing an XML file with namespace

    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:



    --
    Stanimir

    Comment

    • Steve

      #3
      Re: Parsing an XML file with namespace

      On Sep 22, 11:03 am, Stanimir Stamenkov <s7a...@netscap e.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:
      >

      >
      --
      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:Envelop e xmlns:gesmes="h ttp://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.

      Comment

      • Stanimir Stamenkov

        #4
        Re: Parsing an XML file with namespace

        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:Envelop e xmlns:gesmes="h ttp://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

        Comment

        Working...