You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Olaf Schnabel <sc...@karto.baug.ethz.ch> on 2005/04/20 15:14:31 UTC

Batik and printNode command

Hi Batik users
I use the printNode command in my webproject (SVG + ECMAScript) and want 
to write out a part of the SVG-code (tags + content).

Example of SVG code:

<svg>
	<defs id="def">
		<circle cx="20" cy="20" r="10"/>
	</defs>
</svg>

In the Adobe SVG Viewers the following ECMAScript code works without 
problems:

var x = document.getElementById("def");
var y = printNode(x);

In Batik  I get an error message "printNode is not defined."

Do you have any ideas for a workaround?

Thanks for your answer.

Regards
Olaf
-- 
Olaf Schnabel
Department of Cartography
Swiss Federal Institute of Technology (ETH)
ETH Hoenggerberg, CH-8093  Zurich, Switzerland
phone: ++41 44 633 3031
e-mail: schnabel@karto.baug.ethz.ch
www: http://www.ika.ethz.ch/schnabel

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Batik and printNode command

Posted by Olaf Schnabel <sc...@karto.baug.ethz.ch>.
Thomas, thanks for the hint.

Regards
Olaf

Thomas DeWeese wrote:
> Hi Olaf,
> 
> Olaf Schnabel wrote:
> 
>> I use the printNode command in my webproject (SVG + ECMAScript) and 
>> want to write out a part of the SVG-code (tags + content).
>>
>> Example of SVG code:
>>
>> <svg>
>>     <defs id="def">
>>         <circle cx="20" cy="20" r="10"/>
>>     </defs>
>> </svg>
>>
>> In the Adobe SVG Viewers the following ECMAScript code works without 
>> problems:
>>
>> var x = document.getElementById("def");
>> var y = printNode(x);
>>
>> In Batik  I get an error message "printNode is not defined."
>>
>> Do you have any ideas for a workaround?
> 
> 
>    One option is to use the 'import' facilities of Rhino to
> pull in one of the DOM serializers from Batik (like
> org.apache.batik.dom.util.DOMUtilities), and use that
> to serialize the document.
> 
>    It is also pretty easy to write a simple DOM serializer
> in ECMAScript.  It wouldn't surprise me if you could find
> one floating around on the net (from comments on
> svg-developers I suspect that people doing real
> serialization of the DOM write there own).
> 
>>
>> Thanks for your answer.
>>
>> Regards
>> Olaf
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 

-- 
Olaf Schnabel
Department of Cartography
Swiss Federal Institute of Technology (ETH)
ETH Hoenggerberg, CH-8093  Zurich, Switzerland
phone: ++41 44 633 3031
e-mail: schnabel@karto.baug.ethz.ch
www: http://www.ika.ethz.ch/schnabel

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Batik and printNode command

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Olaf,

Olaf Schnabel wrote:

> I use the printNode command in my webproject (SVG + ECMAScript) and want 
> to write out a part of the SVG-code (tags + content).
> 
> Example of SVG code:
> 
> <svg>
>     <defs id="def">
>         <circle cx="20" cy="20" r="10"/>
>     </defs>
> </svg>
> 
> In the Adobe SVG Viewers the following ECMAScript code works without 
> problems:
> 
> var x = document.getElementById("def");
> var y = printNode(x);
> 
> In Batik  I get an error message "printNode is not defined."
> 
> Do you have any ideas for a workaround?

    One option is to use the 'import' facilities of Rhino to
pull in one of the DOM serializers from Batik (like
org.apache.batik.dom.util.DOMUtilities), and use that
to serialize the document.

    It is also pretty easy to write a simple DOM serializer
in ECMAScript.  It wouldn't surprise me if you could find
one floating around on the net (from comments on
svg-developers I suspect that people doing real
serialization of the DOM write there own).

> 
> Thanks for your answer.
> 
> Regards
> Olaf


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org