Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSModel


         "      </xsd:extension>" +
         "    </xsd:complexContent>" +
         "  </xsd:complexType>" +
         "</xsd:schema>";

      XSModel model = Util.loadSchema(xsd, (String)null);

      XSComplexTypeDefinition type = (XSComplexTypeDefinition)model.getTypeDefinition("valueType", "");
      XSModelGroup modelGroup = (XSModelGroup)type.getParticle().getTerm();
      assertNull(modelGroup.getAnnotation());

      type = (XSComplexTypeDefinition)model.getTypeDefinition("annotatedValueType", "");
      modelGroup = (XSModelGroup)type.getParticle().getTerm();
      assertNull(modelGroup.getAnnotation());
   }
View Full Code Here


      resolver.setBaseURI(xsdUrl.toString());
      XSImplementation impl = getXSImplementation();
      XSLoader schemaLoader = impl.createXSLoader(null);
      setResourceResolver(schemaLoader, resolver);
      setDOMErrorHandler(schemaLoader);
      XSModel model = schemaLoader.loadURI(xsdUrl.toString());

      XSNamedMap types = model.getComponents(XSConstants.TYPE_DEFINITION);
      for(int i = 0; i < types.getLength(); ++i)
      {
         XSTypeDefinition type = (XSTypeDefinition)types.item(i);
         if(!Constants.NS_XML_SCHEMA.equals(type.getNamespace()))
         {
View Full Code Here

        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

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

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

            if (input == null || input.length() == 0) {
                System.err.println("No input file!");
                return false;
            }
            System.out.println("Parsing " + input + "...");
            XSModel model = schemaLoader.loadURI(input);
            setModel(model);

            // check if root element exists
            XSElementDeclaration rootElement = findRootElement(model, config.getRootElementName());
            if (rootElement == null) {
View Full Code Here

      String typeName = xmlType.getLocalPart();

      try
      {
         // Get the parsed model
         XSModel model = jaxrpcContext.getXsModel();

         // Get the jaxrpc-mapping.xml meta data
         JavaWsdlMapping jaxrpcMapping = jaxrpcContext.getJavaWsdlMapping();

         unmarshaller.setProperty(JBossXBConstants.JBXB_XS_MODEL, model);
View Full Code Here

      SerializationContextJAXRPC jaxrpcContext = (SerializationContextJAXRPC)serContext;

      try
      {
         // Get the parsed model
         XSModel model = jaxrpcContext.getXsModel();

         // Get the jaxrpc-mapping.xml object graph
         JavaWsdlMapping jaxrpcMapping = jaxrpcContext.getJavaWsdlMapping();

         // schemabinding marshaller is the default delegate
View Full Code Here

    */
   public boolean hasComplexTypeDefinition(QName xmlType, URL xsdLocation)
   {
      if (xsdLocation == null)
         throw new IllegalArgumentException("xsdLocation is null");
      XSModel xsmodel = parseSchema(xsdLocation);
      return this.hasComplexTypeDefinition(xmlType, xsmodel);
   }
View Full Code Here

   {
      if (xmlName == null)
         throw new IllegalArgumentException("xmlName is null");
      if (xsdLocation == null)
         throw new IllegalArgumentException("xsdLocation is null");
      XSModel xsmodel = parseSchema(xsdLocation);
      boolean bool = false;
      String name = xmlName.getLocalPart();
      if (name == null)
         throw new IllegalArgumentException("xmlName has a null name");
      String ns = xmlName.getNamespaceURI();
      if (ns == null)
         throw new IllegalArgumentException("xmlName has a null namespace");
      if (xsmodel.getElementDeclaration(name, ns) != null)
         bool = true;
      return bool;
   }
View Full Code Here

    * @return schema model
    */
   public XSModel parseSchema(String schemaLoc)
   {
      XSLoader xsloader = getXSLoader();
      XSModel xsModel = xsloader.loadURI(schemaLoc);
      if (xsModel == null)
         throw new WSException("Cannot parse schema: " + schemaLoc);
      return xsModel;
   }
View Full Code Here

TOP

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

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.