Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can not markup svg:textPath xlink:href=#id1 in XBL?

3 views
Skip to first unread message

jessex...@gmail.com

unread,
Jan 23, 2008, 11:51:15 PM1/23/08
to
Hi all,


Now I am trying to show a long text in an XBL control which is made of
SVG shapes, and I svg:textPath to make the text wrap to lines. I
found that the SVG in XBL control cannot recognize the svg:textPath
normally. I just ignored the textPath elemement! so I make every effor
to made the textPath work.

And then I try to create the text & textPath element with
document.createElementNS with svg namespace. and append the element
node into XBL, (to let it work as markuped), and the text wrapped.
this thing puzzled me.

So I think there must be some difference between "MARKUP" code and
document.createElementNS() in the final result, But I can not tell.

Anyone helps to tell how could I make the svg:textPath work in markup?

below is the markup code: (not working)
<svg:defs>
<svg:path id="browse-description-path" d="m8,0 h456 m-456,16 h456
m-456,16 h456 m-456,16 h456"/>
</svg:defs>
<svg:text id="t13" x="160" y="80" class="small">
<svg:textPath xlink:href="#browse-description-path">text to
show... </textPath>
</svg:text>

below is the javascript code make text & textPath dynamicly, and the
textPath does work:
var ttt = utils.svg.make('text');
ttt.setAttribute('class', 'small');
ttt.setAttribute('x', '16');
ttt.setAttribute('y', '160');
this.appendChild(ttt);
var ppp = utils.svg.make('textPath');
ppp.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href',
'#browse-description-path');
$(ppp).text('text to show...');
ttt.appendChild(ppp);
this.appendChild(ttt);

All the above codes are in a XBL control, so I wonder the problem is
invoved with the namespace, anybody help?

Boris Zbarsky

unread,
Jan 24, 2008, 12:45:35 AM1/24/08
to
jessex...@gmail.com wrote:
> <svg:textPath xlink:href="#browse-description-path">text to

The problem is: relative to what document? The binding document? Or the bound
document?

Relative URIs and XBL don't play together well.

-Boris

jessex...@gmail.com

unread,
Jan 24, 2008, 2:16:33 AM1/24/08
to
Hi Boris,
What do I understand "relative to"? I just want the svg:textPath to
work in a XBL document.

in my further effor, I found that when I append a node contains a
svg:textPath element in it, I call "this.appendChild(node)", then the
svg:textPath worked, but when I call some other node (in annoymous
content) to appendChild(node), and the svg:textPath not work, is this
the problem? what is the difference between "this" in a XBL control
and a annoymous element?

Boris Zbarsky

unread,
Jan 24, 2008, 11:10:39 AM1/24/08
to
jessex...@gmail.com wrote:
> What do I understand "relative to"?

You're using a relative URI. Which document is it relative to?

That's my best guess at what's going on given the very much incomplete code you
sent...

> what is the difference between "this" in a XBL control
> and a annoymous element?

There are lots of differences... Can't say much more than that without seeing
more of your code.

-Boris


0 new messages