Subject: Re: [xsl] Checking if a file exists From: "dvint dvint@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Thu, 18 Apr 2024 22:58:14 -0000 |
I'm trying to stop the result-document() from writing to the file more than once. I had moved from the file:exist() because I need to use the saxon-pe to use it, but oxygen ant transformation only allows the use of the HE edition.So am I right in thinking there may be ae sequencing/file writing issue here and the error is triggered because the file hasn't been written yet, but the result-document knows it is in memory?Sent from my Verizon, Samsung Galaxy smartphone -------- Original message --------From: "Liam R. E. Quin liam@xxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: 4/18/24 3:38 PM (GMT-08:00) To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] 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 trueif the document could be read successfully with doc() (and of course todettermine this, the XSLT processor effectively does a doc() behind thescenes, and then probably has to keep it in memory in case it changedexternally).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 sameXSLT 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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Checking if a file exists, Liam R. E. Quin liam | Thread | Re: [xsl] Checking if a file exists, David Carlisle d.p.c |
Re: [xsl] Checking if a file exists, Liam R. E. Quin liam | Date | Re: [xsl] Checking if a file exists, David Carlisle d.p.c |
Month |