qiuwei / jing-trang

Automatically exported from code.google.com/p/jing-trang
Other
1 stars 1 forks source link

add new command-line option to jing for specifying alternative parser for document instances #120

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I propose that an option be added to Jing that allows users to easily specify, 
from the command line, the class name of an alternate parser for parsing the 
document instances/source files they wish to validate.

For example, users who wish to use Jing to validate HTML5 document instances 
could use this option to specify a "nu.validator.htmlparser.SAXParserFactory" 
class from the validator.nu HTML parser, to use in place of whatever parser 
Jing would otherwise use by default for parsing document instances.

Note that this parser option would not affect parsing of the schema against 
which the document instances are validated (a separate option could be provided 
for that as well, if we were to decide it'd be useful to have one).

The Saxon XSLT processor has a "-x" command-line option for specifying an 
alternate document-instance parser, as I've described above (as well as a "-y" 
option for specifying an alternate schema parser).

http://www.saxonica.com/documentation/using-xsl/commandline.html

Here from the Saxon docs is the description of the "-x" option:

[[
Use specified SAX parser for source file and any files loaded using the 
document() function. The parser must be the fully-qualified class name of a 
Java class that implements the org.xml.sax.Parser or org.xml.sax.XMLReader 
interface
]]

Original issue reported on code.google.com by sideshowbarker on 24 Aug 2010 at 1:36

GoogleCodeExporter commented 8 years ago
correction: of course in the case of Saxon, the "-y" option I mentioned is for 
specifying an alternate *stylesheet* parser (not a schema parser). (But the 
equivalent in the context of Jing would be an option for specifying a parser 
for the schema.)

Original comment by sideshowbarker on 24 Aug 2010 at 1:44