0

default namespace for E4X

hi, i' ma new user of yql.

i have a request. i have made a get request from an url that give me an xml. so, as written in the guide, the xml file should be managed as a E4X object. but when i try to visite the tag and the attribute the error is this:

Exception: TypeError: undefined is not an xml object.

this happens because i haven't defined a default xml namespace? but this namespace what is?

by
2 Replies
  • QUOTE (hans1991.1991 @ Apr 14 2010, 02:39 AM) <{POST_SNAPBACK}>
    hi, i' ma new user of yql.

    i have a request. i have made a get request from an url that give me an xml. so, as written in the guide, the xml file should be managed as a E4X object. but when i try to visite the tag and the attribute the error is this:

    Exception: TypeError: undefined is not an xml object.

    this happens because i haven't defined a default xml namespace? but this namespace what is?


    looks like the request.get() resulted in no response. Can you y.log(request.get()) and see what you're getting?
    -- Nagesh
    0
  • QUOTE (Nagesh Susarla @ Apr 14 2010, 10:24 AM) <{POST_SNAPBACK}>
    looks like the request.get() resulted in no response. Can you y.log(request.get()) and see what you're getting?
    -- Nagesh


    ok now the problem seems to be resolved. i think it didn't work because i didn't have an initial tag in the url with the attribute xmlns. so now i have made a concatenation like this:

    <name1 xmlns="http://hello"> + xml_that_i_got + </name1>

    and i have put at the beginning of the javascript this sentence:

    default xml namespace ="http://hello";

    with this part i can finally explore my xml structure.

    now the problem is that i have get another xml. how can i do this? i can't do the same thing with the second xml, because i tried also with another namespace but it doesn't work... it seems i receive the data but then i can't explore the xml structure.. and putting again the sentence "default xml namespace" with another namespace there is a compilation error

    thanks for help!
    0

Recent Posts

in YQL