[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Checking if a file exists
On Thu, 2024-04-18 at 22:28 +0000, dvint@xxxxxxxxx wrote: > I need to take a list of XML files and rename them based upon values > provided by the writer. I know that my list has duplicate name tokens > for different files in the list. I do get duplicate names when > generated. > > I'm trying to trap this situation and handle this while creating the > files, I have a template with this: > > ... > > '<xsl:value-of select="$newFile"/>' found '<xsl:value-of > select="doc-available($newFile)"/>' doc-available is not the same as file:exists() - it will only be true if the document could be read successfully with doc() (and of course to dettermine this, the XSLT processor effectively does a doc() behind the scenes, and then probably has to keep it in memory in case it changed externally). Also make sure your XSLT didn't create the document using result- document... You can't write to the same URI more than once in the same XSLT run. Without seeing the exact error message it's hard to be sure. liam -- Liam Quin,B https://www.delightfulcomputing.com/ Available for XML/Document/Information Architecture/XSLT/ XSL/XQuery/Web/Text Processing/A11Y training, work & consulting. Barefoot Web-slave, antique illustrations: B http://www.fromoldbooks.org
|
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
|