Examples of XSModel


Examples of org.apache.xerces.xs.XSModel

   public void generateJavaSource(String schemaFile, File dirloc, String packageName,
                           boolean createPackageDir)
      throws IOException
   {
      XSLoader xsloader = SchemaUtils.getInstance().getXSLoader();
      XSModel xsmodel = xsloader.loadURI(schemaFile);
      generateJavaSource(xsmodel, dirloc, packageName, createPackageDir);
   }
View Full Code Here

Examples of org.apache.xerces.xs.XSModel

            XSImplementation implementation = (XSImplementation) registry.getDOMImplementation("XS-Loader");
            XSLoader loader = implementation.createXSLoader(null);

            // Load the XML Schema
            String uri = file.toURI().toString();
            XSModel xsModel = loader.loadURI(uri);

            // Convert top level complex type definitions to node types
            XSNamedMap map = xsModel.getComponents(XSConstants.TYPE_DEFINITION);
            for (int i = 0; i < map.getLength(); i++) {
                XSTypeDefinition tDef = (XSTypeDefinition) map.item(i);
                checkAndConvert(tDef, null, null);
            }
            //  Convert local (anonymous) complex type defs found in top level element declarations
            map = xsModel.getComponents(XSConstants.ELEMENT_DECLARATION);
            for (int i = 0; i < map.getLength(); i++) {
                XSElementDeclaration eDec = (XSElementDeclaration) map.item(i);

                XSTypeDefinition tDef = eDec.getTypeDefinition();
                checkAndConvert(tDef, eDec.getNamespace(), eDec.getName());
View Full Code Here

Examples of org.apache.xerces.xs.XSModel

            public int getLength() {
                return uris.length;
            }
        };

        XSModel xsm = schemaLoader.loadInputList(list);
        return new SchemaModelImpl(xsm);
    }
View Full Code Here

Examples of org.apache.xerces.xs.XSModel

        schemaLoader.setFeature("http://apache.org/xml/features/honour-all-schemaLocations", true);

        LoggingXmlErrorHandler eh = new LoggingXmlErrorHandler(__log);
        schemaLoader.setErrorHandler(eh);

        XSModel model = schemaLoader.load(input);

        // The following mess is due to XMLSchemaLoaders funkyness in error
        // reporting: sometimes it throws an exception, sometime it returns
        // null, sometimes it just prints bs to the screen.
        if (model == null) {
View Full Code Here

Examples of org.apache.xerces.xs.XSModel

            // 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("*************************************************");
          System.out.println("* Global element declarations: {namespace} name ");
          System.out.println("*************************************************");
                    for (int i = 0; i < map.getLength(); i++) {
                        XSObject item = map.item(i);
                        System.out.println("{" + item.getNamespace() + "}" + item.getName());
                    }
                }
                // attribute declarations
                map = model.getComponents(XSConstants.ATTRIBUTE_DECLARATION);
                if (map.getLength() != 0) {
          System.out.println("*************************************************");
                    System.out.println("* Global attribute declarations: {namespace} name");
          System.out.println("*************************************************");
                    for (int i = 0; i < map.getLength(); i++) {
                        XSObject item = map.item(i);
                        System.out.println("{" + item.getNamespace() + "}" + item.getName());
                    }
                }
        // notation declarations
        map = model.getComponents(XSConstants.TYPE_DEFINITION);
        if (map.getLength() != 0) {
          System.out.println("*************************************************");
          System.out.println("* Global type declarations: {namespace} name");
          System.out.println("*************************************************");
          for (int i = 0; i < map.getLength(); i++) {
            XSObject item = map.item(i);
            System.out.println("{" + item.getNamespace() + "}" + item.getName());
          }
        }
               
        // notation declarations
        map = model.getComponents(XSConstants.NOTATION_DECLARATION);
        if (map.getLength() != 0) {
          System.out.println("*************************************************");
          System.out.println("* Global notation declarations: {namespace} name");
          System.out.println("*************************************************");
          for (int i = 0; i < map.getLength(); i++) {
View Full Code Here

Examples of org.apache.xerces.xs.XSModel

            // 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("*************************************************");
          System.out.println("* Global element declarations: {namespace} name ");
          System.out.println("*************************************************");
                    for (int i = 0; i < map.getLength(); i++) {
                        XSObject item = map.item(i);
                        System.out.println("{" + item.getNamespace() + "}" + item.getName());
                    }
                }
                // attribute declarations
                map = model.getComponents(XSConstants.ATTRIBUTE_DECLARATION);
                if (map.getLength() != 0) {
          System.out.println("*************************************************");
                    System.out.println("* Global attribute declarations: {namespace} name");
          System.out.println("*************************************************");
                    for (int i = 0; i < map.getLength(); i++) {
                        XSObject item = map.item(i);
                        System.out.println("{" + item.getNamespace() + "}" + item.getName());
                    }
                }
        // notation declarations
        map = model.getComponents(XSConstants.TYPE_DEFINITION);
        if (map.getLength() != 0) {
          System.out.println("*************************************************");
          System.out.println("* Global type declarations: {namespace} name");
          System.out.println("*************************************************");
          for (int i = 0; i < map.getLength(); i++) {
            XSObject item = map.item(i);
            System.out.println("{" + item.getNamespace() + "}" + item.getName());
          }
        }
               
        // notation declarations
        map = model.getComponents(XSConstants.NOTATION_DECLARATION);
        if (map.getLength() != 0) {
          System.out.println("*************************************************");
          System.out.println("* Global notation declarations: {namespace} name");
          System.out.println("*************************************************");
          for (int i = 0; i < map.getLength(); i++) {
View Full Code Here

Examples of org.apache.xerces.xs.XSModel

    }

    private void processPSVISchemaInformation(ElementPSVI elemPSVI) {
        if (elemPSVI == null)
            return;
        XSModel schemaInfo = elemPSVI.getSchemaInformation();
        XSNamespaceItemList schemaNamespaces =
            schemaInfo == null ? null : schemaInfo.getNamespaceItems();
        if (schemaNamespaces == null || schemaNamespaces.getLength() == 0) {
            sendElementEvent("psv:schemaInformation");
        }
        else {
            sendIndentedElement("psv:schemaInformation");
View Full Code Here

Examples of org.apache.xerces.xs.XSModel

    }

    private void processPSVISchemaInformation(ElementPSVI elemPSVI) {
        if (elemPSVI == null)
            return;
        XSModel schemaInfo = elemPSVI.getSchemaInformation();
        XSNamespaceItemList schemaNamespaces =
            schemaInfo == null ? null : schemaInfo.getNamespaceItems();
        if (schemaNamespaces == null || schemaNamespaces.getLength() == 0) {
            sendElementEvent("psv:schemaInformation");
        }
        else {
            sendIndentedElement("psv:schemaInformation");
View Full Code Here

Examples of org.apache.xerces.xs.XSModel

            // 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("*************************************************");
          System.out.println("* Global element declarations: {namespace} name ");
          System.out.println("*************************************************");
                    for (int i = 0; i < map.getLength(); i++) {
                        XSObject item = map.item(i);
                        System.out.println("{" + item.getNamespace() + "}" + item.getName());
                    }
                }
                // attribute declarations
                map = model.getComponents(XSConstants.ATTRIBUTE_DECLARATION);
                if (map.getLength() != 0) {
          System.out.println("*************************************************");
                    System.out.println("* Global attribute declarations: {namespace} name");
          System.out.println("*************************************************");
                    for (int i = 0; i < map.getLength(); i++) {
                        XSObject item = map.item(i);
                        System.out.println("{" + item.getNamespace() + "}" + item.getName());
                    }
                }
        // notation declarations
        map = model.getComponents(XSConstants.TYPE_DEFINITION);
        if (map.getLength() != 0) {
          System.out.println("*************************************************");
          System.out.println("* Global type declarations: {namespace} name");
          System.out.println("*************************************************");
          for (int i = 0; i < map.getLength(); i++) {
            XSObject item = map.item(i);
            System.out.println("{" + item.getNamespace() + "}" + item.getName());
          }
        }
               
        // notation declarations
        map = model.getComponents(XSConstants.NOTATION_DECLARATION);
        if (map.getLength() != 0) {
          System.out.println("*************************************************");
          System.out.println("* Global notation declarations: {namespace} name");
          System.out.println("*************************************************");
          for (int i = 0; i < map.getLength(); i++) {
View Full Code Here

Examples of org.apache.xerces.xs.XSModel

            // 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("*************************************************");
          System.out.println("* Global element declarations: {namespace} name ");
          System.out.println("*************************************************");
                    for (int i = 0; i < map.getLength(); i++) {
                        XSObject item = map.item(i);
                        System.out.println("{" + item.getNamespace() + "}" + item.getName());
                    }
                }
                // attribute declarations
                map = model.getComponents(XSConstants.ATTRIBUTE_DECLARATION);
                if (map.getLength() != 0) {
          System.out.println("*************************************************");
                    System.out.println("* Global attribute declarations: {namespace} name");
          System.out.println("*************************************************");
                    for (int i = 0; i < map.getLength(); i++) {
                        XSObject item = map.item(i);
                        System.out.println("{" + item.getNamespace() + "}" + item.getName());
                    }
                }
        // notation declarations
        map = model.getComponents(XSConstants.TYPE_DEFINITION);
        if (map.getLength() != 0) {
          System.out.println("*************************************************");
          System.out.println("* Global type declarations: {namespace} name");
          System.out.println("*************************************************");
          for (int i = 0; i < map.getLength(); i++) {
            XSObject item = map.item(i);
            System.out.println("{" + item.getNamespace() + "}" + item.getName());
          }
        }
               
        // notation declarations
        map = model.getComponents(XSConstants.NOTATION_DECLARATION);
        if (map.getLength() != 0) {
          System.out.println("*************************************************");
          System.out.println("* Global notation declarations: {namespace} name");
          System.out.println("*************************************************");
          for (int i = 0; i < map.getLength(); i++) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.