On Thursday 13 September 2001 00:53, Ezra Jennings wrote:
> I'm having problems with using EntityReferences as the value of a
> style attribute. I would like to create the following line in an SVG
> document:
>
> <rect x="35" y="70" width="315" style="&st1;" height="50" />
>
> (I am creating this SVG document de novo, so I don't know how to
> create an !ENTITY that will correspond to the &st1;, but I'm prepared
> to work around that with a non-DOM API solution (since it is my
> [mis-?]understanding that Entities are currently read-only). If
> anyone has suggestions here, that would be great also.)
There is no standard solution to change the DTD from DOM2, and nothing more
in Batik.
> I want to use EntityReferences because 1) I'm going to have a style
> repeated several hundred times in a document and want to conserve
> space in my resulting .svg file and 2) I would like to be able to
> change that style very easily (by just changing the Entity
> definition).
>
> Any help with this would be appreciated.
>
You have 2 solutions:
- generate your files directly with a Writer and manage the entities by
hand,
- use CSS.
A styled version of your document could looks like this:
<style type="text/css"><![CDATA[
.st1 { /* your style 1 here */ }
.st2 { /* your style 2 here */ }
]]></style>
<!-- or import a stylesheet you can share:
<?xml-stylesheet type="text/css" href="mystyle.css"?>
-->
<rect class="st1" x="10" y="20" width="30" height="40"/>
<rect class="st2" x="50" y="60" width="70" height="80"/>
--
Stephane.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]