This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: pulling info from SVG file with document(file) function
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: Re: [xsl] pulling info from SVG file with document(file) function
- From: "Robert Koberg" <rob at koberg dot com>
- Date: Wed, 15 Aug 2001 13:36:48 -0700
- References: <B8BE783DF30DD51182DC00508BF330EE0129866F@us-bv-m03.bv.tek.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
also, you might want to put the return from the document call in a variable
so you can use it over and over.
<xsl:variable name="svg-root" select="document('file.xml')/svg" />
----- Original Message -----
From: <bryan.s.schnabel@exgate.tek.com>
To: <xsl-list@lists.mulberrytech.com>
Sent: Wednesday, August 15, 2001 1:29 PM
Subject: RE: [xsl] pulling info from SVG file with document(file) function
> When you set your variable, are you including an extra set of quotes?
>
> <xsl:variable name="file" select="'file.xml'" />
>
> This should help.
>
> Bryan
>
> -----Original Message-----
> From: Wilcox, Paul [mailto:Paul.Wilcox@usa.xerox.com]
> Sent: Wednesday, August 15, 2001 12:41 PM
> To: 'XSL-List@lists.mulberrytech.com'
> Subject: [xsl] pulling info from SVG file with document(file) function
>
>
>
> I am at an impass trying to use the document() function to pull specific
> information from a secondary file.
> I can use <xsl:copy-of select="document(file)" /> to copy the svg into the
> output, but can not pull
> specific information, i.e. the attributes from the top level <svg> tag.
> I am using saxon 6.2.2.
>
> ideas?
>
> Thanks.
>
>
> xsl:
>
> <xsl:value-of select="document($file)//svg/@width" />
> <xsl:value-of select="document($file)//svg/@height" />
> <xsl:value-of select="document($file)//svg/@viewBox" />
>
>
> (I have also tried document($file)/svg/@width, and
> document($file//svg/@width) )
>
>
> source svg file:
>
> <?xml version="1.0" encoding="iso-8859-1"?>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000303 Stylable//EN"
>
"http://www.w3.org/TR/2000/03/WD-SVG-20000303/DTD/svg-20000303-stylable.dtd"
> [
> <!ENTITY st0 "fill-rule:nonzero;clip-rule:nonzero;">
> <!ENTITY st1
>
"fill-rule:nonzero;clip-rule:nonzero;fill:none;stroke:#000000;stroke-width:0
> .481;stroke-linecap:square;stroke-miterlimit:10;">
> <!ENTITY st2 "font-family:'Arial-BoldMT';">
> ]>
> <svg width="685.42pt" height="469.3pt" viewBox="0 0 685.42 469.3"
> xml:space="preserve">
> <style type="text/css" />
> ....more....
> </svg>
>
>
>
> Paul Wilcox
> Software Engineer
> Global Knowledge and Language Services
> XEROX
> email: Paul.Wilcox@usa.xerox.com
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list