SVG as XML

V

VladimirVV

Hello,
Please, help to understand the problem:
Let's create in Notepad simplest SVG 1.1 document:

<?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 version = "1.1" width="300" height="250">
<title>Example SVG code</title>
<path d="M 10,10 l0,100 100,0 0,-100z"/>
</svg>

Let's save it as *.svg and open in IE (I use 6.0) => IE will open this
document correctly => Adobe Viewer understood everything.
Let's save this document as *.xml file and open in IE => error
message:
------------------------------------------------------------------------------
The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and
then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
Parameter entity must be defined before it is used. Error processing
resource 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'. Line 55,
Position 2

%svg-prefw-redecl.mod;]]>
-^
-------------------------------------------------------------------------------


it seems, that problem with DTD...?
if remove DOCTYPE line => xml will be displayed, but this doesn't
allow to validate document.

but the line
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

is from http://www.w3.org/QA/2002/04/valid-dtd-list.html (have a look
at SVG 1.1 FULL).
Could anyone help me to understand how to create valid SVG 1.1
xml-document?

Best regards, Vladimir.
 
P

Philippe Poulard

VladimirVV said:
Hello,
Please, help to understand the problem:
Let's create in Notepad simplest SVG 1.1 document:

<?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 version = "1.1" width="300" height="250">
<title>Example SVG code</title>
<path d="M 10,10 l0,100 100,0 0,-100z"/>
</svg>

Let's save it as *.svg and open in IE (I use 6.0) => IE will open this
document correctly => Adobe Viewer understood everything.
Let's save this document as *.xml file and open in IE => error
message:
------------------------------------------------------------------------------
The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and
then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
Parameter entity must be defined before it is used. Error processing
resource 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'. Line 55,
Position 2

%svg-prefw-redecl.mod;]]>
-^
-------------------------------------------------------------------------------


it seems, that problem with DTD...?
if remove DOCTYPE line => xml will be displayed, but this doesn't
allow to validate document.

but the line
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

is from http://www.w3.org/QA/2002/04/valid-dtd-list.html (have a look
at SVG 1.1 FULL).
Could anyone help me to understand how to create valid SVG 1.1
xml-document?

Best regards, Vladimir.

DTD is usually used for validation purpose; so, assuming that your SVG
document has been previously validated, removing it is not really a bad
idea if the spec allow SVG engines to process documents without the DTD
sentence (i hope so); however, the DTD carries some important
information, like the namespace URI; SVG engines should react only on
elements that are in this namespace

try this :

<?xml version="1.0"?>
<svg version = "1.1" width="300" height="250"
xmlns="http://www.w3.org/2000/svg">
<title>Example SVG code</title>
<path d="M 10,10 l0,100 100,0 0,-100z"/>
</svg>

please check the namespace URI before, and for other predefined attributes

about ie, i still don't know how it processes such a document... try it
and let me know

the problem is that unlike with other file types, an xml file may be
handled with various applications; usually, extensions are mapped to a
mime type mapped itself to an application, that's why the .svg file is
processed within ie with the svg viewer; with xml files, the browser
doesn't know what tool to use before reading the root element : the
universal name of the root element is unambiguous and could be used to
select the right tool... should a good browser select the right tool
after reading the root element ?

--
Cordialement,

///
(. .)
-----ooO--(_)--Ooo-----
| Philippe Poulard |
-----------------------
 
T

Toni Uusitalo

is from http://www.w3.org/QA/2002/04/valid-dtd-list.html (have a look
at SVG 1.1 FULL).
Could anyone help me to understand how to create valid SVG 1.1
xml-document?

There seems to be some problems with m$ parser when trying to validate
with SVG dtds - I didn't get it to work either. If you can get it to resolve
missing
parameter entity like the one showing in your error message you're going
to bump into other troubles with xmlns attributes in dtd etc. so lets forget
MSXML ;-)

Try for example RXP parser:
http://www.cogsci.ed.ac.uk/~richard/rxp.html

invoking it with
rxp -N -V -x <filename.svg.xml>
(see ftp://ftp.cogsci.ed.ac.uk/pub/richard/rxp.txt for list of switches)

with your document BUT adding attribute called "dummy" into "path"
element outputs:
Warning: Undeclared attribute dummy
for element path in unnamed entity at line 6 char 45 of
file:///<filename.svg.xml>

so this one seems to work.

p.s. you might also want to download "flattened" svg11-flat.dtd for local
validation (you must change your !DOCTYPEs for that) from
http://www.w3.org/TR/SVG/intro.html (search for word "flattened" in this
page)

with respect,
Toni Uusitalo
 
T

Toni Uusitalo

-------------------------------------------------------------------------- ------
Parameter entity must be defined before it is used. Error processing
resource 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'. Line 55,
Position 2

%svg-prefw-redecl.mod;]]>
-^
--------------------------------------------------------------------------
-----

BTW this seems to be a serious flaw in MSXML parser,
in svg11.dtd:
<snip>
<!ENTITY % svg-prefw-redecl.module "IGNORE" >
<![%svg-prefw-redecl.module;[
%svg-prefw-redecl.mod;]]>
</snip>

Parser shouldn't try to expand %svg-prefw-redecl.mod; since this is inside
IGNORE section. I believe IGNORE section can even contain non well-formed
stuff.

with respect,
Toni Uusitalo
 
J

Johannes Koch

Toni said:
There seems to be some problems with m$ parser when trying to validate
with SVG dtds

Not only SVG. This parser cannot handle modular DTDs in general. AFAIK
the same happens with e.g. XHTML 1.1.
 
T

Toni Uusitalo

Johannes Koch said:
Not only SVG. This parser cannot handle modular DTDs in general. AFAIK
the same happens with e.g. XHTML 1.1.
--

yes, likely there gonna be problems handling modular DTDs if conditional
section processing is faulty (see my second post in this thread). Also it
seems that if xmlns is defaulted from DTD, parsing fails.

I remember that IE uses older version (3?) of MSXML by default (there's some
thing
in the xml view in IE that prevents using MSXML4 if I remember correctly).
I don't know if they've fixed these bugs in the later releases of their
parser.

with respect,
Toni Uusitalo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top