xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject RE: how to load an external stylesheet?
Date Tue, 04 Sep 2007 11:19:12 GMT
Hi JavaNoob,

javaNoob <noypi_baller@yahoo.com> wrote on 09/03/2007 03:06:37 AM:

> it's not working.. can anyone take a look?

   What's happening?  Any stack trace/Exception?

> this snippet is from a servlet that loads the svg.. i am sure that the
> styleSheetURL is correct

   Why are you sure of that?  (also see below for possible typo).

>     protected SVGDocument loadMap(String fileName) {
>         Document doc = null;
>         try {
>             String parser = 
XMLResourceDescriptor.getXMLParserClassName();
>             SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
>             String uri = fileName;
>             doc = f.createDocument(uri);
> 
>             ProcessingInstruction pi =
> doc.createProcessingInstruction("xml-stylesheet", 
                                  "type=\"text/css\"href=\"" + 
styleSheetURL + "\"");
 
     I think there should be a space between the close quote for
'type' and the 'href' attribute.  That could probably cause the problem...

>             doc.insertBefore(pi, doc.getDocumentElement()); 
>         } catch (IOException ex) {
>             ex.printStackTrace();
>         }
>         return (SVGDocument)doc;
>     }


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message