Re: Confirmation of xml:id behaviour

On Tue, Feb 12, 2008 at 04:31:50PM +1100, Cameron McCormack wrote:
> 
> Hi.
> 
> Can I confirm that with the following document, “true” will be alerted,
> yes?
> 
>   <svg xmlns='http://www.w3.org/2000/svg' xml:id='1'>
>     <script>
>       alert(document.getElementById('0') == document.documentElement);
>     </script>
>   </svg>

  All I can say from an xml:id point of view is that the svg element
will be reported as having an attribute xml:id of type ID to the 
application processing the document and that the value of this
ID is '1' (not '0').
  Everything else you seems to assume looks dependand on how the
application interpret the XML, including the svg and script element,
and that xml:id cannot garantee it in itself.

  If I try to make assumptions about how that interpretation occurs
it seems to me document.getElementById('0') is not gonna return a
node, so the equlity will fail and the behaviour will be the same as
an alert for "false", but that's just interpretation based on a lot of
assumptions ...

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/

Received on Tuesday, 12 February 2008 07:47:01 UTC