Hello,
after a long time of using batik successfully in out project,
it's time to take another step and generate the SVGs automatically
instead of reading them from the file system.
Of course, we wish to minimize the necessary changes to the system.
The currently existing component generating the SVG documents uses dom4j
to create the XML and writes them to disk. This happens at development time.
At runtime, Batik reads the SVG documents using a SAXSVGDocumentFactory
and displays them.
Working on the change I've come across a problem.
I am converting the automatically generated dom4j-documents by means of
a dom4j DOMWriter, which converts the document to the w3c.Document
interface by use of the SVGDOMImplementation provided by Batik.
Afterwards, the documents are handed to the display component the same
way as before, however, this results in an error:
"SVG Error:
null=-1
Cannot find the referenced element: #Solar
specified on the element <use> - may be a problem of ID."
The id 'Solar' is defined by a <symbol> element earlier in the SVG code.
What I believe to be the offending section in the SVG document looks
like this:
<defs>
<symbol id="Solar" preserveAspectRatio="xMidYMid meet">
<g>
... content ...
</g>
</symbol>
</defs>
<g id="cascade">
<g>
<g transform="translate(268.75 0.0)">
<use x="0" y="0" fill="none" xlink:href="#Solar"/>
</g>
.... rest of document ...
Now, I believe this is a problem with the base URI of the document -
when converting from another XML-implementation, the (which did not
exist in the first place, since the document is created in memory) URI
is lost, thus Batik has no point of reference.
Is this assumption correct?
If so, I am wondering whether this complies with section 5.3 of the SVG
specification, which identifies URIs of the form #<Identifier> as local,
and with the URI definition telling us that said URIs should be treated
as references to the containing document.
Then again, I might just be mistaken and have missed something about
using Batik correctly - in this case, I'd be glad if you could point me
to my mistake.
Thanks in advance
-Urs
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]