generate report from multiple "find" results
Issues related to W3C XQuery.
-
- Posts: 1
- Joined: Wed May 13, 2015 9:35 pm
generate report from multiple "find" results
I would like to run multiple "find" operations and create a single output from them. For example, I would like to:
- report the DOCTYPE
- report on specific attribute value found
- report on specific element found
- report on specific attribute found
- report on specific text string found in element
Normally, I write XSLT and can use the result-document output to write out results based on an XPath selector, but in this case, I want to run a process on hundreds of files and capture the document name and the results of the different "find" operations for each file. So I am wondering if XQuery would be a better way to go, but I don't have XQuery experience.
Also, I need to be able to run this process while ignoring the reference in the DOCTYPE to a DTD which may not be available.
Does anyone have some advice?
This may be a precursor for writing some Schematron, but first I want to know what the files contain and creating the report will give me some data to discuss with the person providing the files.
- report the DOCTYPE
- report on specific attribute value found
- report on specific element found
- report on specific attribute found
- report on specific text string found in element
Normally, I write XSLT and can use the result-document output to write out results based on an XPath selector, but in this case, I want to run a process on hundreds of files and capture the document name and the results of the different "find" operations for each file. So I am wondering if XQuery would be a better way to go, but I don't have XQuery experience.
Also, I need to be able to run this process while ignoring the reference in the DOCTYPE to a DTD which may not be available.
Does anyone have some advice?
This may be a precursor for writing some Schematron, but first I want to know what the files contain and creating the report will give me some data to discuss with the person providing the files.
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: generate report from multiple "find" results
Hi,
Please see some answers below:
Actually you can use the XSLT 2.0 collection function to iterate from an XSLT stylesheet an entire set of files located in a certain folder:
and them load them using the document function.
You can apply the XSLT on the first document in the folder because it will actually work on all documents from the folder.
Regards,
Radu
Please see some answers below:
Normally, I write XSLT and can use the result-document output to write out results based on an XPath selector, but in this case, I want to run a process on hundreds of files and capture the document name and the results of the different "find" operations for each file.
Actually you can use the XSLT 2.0 collection function to iterate from an XSLT stylesheet an entire set of files located in a certain folder:
Code: Select all
<xsl:variable name="files" select="collection('../foo/?select=*.xml')"/>
You can apply the XSLT on the first document in the folder because it will actually work on all documents from the folder.
The collection function should also be available in XQuery.So I am wondering if XQuery would be a better way to go, but I don't have XQuery experience.
This is not possible, at least with XSLT, XQuery or any XML-aware process. But you can create an XML catalog which maps the DTD location to an empty file. But if the XML documents contain entities defined in the DTD, the processing will break.Also, I need to be able to run this process while ignoring the reference in the DOCTYPE to a DTD which may not be available.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service