Jeffrey C. Witt
2017-07-13 13:54:29 UTC
I'm trying to us xmld:collection-available() to check if collection exists.
If the collection doesn't exist I hope to then create the collection before
saving the new file.
But when running xmld:collection for a non-existent collection I get the
following error:
ERROR Could not locate collection:
/db/apps/scta-data/lombardsententia/pl-l2d17c4/
I don't quite understand this error, since my expectation was that this
function would be checking to see if the collections exists. If it doesn't
exists, it should return false rather than return an error.
Any help is much appreciated. Below is the relevant block of code.
if (xmldb:collection-available($new-save-path)) then(
<p>{$file?status}: {xmldb:store($new-save-path, $new-file-name,
$new-content)}</p>
)
else(
<div>
<p>{xmldb:create-collection("/db/apps/scta-data/" ||
$top_level_collection, $new-save-path)}</p>
<p>{$file?status}: {xmldb:store($new-save-path, $new-file-name,
$new-content)}</p>
</div>
)
If the collection doesn't exist I hope to then create the collection before
saving the new file.
But when running xmld:collection for a non-existent collection I get the
following error:
ERROR Could not locate collection:
/db/apps/scta-data/lombardsententia/pl-l2d17c4/
I don't quite understand this error, since my expectation was that this
function would be checking to see if the collections exists. If it doesn't
exists, it should return false rather than return an error.
Any help is much appreciated. Below is the relevant block of code.
if (xmldb:collection-available($new-save-path)) then(
<p>{$file?status}: {xmldb:store($new-save-path, $new-file-name,
$new-content)}</p>
)
else(
<div>
<p>{xmldb:create-collection("/db/apps/scta-data/" ||
$top_level_collection, $new-save-path)}</p>
<p>{$file?status}: {xmldb:store($new-save-path, $new-file-name,
$new-content)}</p>
</div>
)
--
Dr. Jeffrey C. Witt
Philosophy Department
Loyola University Maryland
4501 N. Charles St.
Baltimore, MD 21210
www.jeffreycwitt.com
Dr. Jeffrey C. Witt
Philosophy Department
Loyola University Maryland
4501 N. Charles St.
Baltimore, MD 21210
www.jeffreycwitt.com