Hello.
I've a problem.
When I create an SVG structure for example:

in a main program

import org.w3c.dom.*;
import org.w3c.dom.svg.*;
import java.io.*;
import org.apache.batik.dom.*;
import org.apache.batik.dom.util.*;
import org.apache.batik.dom.svg.*;
import org.apache.batik.util.*;

public class TestSVG
{
  public static void main(String[] args)
  {
    DOMImplementation impl = (SVGDOMImplementation)
    SVGDOMImplementation.getDOMImplementation();
    String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
    SVGDocument svgDoc = (SVGDocument)(impl.createDocument
(svgNS, "svg", null));

    SVGSVGElement root = svgDoc.getRootElement();

    SVGOMTextElement t1 = (SVGOMTextElement)svgDoc.createElementNS
(svgNS, SVGConstants.SVG_TEXT_TAG);
    t1.setAttribute(SVGConstants.SVG_X_ATTRIBUTE, "80");
    t1.setAttribute(SVGConstants.SVG_Y_ATTRIBUTE, "100");
    t1.setAttribute(SVGConstants.CSS_FONT_SIZE_PROPERTY, "12");
    t1.setAttribute(SVGConstants.CSS_FONT_FAMILY_PROPERTY, "times");
    t1.setAttribute(SVGConstants.CSS_FILL_PROPERTY, "yellow");

    Text text1 = svgDoc.createTextNode("hello world");
    t1.appendChild(text1);

    root.appendChild(t1);
.
. // add other element in svg structure
.
.

    String svgStr = "";
    try
    {
      StringWriter strW = new StringWriter();
      DOMUtilities.writeDocument(svgDoc, strW);
      svgStr = strW.toString();
      strW.flush();
      strW.close();

    }
    catch (IOException exp)
    {
      exp.printStackTrace();
    }

  }
}




now svgStr is a string with svg code.
The ploblem is that this code is in only in one no formated row.

ex:
<svg><text x="80" y="120" font-size="8" font-family="times" 
fill="yellow">hello 
world</text>.........................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.......................................</svg>

In only one row.
I'd like this structure:
<svg>
  <text ....>hello world</text>
  ... 
     ...
</svg>

I use normalize() methods but without any result for my scope.

I hope there is a solution.

Thanks a lot.
Alessandro Peruzzi





-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to