[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Problem with extracting text from svg file


Subject: Re: [xsl] Problem with extracting text from svg file
From: Russell Urquhart <russurquhart1@xxxxxxxxxxx>
Date: Tue, 09 Oct 2012 18:30:17 -0500

Hi Ken,

Looking in the source svg file i DID find the following:

<DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> 

Am i going to have to strip out these lines from the source svg files, or is there some way to get the xslt to disregard them?

thanks,

Russ

> Your error has nothing to do with namespaces because namespaces do not 
> trigger any access to the web that would need to dereference the host.
>
> I suspect you have a DTD reference in your source file.  I see no reason 
> why your stylesheet would access the web.
>
>> If anyone could shine some light on this, i would appreciate it!
>
> I've copied your code below, adding a document element for your SVG, and 
> it works just fine with saxon9he.
>
> You'll have to look into your SVG source file for the problem.
>
> I hope this helps.
>
> . . . . . . . Ken
>
> T:\ftemp>type russ.xml
> <svg xmlns="http://www.w3.org/2000/svg">
> <path d="M145 20 v 374M210.16666666666669 20 v 374M275.33333333333337 20 
> v 374M340.50000000000006 20 v 374M405.66666666666674 20 v  
> 374M470.8333333333334 20 v 374M536.0000000000001 20 v 374" 
> class="gridlines"/>
> </svg>
>
> T:\ftemp>saxon9he -s:russ.xml -xsl:russ.xsl
> Warning: at xsl:stylesheet on line 3 column 45 of russ.xsl:
>   Running an XSLT 1 stylesheet with an XSLT 2 processor
>
> M145 20 v 374M210.16666666666669 20 v 374M275.33333333333337 20 v  
> 374M340.50000000000006 20 v 374M405.66666666666674 20 v  
> 374M470.8333333333334 20 v 374M536.0000000000001 20 v 374
>
> T:\ftemp>type russ.xsl
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
>     xmlns:svg="http://www.w3.org/2000/svg" >
>     <xsl:output  method="text" indent="yes" />
>
>     <xsl:template match="svg:path">
>         <xsl:value-of select="@d"/>
>             <xsl:apply-templates />
>
>     </xsl:template>
>
> </xsl:stylesheet>
>
> T:\ftemp>
>
>
> --
> Contact us for world-wide XML consulting and instructor-led training
> Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm
> Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/
> G. Ken Holman                   mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
> Google+ profile: https://plus.google.com/116832879756988317389/about
> Legal business disclaimers:    http://www.CraneSoftwrights.com/legal


Current Thread
Keywords