xsl-list
[Top] [All Lists]

RE: [xsl] Why does the doc() function reject non-ASCII characters in the filename?

2012-10-05 11:12:11
Thank you very much Ken and Gerrit -- awesome!

Because of your help I have solved the problem.

Here's what I did:

To read in the list of filenames I was using unparsed-text like so:

     <xsl:variable name="text" select="unparsed-text('all-files.txt', 
'utf-8')"/>

I changed it from 'utf-8' to 'iso-8859-1' like so:

    <xsl:variable name="text" select="unparsed-text('all-files.txt', 
'iso-8859-1')"/>

Then, in my loop to process each filename I checked for doc-available like so:

            <xsl:choose>
                <xsl:when test="doc-available(encode-for-uri($filename))">
                    <xsl:variable name="file" 
select="doc(encode-for-uri($filename))" />
                    
                    <!-- Process the file -->

                </xsl:when>
            </xsl:choose>

That works great.

Thanks again!

/Roger
-----Original Message-----
From: Imsieke, Gerrit, le-tex 
[mailto:gerrit(_dot_)imsieke(_at_)le-tex(_dot_)de] 
Sent: Friday, October 05, 2012 11:43 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Why does the doc() function reject non-ASCII characters in 
the filename?

Another reason why it failed might be that the text file that contains 
the file names is encoded differently from what Java expects (if your 
XSLT processor runs on Java).

Maybe you need to specify -Dfile.encoding=UTF8 (or whatever) when 
invoking Java.

Gerrit

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


<Prev in Thread] Current Thread [Next in Thread>