Frank,
if you want to place the svg element in the "http://www.w3.org/2000/svg"
namespace, use this code:
pSVG = pImpl->createDocument(XercesString("http://www.w3.org/2000/svg"),
XercesString("svg"),
pDoctype);
If you don't want to have the DOCTYPE line, specify NULL instead of pDocType
Alberto
On 1/6/2011 11:26 PM, Franck Leclerc wrote:
Thanks.
I already look at http://jwatt.org/svg/authoring/
My problem is when I create svg document with DOM (Xerces-C++ 2.8.0),
attribute "xmlns" is created with default value ("svg") and I have not
found the way to change this value ("xmlns" seem to be a special
attribute).
If xmlns should have the value http://www.w3.org/2000/svg
(xmlns=http://www.w3.org/2000/svg), my SVG file will be correct.
Could you tell me how to change value for this special attribute?
Code used to create SVG document:
DOMImplementation *pImpl = DOMImplementation::getImplementation();
DOMDocumentType* pDoctype = pImpl->createDocumentType(
XercesString("svg"), NULL, NULL );
pSVG = pImpl->createDocument(XercesString("svg"), XercesString("svg"),
pDoctype);
Thanks again.
lecf
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Thursday, January 06, 2011 4:39 PM
To: [email protected]
Subject: Re: SVG file
It looks like your SVG is broken. xmlns needs a namespace URI, and
people
also recommend to not use a DOCTYPE declaration.
Have a look at this:
http://jwatt.org/svg/authoring/
Cheers,
Uwe
On Fri, Jan 7, 2011 at 3:26 AM, Franck Leclerc
Franck.Leclerc-at-adacel.com|xerces-c developer mailing lis/Example
Allow|
<[email protected]> wrote:
Can I use Xerces-C++ (DOM) to generate SVG file?
I tried but attribute "xmlns" have a value ("svg") not recognized by
SVG
viewer (Explorer, Mozilla, Inkscape)
I used Xerces 2.8.0. See below the generated file.
I tried to change attribute value of "xmlns" without success (also I
can
not remove it).
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE svg>
<svg xmlns="svg" height="200" width="320">
<g style="font-size:14">
<rect height="20" style="stroke:node; fill:red" width="29" x="100"
y="20"/>
<text x="20" y="35">North</text>
</g>
</svg>
Thanks.
lecf
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
.