I am using named template and collection function of XSLT2.0 to feed a bunch of files for processing. These set of input files have the naming format like 'a.b.c.d' and have xml content, but neither with proper file extension like ".xml" nor contain xml declaration in the file content.
Thus the below error is thrown by Saxon XSLT processor
Type error XPTY0004: Required item type of result of call to collection is node(); supplied value has item type xs:base64Binary Required item type of result of call to collection is node(); supplied value has item type xs:base64Binary`
When I change the file name extension to ".xml" or include xml declaration <?xml version="1.0" ?> in the input files, there is no such error and the processing is fine.
Is there a way to force collection function to treat all the input files as xml files by default? The syntax of collection function doesn't seems to have an attribute to specify content type.