sandbox/src/net/sf/xframe/xs XSModelTest.java,NONE,1.1

Kurt Riede <[email protected]> Mon, 21 Mar 2005 18:13:37 +0000
Newsgroups gmane.text.xml.xframe.xsddoc.devel
Message-ID <[email protected]>
Update of /cvsroot/xframe/sandbox/src/net/sf/xframe/xs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27005/src/net/sf/xframe/xs

Added Files:
	XSModelTest.java 
Log Message:
initial upload of classes for working with XSModel classes of Apache XercesJ 2.6.2

--- NEW FILE: XSModelTest.java ---
/*
This file is part of the xframe software package
hosted at http://xframe.sourceforge.net

Copyright (c) 2003 Kurt Riede.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library 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
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package net.sf.xframe.xs;

import net.sf.xframe.sax.SimpleSAXWriter;
import net.sf.xframe.xs.parser.XSModelParser;

import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;

/**
 * grammar reader test.
 * @author <a href="mailto:[email protected]">Kurt Riede </a>
 */
public final class XSModelTest {

    /** Private default constructor to prevent instantiation. */
    private XSModelTest() {
    }

    /**
     * Main program entry point.
     * @param argv command line arguments
     * @throws Exception if anything failed
     */
    public static void main(final String[] argv) throws Exception {
        if (argv.length != 1) {
            System.out.println("usage:");
            System.out.println("XSModelUtil <schema-file-name.xsd>");
            return;
        }
        final String parserName = "net.sf.xframe.xs.parser.XSModelParser";
        final XMLReader parser = XMLReaderFactory.createXMLReader(parserName);
        parser.setFeature(XSModelParser.INCLUDE_SCHEMA_DATATYPES, true);
        final SimpleSAXWriter writer = new SimpleSAXWriter(System.out, "ISO-8859-1");
        parser.setContentHandler(writer);
        parser.setProperty("http://xml.org/sax/properties/lexical-handler", writer);
//      parser.setFeature(XSModelParser.NAMESPACES_ONLY, true);
//      parser.setFeature(XSModelParser.COMPONENTS_ONLY, true);
        writer.setCanonical(false);
        parser.parse(argv[0]);
    }
}



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click