Is there any possibility to use a wildcard for the document()
function in XSLT like:
document("*.xml")
This is the same question: http://www.biglist.com/lists/xsl-list/archives/200108/msg00542.html
However this post is from 2001 so there might be any new techniques to solve this. Ideas?
Is there any possibility to use a wildcard for the
document()
function
No, there aren't any such changes to the behaviour of the document()
function.
However, XPath 2.0 (and that means available in XSLT 2.0) offers the standard function collection()
Its behavior is to some extent implementation dependent.
Example (based on Saxon 9):
This XPath expression:
collection('file:///c:/?select=report_*.xml')
selects the document nodes of every XML document that resides in c:\
in a file with name starting with report_
then having a 0 or more characters, then ending with .xml
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With