Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSLoader


    /* (non-Javadoc)
     * @see org.apache.xerces.xs.XSImplementation#createXSLoader(org.apache.xerces.xs.StringList)
     */
    public XSLoader createXSLoader(StringList versions) throws XSException {
      XSLoader loader = new XSLoaderImpl();
      if (versions == null){
      return loader;
      }
      for (int i=0; i<versions.getLength();i++){
        if (!versions.item(i).equals("1.0")){
View Full Code Here


                "org.apache.xerces.dom.DOMXSImplementationSourceImpl");
            DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();

            XSImplementation impl = (XSImplementation) registry.getDOMImplementation("XS-Loader");

            XSLoader schemaLoader = impl.createXSLoader(null);

            DOMConfiguration config = schemaLoader.getConfig();

            // create Error Handler
            DOMErrorHandler errorHandler = new QueryXS();

            // set error handler
            config.setParameter("error-handler", errorHandler);

            // set validation feature
            config.setParameter("validate", Boolean.TRUE);

            // parse document
            System.out.println("Parsing " + argv[0] + "...");
            XSModel model = schemaLoader.loadURI(argv[0]);
            if (model != null) {
              // element declarations
                XSNamedMap map = model.getComponents(XSConstants.ELEMENT_DECLARATION);
                if (map.getLength() != 0) {
          System.out.println("*************************************************");
 
View Full Code Here

   private static XSModel loadSchema(String xsdURL)
   {
      log.debug("loading xsd: " + xsdURL);

      XSImplementation impl = getXSImplementation();
      XSLoader schemaLoader = impl.createXSLoader(null);
      XSModel model = schemaLoader.loadURI(xsdURL);
      if(model == null)
      {
         throw new IllegalArgumentException("Invalid URI for schema: " + xsdURL);
      }
View Full Code Here

   {
      log.debug("loading xsd from InputStream");
      LSInputAdaptor input = new LSInputAdaptor(is, encoding, baseURI);

      XSImplementation impl = getXSImplementation();
      XSLoader schemaLoader = impl.createXSLoader(null);
      XSModel model = schemaLoader.load(input);
      return model;
   }
View Full Code Here

   {
      log.debug("loading xsd from Reader");
      LSInputAdaptor input = new LSInputAdaptor(reader, encoding, baseURI);

      XSImplementation impl = getXSImplementation();
      XSLoader schemaLoader = impl.createXSLoader(null);
      XSModel model = schemaLoader.load(input);
      return model;
   }
View Full Code Here

   {
      log.debug("loading xsd from string");
      LSInputAdaptor input = new LSInputAdaptor(data, encoding);

      XSImplementation impl = getXSImplementation();
      XSLoader schemaLoader = impl.createXSLoader(null);
      XSModel model = schemaLoader.load(input);
      return model;
   }
View Full Code Here

   }

   public static XSModel loadSchema(String xsdURL)
   {
      XSImplementation impl = getXSImplementation();
      XSLoader schemaLoader = impl.createXSLoader(null);
      XSModel model = schemaLoader.loadURI(xsdURL);
      if(model == null)
      {
         throw new IllegalArgumentException("Invalid URI for schema: " + xsdURL);
      }
View Full Code Here

   }

   public static XSModel loadSchema(final Reader xsdReader)
   {
      XSImplementation impl = getXSImplementation();
      XSLoader schemaLoader = impl.createXSLoader(null);

      XSModel model = schemaLoader.load(new LSInput()
      {
         public Reader getCharacterStream()
         {
            return xsdReader;
         }
View Full Code Here

   // Private

   private static XSModel loadSchema(String xsdURL)
   {
      XSImplementation impl = getXSImplementation();
      XSLoader schemaLoader = impl.createXSLoader(null);
      XSModel model = schemaLoader.loadURI(xsdURL);
      if(model == null)
      {
         throw new IllegalArgumentException("Invalid URI for schema: " + xsdURL);
      }
View Full Code Here

   }

   private XSModel loadSchema(String xsdURL)
   {
      XSImplementation impl = getXSImplementation();
      XSLoader schemaLoader = impl.createXSLoader(null);
      XSModel model = schemaLoader.loadURI(xsdURL);
      if (model == null)
      {
         throw new IllegalArgumentException("Invalid URI for schema: " + xsdURL);
      }
View Full Code Here

TOP

Related Classes of org.apache.xerces.xs.XSLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.