Yup.  That's exactly what I did.

Glad you got it working.

    Phil


On 12/4/06, Richard Suematsu <[EMAIL PROTECTED]> wrote:

Hi,

Ok, I got it.  For some reason, it doesn't like it when you use the
normal xml DocumentBuilder to create the Document.  Instead, I do a

            String parser = XMLResourceDescriptor.getXMLParserClassName();
            SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
            Document doc = f.createDocument(null, new StringReader(svg));

And this works fine.  Thanks.

Richard Suematsu wrote:
> Hi Phil,
>
> Could you do me a favor?  Somehow this is not fixing my problem and I
> seem to be doing the same thing you are.  Could you post a real sample
> of an svg file that works for you.  I'm still getting the
> GenericElementException.  Sample code I download off the net also
> gives me the same problem. Are you using Batik 1.6 or a newer version?
>
> Now that I think about it, I just create a document using
> DocumentBuilder and do a setDocument with that.  I don't create a
> SVGDocument like you do and insert the svg node into that.
>
> Phil Wright wrote:
>> Thanks Thomas.
>>
>> As a short-term solution I just kept everything in the SVG namespace.
>>
>> Is there really no way to take a node/element you have read from
another
>> namespace and force a new namespace onto it?
>>
>>    Phil
>>
>>
>> On 12/2/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>>>
>>> Hi Phil,
>>>
>>> "Phil Wright" <[EMAIL PROTECTED]> wrote on 12/01/2006 10:22:55 PM:
>>>
>>> > I'm getting the same ClassCastException error in my program.  (See
>>> post
>>> from a
>>> > few minutes ago.)
>>>
>>>    I think you likely do have the same problem.  You probably
>>> need to either define a prefix for your SVG element's:
>>>         xmlns:svg="http://www.w3.org/2000/svg";
>>>
>>>    and then use it for all of your SVG content:
>>>         <svg:svg width="100" ...>
>>>            <svg:path d="M ..." />
>>>       </svg:svg>
>>>
>>>    or add the xmlns="http://www.w3.org/2000/svg"; to each
>>> of your 'svg' elements to set the default namespace for
>>> those subtree's.
>>>
>>> > Hopefully the solution for you will help me or vice-versa.
>>>
>>>
>>>
>>> > On 12/1/06, Richard Suematsu <[EMAIL PROTECTED]> wrote:
>>> > Hi,
>>> >
>>> > I'm getting a svg document from a web server that requires client
>>> side
>>> > certificates.  So I can't just pass in a URI into batik.  I'm
>>> trying to
>>> > create my svg document with the
>>> > SAXSVGDocumentFactory.createDocument (URI, Reader), but I don't know
>>> what
>>> > to put into the URI part.  If I leave it blank, I get a no protocol
>>> error.
>>> >
>>> > I tried just creating a Document with the regular DOM parser, but
>>> when I
>>> > do a setDocument, I get an ClassCastException GenericElement error.
>>> >
>>> > The document loads into Squiggle just fine.
>>> >
>>> > Any ideas?
>>> >
>>> > --
>>> > Aloha,
>>> > Richard Suematsu
>>> > SynCaDD Systems, Inc.
>>> >
>>> >
>>> >
---------------------------------------------------------------------
>>> > To unsubscribe, e-mail:
>>> [EMAIL PROTECTED]
>>> > For additional commands, e-mail:
>>> [EMAIL PROTECTED]
>>>
>>>
>>> >
>>> >
>>> >
>>> > --
>>> > Visit http://www.darkisle.com for photos of castles, cairns and
other
>>> historic
>>> > sites in the British Isles.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail:
>>> [EMAIL PROTECTED]
>>>
>>>
>>
>>
>
>


--
Aloha,
Richard Suematsu
SynCaDD Systems, Inc.


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




--
Visit http://www.darkisle.com for photos of castles, cairns and other
historic sites in the British Isles.

Reply via email to