Subject: Re: [xsl] Problem with extracting text from svg file From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Tue, 09 Oct 2012 17:55:56 -0400 |
I am trying to get a small xslt to get the d attribute value of an svg path element. My code is the following:
<?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>
The svg file has input of the following:
<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"/>
When i try and run the xslt, with the Saxon HE version, i get the following error:
Error java.net.UnknownHostException: www.w3.org Transformation failed: Run-time errors were reported
I understand that working with namespaces can be tricky, but i just wanted to get the text out.
If anyone could shine some light on this, i would appreciate it!
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
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 />
-- 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Problem with extracting text , russurquhart1 | Thread | Re: [xsl] Problem with extracting t, Russell Urquhart |
[xsl] Problem with extracting text , russurquhart1 | Date | Re: [xsl] Problem with extracting t, Russell Urquhart |
Month |