xml - xslt sum values in multiple documents -
i tried using document function process multiple .xml-documents
sum(document(/folder/folders/*)//element)
the folders have varying names, path has dynamic(i used * in actual .xsl), document function not work multiple folders different names, ?
as did not work, looking solution , stumbled on collection function, can used saxon.
<value-of select="sum((collection('/folder/folders?select=*.xml;recurse=yes')//element)"
(recursive="yes" set collection go through subfolders)
but not seem work correctly. not find documentation of function, either.
is there a documentation of function or provide me ?
thank in advance.
the documentation of saxon's 9.5 collection
function http://www.saxonica.com/documentation/html/sourcedocs/collections.html , http://www.saxonica.com/documentation/index.html#!functions/fn/collection. might want try complete file url adapted file system work e.g. collection('file:///c:/folder/folders?select=*.xml;recurse=yes')
. if still have problems explain directory structure have.
the document
function not operate on urls, takes nodes sum(document(/folder/folders/*)//element)
work need have input document
<folder> <folders> <foo>file1.xml</foo> <bar>file2.xml</bar> </folders> </folder>
where file1.xml
, file2.xml
need contain element
elements numeric values want sum.
Comments
Post a Comment