//
/** Main program entry point. */
public static void main(String argv[]) {
Arguments argopt = new Arguments();
argopt.setUsage( new String[]
{ "usage: java dom.DOMFilter (options) uri ...","",
"options:",
" -p name Specify DOM parser wrapper by name.",
" -e name Specify element name to search for. Default is \"*\".",
" -a name Specify attribute name of specified elements.",
" -p name Specify DOM parser wrapper by name.",
" -n | -N Turn on/off namespace [default=on]",
" -v | -V Turn on/off validation [default=on]",
" -s | -S Turn on/off Schema support [default=on]",
" -f | -F Turn on/off Schema full consraint checking [default=off]",
" -d | -D Turn on/off deferred DOM [default=on]",
" -h This help screen."} );
// is there anything to do?
if (argv.length == 0) {
argopt.printUsage();
System.exit(1);
}
// vars
String parserName = DEFAULT_PARSER_NAME;
String elementName = "*"; // all elements
String attributeName = null;
/////
argopt.parseArgumentTokens(argv , new char[] { 'p', 'e', 'a'} );
int c;
String arg = null;
while ( ( arg = argopt.getlistFiles() ) != null ) {
outer:
while ( (c = argopt.getArguments()) != -1 ){
switch (c) {
case 'v':
setValidation = true;
break;
case 'V':
setValidation = false;
break;
case 'N':
setNameSpaces = false;
break;
case 'n':
setNameSpaces = true;
break;
case 'p':
parserName = argopt.getStringParameter();
break;
case 'd':
setDeferredDOM = true;
break;
case 'D':
setDeferredDOM = false;
break;
case 's':
setSchemaSupport = true;
break;
case 'S':
setSchemaSupport = false;
break;
case 'e':
elementName = argopt.getStringParameter();
break;
case 'a':
attributeName = argopt.getStringParameter();
break;
case 'f':
setSchemaFullSupport = true;
break;
case 'F':
setSchemaFullSupport = false;
break;
case '?':
case 'h':
case '-':
argopt.printUsage();
System.exit(1);
break;
case -1:
break outer;
default: