RE: [xsl] Preserving space

Subject: RE: [xsl] Preserving space
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 13 Feb 2008 10:07:19 -0000
I think you need to raise this on a list that's specific to xsltproc

(a) The input to document() is supposed to be a URI. URIs never contain
spaces. If you supply something that isn't a valid URI, XSLT 1.0 is pretty
vague about what's supposed to happen. You could try escaping it as %20

(b) If document() can't find anything with the supplied URI, then the spec
says it has the option of reporting an error or returning nothing. Some
processors have switches that allow you to configure this.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Mathieu Malaterre [mailto:mathieu.malaterre@xxxxxxxxx] 
> Sent: 13 February 2008 09:56
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Preserving space
> 
> Hi there,
> 
>   The following code is loosing the space when calling the 'document'
> function. The weirdest part is that I do not even get an error...
> 
> xml:
>   <file>toshiba/MIIXR00010EAB (V3.10).xml</file>
> 
> xsl:
>   <xsl:template match="file">
>     <xsl:apply-templates select="document(.)"/>
>   </xsl:template>
> 
> What do I need to do to:
> 1. Preserve the space
> 2. Make sure an error is raised if a document cannot be found.
> 
> Ref: Debian/Linux + xsltproc
> 
> $ xsltproc --version
> Using libxml 20627, libxslt 10119 and libexslt 813 xsltproc 
> was compiled against libxml 20627, libxslt 10119 and libexslt 
> 813 libxslt 10119 was compiled against libxml 20627 libexslt 
> 813 was compiled against libxml 20627
> 
> 
> Thanks
> --
> Mathieu

Current Thread