xpath 2.0 collection function
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 20
- Joined: Tue May 23, 2006 11:10 pm
xpath 2.0 collection function
I'm trying to run an xpath expression over several files with public identifiers. I have a catalog file for resolving my PIs, but Oxygen apparently doesn't reference it when executing xpath. Is that right? Do I need to change to system IDs
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello,
In <oXygen/> you can run XSLT 2.0 stylesheets with the Saxon 8 processor (the basic version or the schema aware one). If the URI specified as parameter is the path to a file called the collection catalog the function returns a sequence of nodes corresponding to the documents mapped by the catalog file which for Saxon must have the following structure:
the href values are relative to the location of the catalog file. Also the URI can point to a directory instead of a catalog file and can have parameters which specify how to match the files to be included in the collection, for example select (for a file pattern), recurse (recurse subdirectories), etc:
If the collection function does not contain the expected documents make sure the paths are specified correctly in the catalog file or the match arguments (select, recurse) correspond to the expected collection.
Regards,
Sorin
In <oXygen/> you can run XSLT 2.0 stylesheets with the Saxon 8 processor (the basic version or the schema aware one). If the URI specified as parameter is the path to a file called the collection catalog the function returns a sequence of nodes corresponding to the documents mapped by the catalog file which for Saxon must have the following structure:
Code: Select all
<collection>
<doc href="doc1.xml"/>
<doc href="doc2.xml"/>
<doc href="doc3.xml"/>
</collection>
Code: Select all
<xsl:for-each select="collection(concat($pathToXMLDirectory,
'?select=*.xml;recurse=yes;on-error=warn'))">
...
</xsl:for-each>
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
The implementation of the collection function is processor dependent. The Saxon 8 implementation requires a catalog with the specified format.
Regards,
Sorin
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello,
Is the XML document on which the XPath expression is applied valid ? You can check this with the Validate Document action. If you want to resolve a public ID or system ID with an XML catalog create and add the catalog in Preferences and check that the catalog entries are correct by validating the document. After that an XSLT stylesheet which calls collection(URIofCollectionCatalogFile) will resolve the public ID/system ID of documents contained in the collection correctly using the XML catalog. Starting with version 7.2 the XML catalogs configured in Preferences will be used also for solving public IDs/system IDs when the collection() function is used in the XPath toolbar and XPath Builder view.
Regards,
Sorin
Is the XML document on which the XPath expression is applied valid ? You can check this with the Validate Document action. If you want to resolve a public ID or system ID with an XML catalog create and add the catalog in Preferences and check that the catalog entries are correct by validating the document. After that an XSLT stylesheet which calls collection(URIofCollectionCatalogFile) will resolve the public ID/system ID of documents contained in the collection correctly using the XML catalog. Starting with version 7.2 the XML catalogs configured in Preferences will be used also for solving public IDs/system IDs when the collection() function is used in the XPath toolbar and XPath Builder view.
Regards,
Sorin
-
- Posts: 20
- Joined: Tue May 23, 2006 11:10 pm
>> Is the XML document on which the XPath expression is applied valid ?
Yes.
>> If you want to resolve a public ID or system ID with an XML catalog >>create >>and add the catalog in Preferences and check that the catalog entries are correct >>by validating the document.
Already did that.
>>After that an XSLT stylesheet which calls collection(URIofCollectionCatalogFile) will >>resolve the public ID/system ID of documents contained in the collection correctly >>using the XML catalog. Starting with version 7.2 the XML catalogs configured in >>Preferences will be used also for solving public IDs/system IDs when the collection() >>function is used in the XPath toolbar and >>XPath Builder view.
But it doesn't. That's my point. This must be a bug.
Yes.
>> If you want to resolve a public ID or system ID with an XML catalog >>create >>and add the catalog in Preferences and check that the catalog entries are correct >>by validating the document.
Already did that.
>>After that an XSLT stylesheet which calls collection(URIofCollectionCatalogFile) will >>resolve the public ID/system ID of documents contained in the collection correctly >>using the XML catalog. Starting with version 7.2 the XML catalogs configured in >>Preferences will be used also for solving public IDs/system IDs when the collection() >>function is used in the XPath toolbar and >>XPath Builder view.
But it doesn't. That's my point. This must be a bug.
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello,
I am not sure what does not work on your computer. Does an XSLT 2.0 transformation in which the collection() function is called not work ? I tested it with an XSLT stylesheet in the latest <oXygen/> release (version 7.1) and it works correctly. I expect it works also in previous versions. Please send us small sample files to support at oxygenxml dot com for the XSLT stylesheet, the input XML source, the collection catalog, the XML catalog used to resolve the public ID and the documents which should be returned by the collection() call.
Does an XPath 2.0 query containing a call to collection() and executed in the XPath toolbar / XPath Builder view not use the XML catalog to resolve a public ID in a document returned by collection() ? We just fixed that and it will be available in the version 7.2.
Regards,
Sorin
I am not sure what does not work on your computer. Does an XSLT 2.0 transformation in which the collection() function is called not work ? I tested it with an XSLT stylesheet in the latest <oXygen/> release (version 7.1) and it works correctly. I expect it works also in previous versions. Please send us small sample files to support at oxygenxml dot com for the XSLT stylesheet, the input XML source, the collection catalog, the XML catalog used to resolve the public ID and the documents which should be returned by the collection() call.
Does an XPath 2.0 query containing a call to collection() and executed in the XPath toolbar / XPath Builder view not use the XML catalog to resolve a public ID in a document returned by collection() ? We just fixed that and it will be available in the version 7.2.
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
As I said send the sample files to support at oxygenxml dot com.
Regards,
Sorin
Regards,
Sorin
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