0 Replies Latest reply on Mar 5, 2013 5:12 AM by Feloppo

    Working with XML namespaces

    Feloppo

      Hi!

       

      I'm trying to get XML child's value. How do I do that when using namespaces?

       

      This is my script:

      var rStream = util.readFileIntoStream();
      var xmlData = null;
      var cData = util.stringFromStream(rStream );
      xmlData = eval(cData.replace(/^\<\?.*\?\>\s*/,""));
      
      console.println(xmlData.child("Customer")[0].child("Name").text());
      

       

       

      This is my part of my XML:

      <dta:Customers>
        <dta:Customer>
          <dta:Name>Larry Frank</dta:Name>
          <dta:Company>Big Bank</dta:Company>
          <dta:Email>LarF@BBk.com</dta:Email>
        </dta:Customer>
      ....
      

       

      This is the error it's giving:

      TypeError: invalid XML namespace dta

       

      It works well when not using dta namespace.

       

      Thanks