Hi Phil,
> On 11/26/06, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:
> Hi Phil,
>
> "Phil Wright" < [EMAIL PROTECTED]> wrote on 11/22/2006 01:38:11 PM:
>
> > I can add flowText elements to my displayed document and they show up
as
>
> > desired. If I then output the document and then load it into my app
or
> > Squiggle the flowText elements aren't visible.
>
> It looks like you aren't providing xml prefixes or changing
> the default namespace for the flowText elements. The DOM lets
> you provide the namespace explicitly but unless you associate
> a namespace prefix and use it, that namespace association may
> be lost when you serialize the document.
"Phil Wright" <[EMAIL PROTECTED]> wrote on 11/26/2006 07:02:03 PM:
> I've changed to using flowRoot elements but chances are that I am still
doing
> it all wrong.
>
> I was under the impression that when I did something like:
>
> froot =
document.createElementNS("http://xml.apache.org/batik/ext",
> "flowText");
>
> That providing that namespace parameter did everything that was needed.
I
> don't see any prefixes anywhere so I'm guessing I was still missing a
step
> somewhere in the creation of the root document element(s).
Typically the namespace is given with a prefix like: "xlink:href".
In this case href attribute in the xlink namespace, where the xlink prefix
to namespace mapping is defined (usually on the root svg element) with:
xmlns:xlink="http://www.w3.org/1999/xlink"
Since the flow root elements have to be in the Batik extension
namespace
you need to do something like:
// This establishes the mapping between the prefix 'batikExt' and
// the Batik extension namespace.
document.getRootElement().setAttributeNS(
"http://www.w3.org/2000/xmlns/",
"xmlns:batikExt",
"http://xml.apache.org/batik/ext");
// Create elements in the batik extension namespace
Element flow =
document.createElementNS("http://xml.apache.org/batik/ext",
"batikExt:flowText");
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]