xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abraham Rodriguez Mota" <abraham.r...@gmail.com>
Subject Re: Error reading the node's content (using different name spaces)
Date Thu, 04 Sep 2008 14:54:52 GMT
Thanks Helder,

after double checking all your suggestions, the only thing missing was:
alert(relacion.item(0).name);

However, the 'name' method doesn't return the expected value, so I better to
use the nodeName method.
(at least in squiggle and Opera do)

Best regards

Abraham

On Wed, Sep 3, 2008 at 10:33 PM, Helder Magalhães <
helder.magalhaes@gmail.com> wrote:

> > I am trying to group and access no-SVG info in a svg <g> group. So, I am
> > using a different name space name "xxx".
>
> This can be generically labeled as "metadata", even when specified out
> of the "metadata" element, which is part of the SVG specification. ;-)
>
>
> > Here is the code
> >
> > var relacion=targetElement.getElementsByTagNameNS(xxx,"relations");
> > alert(relacion[0].name);
>
> There seem to exist several issues within the code snippet:
> * Is your custom namespace declared in the toplevel SVG element? For
> example:
>
>  <svg xmlns="http://www.w3.org/2000/svg"
> xmlns:xxx="http://mydomain.com/myfolder/xxx/ns" [...]
>
>
>  * Is "xxx", first argument of getElementsByTagNameNS, an ECMAScript
> holding your custom namespace? Using the above example:
>
>  var xxx = "http://mydomain.com/myfolder/xxx/ns";
>
>
>  * I suggest using the item [1] interface to access specific items
> within an item list. Using the array notation seems to work for most
> implementations, but it doesn't seem to be the best
> cross-implementation approach (AFAIK, at least some ASV versions [2]
> and Renesis don't implement the array interface to the node list).
> Rewrite suggestion:
>
>  alert(relacion.item(0).name);
>
>
> For more information I'd suggest a couple [3] [4] of appropriate links.
>
> Hope this helps,
>
>  Helder Magalhães
>
>
> [1] http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-844377136
> [2]
> http://blog.codedread.com/archives/2007/01/19/guide-to-deploying-svg-with-html/#nodelist
> [3] http://developer.mozilla.org/En/SVG:Namespaces_Crash_Course
> [4] http://wiki.svg.org/Namespace
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
>

Mime
View raw message