I have 929 files with names like these: 01-Gen-001.xml 01-Gen-002.xml 01-Gen-003.xml 01-Gen-004.xml 01-Gen-005.xml 01-Gen-006.xml 01-Gen-007.xml 01-Gen-008.xml 01-Gen-009.xml 01-Gen-010.xml I would like to add them to a new database in the same order that I see if I do $ ls in that directory, without using XInclude to put them inside another node. Is there an easy way to do that? Jonathan
On Mon, 2022-02-21 at 16:28 -0500, Jonathan Robie wrote:
I have 929 files with names like these:
01-Gen-001.xml
I would like to add them to a new database in the same order that I see if I do $ ls in that directory,
Are you doing this from within XQuery? sort( file:list($dir)[matches(., '\.xml$')] ) ! db:add($db, doc(.), .) maybe? -- Liam Quin, 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: http://www.fromoldbooks.org
Perfect! Thank you! Jonathan On Mon, Feb 21, 2022 at 5:52 PM Liam R. E. Quin <liam@fromoldbooks.org> wrote:
On Mon, 2022-02-21 at 16:28 -0500, Jonathan Robie wrote:
I have 929 files with names like these:
01-Gen-001.xml
I would like to add them to a new database in the same order that I see if I do $ ls in that directory,
Are you doing this from within XQuery? sort( file:list($dir)[matches(., '\.xml$')] ) ! db:add($db, doc(.), .)
maybe?
-- Liam Quin, 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: http://www.fromoldbooks.org
participants (2)
-
Jonathan Robie -
Liam R. E. Quin