# HG changeset patch # User František Kučera # Date 1410980816 -7200 # Node ID b50e77d23d13c72f0c4f739542bde4d038ad3737 # Parent fadfde5b3e5561848bea128ff3ea9e0768f262ae cli: utility option --reader-namespace-aware (shortcut for "http://xml.org/sax/features/namespaces" feature) diff -r fadfde5b3e55 -r b50e77d23d13 java/alt2xml-cli/src/cz/frantovo/alt2xml/cli/CLIParser.java --- a/java/alt2xml-cli/src/cz/frantovo/alt2xml/cli/CLIParser.java Wed Sep 17 21:00:32 2014 +0200 +++ b/java/alt2xml-cli/src/cz/frantovo/alt2xml/cli/CLIParser.java Wed Sep 17 21:06:56 2014 +0200 @@ -110,6 +110,15 @@ return index - originalIndex; } }, + READER_NAMESPACE_AWARE("--reader-namespace-aware") { + @Override + public int parse(String[] args, int index, CLIOptions options) throws CLIParserException { + int originalIndex = index; + String value = fetchNext(args, ++index); + options.addReaderFeature(Constants.SAX_PARSER_NAMESPACE_AWARE, Boolean.valueOf(value)); + return index - originalIndex; + } + }, ACTION("--action") { @Override public int parse(String[] args, int index, CLIOptions options) throws CLIParserException { diff -r fadfde5b3e55 -r b50e77d23d13 java/alt2xml-cli/src/cz/frantovo/alt2xml/cli/Constants.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/alt2xml-cli/src/cz/frantovo/alt2xml/cli/Constants.java Wed Sep 17 21:06:56 2014 +0200 @@ -0,0 +1,32 @@ +/** + * Alt2XML + * Copyright © 2014 František Kučera (frantovo.cz) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package cz.frantovo.alt2xml.cli; + +/** + * Common constants + * + * @author Ing. František Kučera (frantovo.cz) + */ +public class Constants { + + public static final String SAX_PARSER_NAMESPACE_AWARE = "http://xml.org/sax/features/namespaces"; + + private Constants() { + } + +}