Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Problem with SVG(SVG error: content is not allowed in prolog!!)
Problem with SVG [message #1837253] Tue, 26 January 2021 09:59
Mariem Makni is currently offline Mariem MakniFriend
Messages: 46
Registered: February 2013
Member
Bonjour,

I am trying to diplay an svg image using XMl file. Here my code, I am using batik library and Canvas class:I am trying to diplay an svg image using XMl file. Here my code, I am using batik library and Canvas class:
JFrame mainFrame = new JFrame("Task Graph.svg");

mainFrame.setSize(800,600);

mainFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

mainFrame.setVisible(true);

Container pane = mainFrame.getContentPane();

pane.setLayout(new BorderLayout());

JSVGCanvas canvas = new JSVGCanvas();

canvas.setURI(workDir+"/"+"output.xml");
    
                       
pane.add(canvas, BorderLayout.CENTER);

pane.setVisible(true);



When I try to run the code in eclipse, I get this error:

"svg error: content is not allowed in prolog"

I think the problem is come from this line,:

<g id="a_node1"><a xlink:href="/home/makni/output.hello.c#178" </g>


I don't know if I can use xlink:href to get the nodes from a c code using svg??

here is the xml file:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="1967pt" height="76pt" version="1.1"
 xmlns="http://www.w3.org/2000/svg" xmlns:xlink= "http://www.w3.org/1999/xlink">
    
  <g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 72)">
<title>G</title>
<polygon fill="#ffffff" stroke="#000000"  points="-4,4 -4,-72 1963.045,-72 1963.045,4 -4,4"/>
<g id="clust1" class="cluster">
<title>cluster_0</title>
<polygon fill="none" stroke="#000000" points="8,-8 8,-60 1951.045,-60 1951.045,-8 8,-8"/>
 </g>
    
       <!-- task_36 -->
       <g id="node1" class="node">
       <title>task_36</title>
       <g id="a_node1"><a xlink:href="/home/makni/hello.c#178" 
 xlink:title="non_linear_memset_regression_based">
<ellipse fill="#aaaaaa" stroke="#000000" cx="161.5871" cy="-34" rx="145.6742" ry="18"/>
<text text-anchor="middle" x="161.5871" y="-30.3" font-family="Times,serif" font-size="14.00" 
 fill="#000000">non_linear_memset_regression_based</text>
</a>
 </g>
</g>
</g>
</svg>



Could you help me please?

THank you in advance
Previous Topic:Error Downloading Eclipse
Next Topic:Class File Editor - Source not found error
Goto Forum:
  


Current Time: Fri Jul 23 20:09:48 GMT 2021

Powered by FUDForum. Page generated in 0.02630 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top