[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Testing the existence of a binary file (was: How t
Since nobody answered, I tried to come up with a solution on my own.
It seems that in Java there is no such thing as a 'raw' encoding, since everything will be represented as 16-bit Unicode characters internally. http://java.sun.com/javase/7/docs/api/java/nio/charset/CharsetDecoder.html If I supplied my own CharsetDecoder, maybe I could just ignore malformed input and unmappable characters and report success for any input of non-zero length. But I was looking for a solution that works with Saxon out of the box, not requiring users to install Java extension functions. Looking at what I was trying to achieve, that is: testing the sheer existence of a binary file, rather than reading its raw contents, I came up with the following solution: <sch:assert test="saxon:try( format-dateTime( saxon:last-modified( resolve-uri( @src, $base-uri ) ), '[Y]' ), false() )" id="ImageMissing"> Image <sch:value-of select="@src"/> must be present at its @src location. </sch:assert> This relies on the operating system reporting a last change date for the file in question, and of course on Saxon's built-in extension functions which will be an issue for Saxon HE users. Gerrit On 05.02.2010 10:21, Imsieke, Gerrit, le-tex wrote: Dear List Members,
Registergericht / Commercial Register: Amtsgericht Leipzig Registernummer / Registration Number: HRB 24930 Geschdftsf|hrer: Gerrit Imsieke, Svea Jelonek, Thomas Schmidt, Dr. Reinhard Vvckler
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|