Project

Profile

Help

Bug #5618

closed

Inconsistency in the documentation for the -xi command line option (does it apply to stylesheets and schemas?)

Added by Martin Honnen over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
Documentation
Sprint/Milestone:
-
Start date:
2022-07-28
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
11, trunk
Fix Committed on Branch:
11, trunk
Fixed in Maintenance Release:
Platforms:
Java

Description

https://www.saxonica.com/html/documentation11/using-xsl/commandline/ says about -xi:on:

Apply XInclude processing to all source XML documents (but not to schema and stylesheet modules)

https://www.saxonica.com/html/documentation11/sourcedocs/beyond-parsing/XInclude.html, however says:

The -xi option on the command line causes XInclude processing to be applied to all input XML documents. This includes source documents, stylesheets, and schema documents

Actions #1

Updated by Michael Kay over 1 year ago

Setting -xi:on in the command line is equivalent to setting Feature.XINCLUDE to true, which in turn sets the relevant flag in Configuration.defaultParseOptions.

The default parse options are certainly used by Configuration.buildSchemaDocument(), which I would think covers most ways of compiling a schema.

For stylesheets, in the normal path (no -y or -u options), the Transform command creates a StreamSource for the stylesheet and it's likely to find its way to StylesheetModule.loadStylesheet(), which calls StylesheetModule.makeStylesheetParseOptions(), which appears to make to reference to the default parse options in the Configuration.

So the first impression from the code is that on most paths, the Include option will apply to schema documents, but not to stylesheet documents. But I haven't checked the paths for included/imported modules in either case...

Actions #2

Updated by Michael Kay over 1 year ago

I confirmed by testing that -xi on the Transform command line does not cause XInclude elements to be expanded if they appear either in a primary or secondary stylesheet module (they are typically treated as literal result elements).

Further testing shows that -xi on the Validate command line DOES cause XInclude elements to be expanded in both the primary and secondary schema documents.

So, do we fix the code or the documentation?

Actions #3

Updated by Michael Kay over 1 year ago

I'm inclined to fix the documentation.

For stylesheets, there are legitimate reasons for treating <xi:include> elements as literal result elements, to be copied into the result tree.

For schemas, an <xi:include> element in a schema document makes no sense (except perhaps within xs:documentation) unless it is to be expanded during processing.

Actions #4

Updated by Michael Kay over 1 year ago

  • Status changed from New to Resolved
  • Applies to branch trunk added
  • Fix Committed on Branch 11, trunk added
  • Platforms Java added

Documentation fixes committed.

Actions #5

Updated by Debbie Lockett over 1 year ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100

Documentation 11 updated online.

Please register to edit this issue

Also available in: Atom PDF