You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Franck Leclerc <Fr...@adacel.com> on 2011/01/06 17:26:52 UTC

SVG file

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


RE: SVG file

Posted by Franck Leclerc <Fr...@adacel.com>.
I wanted to do this, but I was ignoring to how to do this.
Alberto gave me the solution. Problem solved...
Thanks.

Franck.

-----Original Message-----
From: Jones, Monte J CTR USAF AFSPC SMC/SLWE
[mailto:Monte.Jones.ctr@Peterson.af.mil] 
Sent: Friday, January 07, 2011 9:08 AM
To: c-users@xerces.apache.org
Subject: RE: SVG file

Have you tried replacing "svg" with "http://www.w3.org/2000/svg"?

MJJ

-----Original Message-----
From: Franck Leclerc [mailto:Franck.Leclerc@adacel.com] 
Sent: Thursday, January 06, 2011 3:26 PM
To: c-users@xerces.apache.org
Cc: z61f6ip02@sneakemail.com
Subject: RE: SVG file

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: z61f6ip02@sneakemail.com [mailto:z61f6ip02@sneakemail.com] 
Sent: Thursday, January 06, 2011 4:39 PM
To: c-users@xerces.apache.org
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|

<ka...@sneakemail.com> 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 

______________________________________________________________________


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

RE: SVG file

Posted by "Jones, Monte J CTR USAF AFSPC SMC/SLWE" <Mo...@Peterson.af.mil>.
Have you tried replacing "svg" with "http://www.w3.org/2000/svg"?

MJJ

-----Original Message-----
From: Franck Leclerc [mailto:Franck.Leclerc@adacel.com] 
Sent: Thursday, January 06, 2011 3:26 PM
To: c-users@xerces.apache.org
Cc: z61f6ip02@sneakemail.com
Subject: RE: SVG file

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: z61f6ip02@sneakemail.com [mailto:z61f6ip02@sneakemail.com] 
Sent: Thursday, January 06, 2011 4:39 PM
To: c-users@xerces.apache.org
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|

<ka...@sneakemail.com> 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 

______________________________________________________________________


RE: SVG file

Posted by Franck Leclerc <Fr...@adacel.com>.
Thanks. 
Perfect solution that fits my need.
Created SVG document is readable with Mozilla, Explorer and InkScape,
...
I have kept DOCTYPE. The problem was only the value of xmlns.

Thanks again.
Franck.

-----Original Message-----
From: Alberto Massari [mailto:Alberto.Massari@progress.com] 
Sent: Friday, January 07, 2011 4:20 AM
To: c-users@xerces.apache.org
Subject: Re: SVG file

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: z61f6ip02@sneakemail.com [mailto:z61f6ip02@sneakemail.com]
> Sent: Thursday, January 06, 2011 4:39 PM
> To: c-users@xerces.apache.org
> 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|
>
> <ka...@sneakemail.com>  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
>
> ______________________________________________________________________
>
> .
>


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

Re: SVG file

Posted by Alberto Massari <Al...@progress.com>.
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: z61f6ip02@sneakemail.com [mailto:z61f6ip02@sneakemail.com]
> Sent: Thursday, January 06, 2011 4:39 PM
> To: c-users@xerces.apache.org
> 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|
>
> <ka...@sneakemail.com>  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
>
> ______________________________________________________________________
>
> .
>


RE: SVG file

Posted by Franck Leclerc <Fr...@adacel.com>.
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: z61f6ip02@sneakemail.com [mailto:z61f6ip02@sneakemail.com] 
Sent: Thursday, January 06, 2011 4:39 PM
To: c-users@xerces.apache.org
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|

<ka...@sneakemail.com> 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 

______________________________________________________________________


Re: SVG file

Posted by z6...@sneakemail.com.
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|
<ka...@sneakemail.com> 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
>
>