--- In [email protected], "Martin Honnen"
<[EMAIL PROTECTED]> wrote:
>
> --- In [email protected], "Catalin Hritcu" 
> 
> > I have almost the same problem, and I have tried all the tricks in
> > this thread and I can still with no success. I also would like to use
> > getElementById on some XML document I get via XMLHttpRequest ... but
> > well, the XML document is not SVG, nor is there any way I can make it
> > be. Does anybody have any idea on how I can use getElementById on such
> > a document?
> 
> For XML getElementById only works for those attributes that the DTD
> defines as being of type ID (or for those MIME types like
> application/xhtml+xml for XHTML 1 or image/svg+xml for SVG where the
> browser knows which attributes are ID attributes). Additionally
> Mozilla uses expat for XML parsing and that reads only the internal
> DTD so there you would need to define the attributes of type ID.
> 
> Example XML document:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE gods [
>   <!ATTLIST god
>      name ID #REQUIRED>
> ]>
> <gods>
>   <god name="Kibo" power="42" />
> </gods>
> 
> 
> Example script using XMLHttpRequest to read that:
> 
> var httpRequest = new XMLHttpRequest();
> httpRequest.open('GET', 'test2006020302.xml', true);
> httpRequest.onreadystatechange = function () {
>   if (httpRequest.readyState == 4) {
>     var xmlDocument = httpRequest.responseXML;
>     var element = xmlDocument.getElementById('Kibo');
>     if (element != null) {
>       alert(element + '; ' + element.getAttribute('power'));
>     }
>   }
> };
> httpRequest.send(null);
> 
> The element is found here with Mozilla and with Opera (9).
> 
> Opera 8 does not find the element however.
>
Thank you very much for the solution. I just tried it and it works
perfectly :)






-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to