On Dec 13, 2003, at 05:55, Thomas DeWeese wrote:

Looking at the code the error below should only happen if you
have two 'elements' at the top level of the source document.
Alternatively if the Xerces document doesn't return the true
root of the document from getDocumentElement().

  So my guess is that the Xerces DOM is returning 'null' from
getDocumentElement(), or your XSL transform is generating
multiple 'top level' elements (which isn't allowed) I don't
know if XSLT checks for this sort of error.

Can you confirm that Batik should be able to take a Xerces DOM document and that creating a SVGDOMDocument is unnecessary? The document is valid SVG because if I dump it out as text and pass it to the batik command line tool it gets converted to PNG just fine. Whether I pass it as an XSL result or allow Xerces to parse it off the disk (in both cases it is a Xerces DOM document) I get the same error in Batik. Here is the whole document:


<?xml version="1.0" encoding="utf-8"?><svg:svg xmlns:svg="http://www.w3.org/2000/svg"; width="185" height="100" viewBox="0 0 185 100"><svg:title>Market Indices Chart</svg:title><svg:defs><svg:style type="text/css">

                                        text
                                        {
                                                font-size: 11;
                                                font-family: serif
                                        }
                                        .grid
                                        {
                                                stroke: #b0b0b0;
                                        }

</svg:style></svg:defs><svg:g transform="translate(4, 88) scale(1, -1)"><svg:text x="9" y="10" fill="#a06b6b" transform="scale(1, -1)">
10:00
</svg:text><svg:text x="53" y="10" fill="#a06b6b" transform="scale(1, -1)">
12:00
</svg:text><svg:text x="97" y="10" fill="#a06b6b" transform="scale(1, -1)">
14:00
</svg:text><svg:text x="2" y="-2" transform="scale(1, -1)"> </svg:text><svg:text x="4" y="-68" transform="scale(1, -1)" font-weight="bold" fill="#505050">NaN</svg:text><svg:text x="141" y="-68" transform="scale(1, -1)" text-anchor="end" font-weight="bold">NaN</svg:text></svg:g></svg:svg>


Thanks for your help
Dwayne








> TranscoderInput says that it takes a
> org.w3c.dom.Document but I get the following error when I try to
> pass in a Xerces DOM tree:
>
> org.w3c.dom.DOMException: The current node (type: 9, name: #document)
> do not allow children of the given type (type: 1, name: svg:svg)
> at org.apache.batik.dom.AbstractNode.createDOMException(Unknown
> Source)
> at org.apache.batik.dom.AbstractDocument.checkChildType(Unknown
> Source)
> at
> org.apache.batik.dom.AbstractParentNode.checkAndRemove(Unknown Source)
> at org.apache.batik.dom.AbstractParentNode.insertBefore(Unknown
> Source)
> at
> org.apache.batik.dom.util.DOMUtilities.deepCloneDocument(Unknown Source)
> at


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to