You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Ullric Oger <og...@mapsys.fr> on 2004/06/03 13:48:03 UTC

Re: Serving stylable SVG

Hi,

To avoid the 'xmlns="%SVGNamespace;"' you can add the namespace to the 
svg element :

...
<svg xmlns="http://www.w3.org/2000/svg" width="8in" height="8in" 
viewBox="0 0 1 1" preserveAspectRatio="none">
...

But you may have another problem with the doctype, if the viewer doesn't 
recognize it.
In this case try to remove it.

Alessandro Evangelista wrote :

> Hi all,
>
> I have a problem serving "statically" stylable SVG images "-//W3C//DTD 
> SVG 20000303 Stylable//EN".
>
> The sitemap configuration is:
>
> <map:serializer name="svg" mime-type="image/svg+xml" 
> src="org.apache.cocoon.serialization.XMLSerializer"/>
> ....
> <map:match pattern="**.svg">
>    <map:generate src="content/xdocs/{1}.svg" />
>    <map:serialize type="svg"/>
> </map:match>
>
> This is the source SVG file:
>
> <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000303 Stylable//EN"
> "http://www.w3.org/TR/2000/03/WD-SVG-20000303/DTD/svg-20000303-stylable.dtd"> 
>
> <svg width="8in" height="8in" viewBox="0 0 1 1" 
> preserveAspectRatio="none">
> <title>SVG drawing</title>
> ...
>
> This is the resulting SVG. Please note the ** xmlns="%SVGNamespace;" 
> ** in the <svg> tag.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000303 Stylable//EN" 
> "http://www.w3.org/TR/2000/03/WD-SVG-20000303/DTD/svg-20000303-stylable.dtd"> 
>
> <svg xmlns="%SVGNamespace;" width="8in" height="8in" viewBox="0 0 1 1" 
> preserveAspectRatio="none" enableZoomAndPanControls="true" 
> contentScriptType="text/ecmascript" contentStyleType="text/css">
> <title content="structured text">SVG drawing</title>
> ....
>
> What's wrong with the configuration?
>
> Thanks a lot for your help.
>
> Alessandro
>
>
>



Re: Serving stylable SVG

Posted by Alessandro Evangelista <ev...@gmx.net>.
Apparently the parser fails to interpret the DTD for stylable svg 
described in "svg-20000303-stylable.dtd".

"svg-20000303-stylable.dtd" includes "svg-20000303-shared.dtd" via the 
%Shared entity. At the same time it defines %SVGNamespace:

...
<!ENTITY % SVGNamespace "http://www.w3.org/2000/svg-20000303-stylable" >
<!ENTITY % Shared PUBLIC "-//W3C//DTD SVG 20000303 Shared//EN" 
"svg-20000303-shared.dtd" >
%Shared;
...

"svg-20000303-shared.dtd" set the <svg> namespace with a reference to 
the entity "%SVGNamespace", which is not interpreted by the parser.
...
<!ATTLIST svg
  xmlns CDATA #FIXED "%SVGNamespace;"
...

Is this a parser bug?

Cheers,
Alessandro

Ullric Oger wrote:

> Hi,
>
> To avoid the 'xmlns="%SVGNamespace;"' you can add the namespace to the 
> svg element :
>
> ...
> <svg xmlns="http://www.w3.org/2000/svg" width="8in" height="8in" 
> viewBox="0 0 1 1" preserveAspectRatio="none">
> ...
>
> But you may have another problem with the doctype, if the viewer 
> doesn't recognize it.
> In this case try to remove it.
>
> Alessandro Evangelista wrote :
>
>> Hi all,
>>
>> I have a problem serving "statically" stylable SVG images 
>> "-//W3C//DTD SVG 20000303 Stylable//EN".
>>
>> The sitemap configuration is:
>>
>> <map:serializer name="svg" mime-type="image/svg+xml" 
>> src="org.apache.cocoon.serialization.XMLSerializer"/>
>> ....
>> <map:match pattern="**.svg">
>>    <map:generate src="content/xdocs/{1}.svg" />
>>    <map:serialize type="svg"/>
>> </map:match>
>>
>> This is the source SVG file:
>>
>> <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
>> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000303 Stylable//EN"
>> "http://www.w3.org/TR/2000/03/WD-SVG-20000303/DTD/svg-20000303-stylable.dtd"> 
>>
>> <svg width="8in" height="8in" viewBox="0 0 1 1" 
>> preserveAspectRatio="none">
>> <title>SVG drawing</title>
>> ...
>>
>> This is the resulting SVG. Please note the ** xmlns="%SVGNamespace;" 
>> ** in the <svg> tag.
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000303 Stylable//EN" 
>> "http://www.w3.org/TR/2000/03/WD-SVG-20000303/DTD/svg-20000303-stylable.dtd"> 
>>
>> <svg xmlns="%SVGNamespace;" width="8in" height="8in" viewBox="0 0 1 
>> 1" preserveAspectRatio="none" enableZoomAndPanControls="true" 
>> contentScriptType="text/ecmascript" contentStyleType="text/css">
>> <title content="structured text">SVG drawing</title>
>> ....
>>
>> What's wrong with the configuration?
>>
>> Thanks a lot for your help.
>>
>> Alessandro
>>
>>
>>
>
>
>