W3C home > Mailing lists > Public > www-svg@w3.org > April 2000

Re: Entity references in path/transform data

From: <klawrenc@us.ibm.com>
Date: Mon, 3 Apr 2000 13:31:53 -0500
To: sdickson@savagesoftware.com (Steve Dickson)
cc: www-svg@w3.org
Message-ID: <852568B6.0066AB54.00@d54mta08.raleigh.ibm.com>



>Some clarification please.  Is it considered valid to embed entity
>references within path and transform data?   I'm thinking along the
>following lines:
>
><!ENTITY line "L 200 200">
><!ENTITY trans "translate(100, 200)">
>
><svg width="640" height="480">
>    <g transform = "&trans; rotate(30)">
>    <path d = "M 400 400 &line; M 300 300 &line; z"/>
>    </g>
></svg>
>
>Can anyone point me to the relevant parts of the SVG/DOM specs that either
>preclude or sanction these types of constructs?  Failing that, can the
>working group clarify whether this use of entity references is legal?

Hello, This is really an XML question not an SVG question.

As long as the XML processor uses an XML parser that expands entity
references then it will never see the pre-expanded parameter entities. So
yes, as a general rule, what you are trying should work.

I took your example and made a "full" SVG file out of it and ran it through
our SVGView viewer to check for errors and everything was fine (with the
entities). Here is that file:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg SYSTEM "svg-20000303-stylable.dtd"
[
  <!ENTITY line "L 200 200">
  <!ENTITY trans "translate(100, 200)">
]>

<svg width="640" height="480">
     <g transform = "&trans; rotate(30)">
     <path d = "M 400 400 &line; M 300 300 &line; z"/>
     </g>
</svg>

Regards
Kelvin Lawrence
IBM
Received on Monday, 3 April 2000 14:51:13 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:18 GMT