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 James Shaw <he...@btopenworld.com> on 2005/03/24 19:53:40 UTC

Bugette in SVG pretty printer

Batik CVS 19/03/2005

I have noticed that the SVG pretty printer handles a document like this 
one incorrectly:

<svg:svg svg:xmlns="http://www.w3.org/2000/svg">
...

The pretty printer converts this to:

<svg:svg contentScriptType="text/ecmascript" width="16.0cm"
          xmlns:xlink="http://www.w3.org/1999/xlink" zoomAndPan="magnify"
          contentStyleType="text/css" height="24.7cm"
          preserveAspectRatio="xMidYMid meet" 
xmlns="http://www.w3.org/2000/svg"
          version="1.0">

You can see that it's incorrectly assumed a null namespace.

If this is a bug (as I think it is), I'd be happy to submit a bug report 
on bugzilla.

Cheers
James Shaw

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


Re: Pretty printing from DOM [was: Bugette in SVG pretty printer]

Posted by James Shaw <he...@btopenworld.com>.
Thomas DeWeese wrote:
> James Shaw wrote:
> 
[snip]
> 
>> I have extended org.apache.batik.apps.svgpp.Main and I am calling the 
>> transcoder like this:
>>
>> PRETTY_PRINTER.transform(new TranscoderInput(doc), new 
>> TranscoderOutput(writer));
>>
>> where doc is the SVGDocument and PRETTY_PRINTER is my extension of 
>> batik.apps.svgpp.Main.  From what you say, this could be the reason 
>> for the breakage.  How would you suggest I implement this?
> 
> 
>   My suspicion is that your document is the problem.
>   Try and view the document you are outputting.
> 
My apologies, it was indeed my document that was at fault.  I'd 
forgotten to run it through the DOM3 LSSerializer.  Thanks for your 
time, Thomas.

James Shaw

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


Re: Pretty printing from DOM [was: Bugette in SVG pretty printer]

Posted by Thomas DeWeese <Th...@Kodak.com>.
James Shaw wrote:

> I am trying to pass an SVGDocument that I have created in-memory (i.e. 
> there is no copy of it on disc) to the pretty printer.

    Then how do you know what attributes are on the root element?
The transcoder uses DOMUtilities to 'serialize' the DOM before it
is sent to the pretty printer.

> I have extended org.apache.batik.apps.svgpp.Main and I am calling the 
> transcoder like this:
> 
> PRETTY_PRINTER.transform(new TranscoderInput(doc), new 
> TranscoderOutput(writer));
> 
> where doc is the SVGDocument and PRETTY_PRINTER is my extension of 
> batik.apps.svgpp.Main.  From what you say, this could be the reason for 
> the breakage.  How would you suggest I implement this?

   My suspicion is that your document is the problem.
   Try and view the document you are outputting.

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


Pretty printing from DOM [was: Bugette in SVG pretty printer]

Posted by James Shaw <he...@btopenworld.com>.
Thomas DeWeese wrote:
> James Shaw wrote:
> 
>> Batik CVS 19/03/2005
>>
>> I have noticed that the SVG pretty printer handles a document like 
>> this one incorrectly:
>>
>> <svg:svg svg:xmlns="http://www.w3.org/2000/svg">
>> ...
>>
>> The pretty printer converts this to:
> 
> 
>   Not for me I get the same thing as I get in.  It looks
> to me like the document has been turned into a DOM and then
> serialized at some point (the PP never adds attrs).

I am trying to pass an SVGDocument that I have created in-memory (i.e. 
there is no copy of it on disc) to the pretty printer.

I have extended org.apache.batik.apps.svgpp.Main and I am calling the 
transcoder like this:

PRETTY_PRINTER.transform(new TranscoderInput(doc), new 
TranscoderOutput(writer));

where doc is the SVGDocument and PRETTY_PRINTER is my extension of 
batik.apps.svgpp.Main.  From what you say, this could be the reason for 
the breakage.  How would you suggest I implement this?

Thanks in advance
James Shaw

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


Re: Bugette in SVG pretty printer

Posted by Thomas DeWeese <Th...@Kodak.com>.
James Shaw wrote:
> Batik CVS 19/03/2005
> 
> I have noticed that the SVG pretty printer handles a document like this 
> one incorrectly:
> 
> <svg:svg svg:xmlns="http://www.w3.org/2000/svg">
> ...
> 
> The pretty printer converts this to:

   Not for me I get the same thing as I get in.  It looks
to me like the document has been turned into a DOM and then
serialized at some point (the PP never adds attrs).

> 
> <svg:svg contentScriptType="text/ecmascript" width="16.0cm"
>          xmlns:xlink="http://www.w3.org/1999/xlink" zoomAndPan="magnify"
>          contentStyleType="text/css" height="24.7cm"
>          preserveAspectRatio="xMidYMid meet" 
> xmlns="http://www.w3.org/2000/svg"
>          version="1.0">
> 
> You can see that it's incorrectly assumed a null namespace.
> 
> If this is a bug (as I think it is), I'd be happy to submit a bug report 
> on bugzilla.
> 
> Cheers
> James Shaw
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 


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