Project

Profile

Help

Bug #2168

closed

Setting parser features from the command line

Added by O'Neil Delpratt over 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Category:
Command Line
Sprint/Milestone:
Start date:
2014-10-07
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.6
Fix Committed on Branch:
9.6
Fixed in Maintenance Release:
Platforms:

Description

In principle it should be possible to set the parser features and parser properties from the command line.

In the Saxon 9.6 release documentation the XML_PARSER_FEATURE and XML_PARSER-PROPERTY are features, see:

http://www.saxonica.com/documentation/index.html#!configuration/config-features

It should work as follows:

java -cp saxon9he.jar net.sf.saxon.Transform -expand:off --parserFeature?uri=http://xml.org/sax/features/external-parameter-entities:true

However, the above command fails dues to the colon in the URL. i.e.:

Transformation failed: http://saxon.sf.net/feature/parserFeature?uri=http must be 'true' or 'false' (or on|off, yes|no, 1|0)

Programatically it works in the API, but in the code for the command line we need to fix it to only look for the last colon when switching on or off the parser option.

Actions #1

Updated by O'Neil Delpratt over 9 years ago

  • Description updated (diff)
Actions #2

Updated by Michael Kay over 9 years ago

Also, I guess we should find a way to set this in the configuration file, then you could use the -config option in the command line.

Actions #3

Updated by O'Neil Delpratt over 9 years ago

  • Status changed from New to Resolved

Bug fixed and committed to svn for both 9.6 and 9.7 branch:

Suggested solution: To allow the URI that follows ?uri= to be %HH encoded, that is allow the colon to be written as %3A. Change applied in the Configuration class to decode the URI.

Example:

-xsl:main.xsl -s:dummy.xml --generateByteCode:off -sa --parserFeature?uri=http%3A//xml.org/sax/features/external-parameter-entities:true
Actions #4

Updated by O'Neil Delpratt over 9 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in version set to 9.6.0.2

Bug fix applied to the maintenance release Saxon 9.6.0.2

Actions #5

Updated by O'Neil Delpratt over 8 years ago

  • Sprint/Milestone set to 9.6.0.2
  • Applies to branch 9.6 added
  • Fix Committed on Branch 9.6 added
  • Fixed in Maintenance Release 9.6.0.2 added

Please register to edit this issue

Also available in: Atom PDF