Package org.apache.ws.jaxme.xs

Examples of org.apache.ws.jaxme.xs.XSParser


      "  </xs:complexType>\n" +
      "</xs:schema>\n";

    InputSource isource = new InputSource(new StringReader(schemaSource));
    isource.setSystemId("testElements.xsd");
    XSParser xsParser = newXSParser();
    XSSchema schema = xsParser.parse(isource);

    XSType[] types = schema.getTypes();
    assertEquals(2, types.length);
    XSType a = types[0];
    assertEquals(new XsQName((String) null, "a"), a.getName());
View Full Code Here


      "  <xs:element name='test' type='xs:string' foo:b='z'/>\n" +
      "</xs:schema>\n";

    InputSource isource = new InputSource(new StringReader(schemaSource));
    isource.setSystemId("testElements.xsd");
    XSParser xsParser = newXSParser();
    XSSchema schema = xsParser.parse(isource);

    Attributes schemaOpenAttrs = schema.getOpenAttributes();
    assertNotNull(schemaOpenAttrs);
    assertEquals(1, schemaOpenAttrs.getLength());
    assertEquals("x", schemaOpenAttrs.getURI(0));
View Full Code Here

        "    </xs:restriction>\n" +
        "  </xs:simpleType>\n" +
        "</xs:schema>\n";
      InputSource isource = new InputSource(new StringReader(schemaSource));
      isource.setSystemId("testSimpleTypeRestriction.xsd");
      XSParser xsParser = newXSParser();
      XSSchema schema = xsParser.parse(isource);
      XSType[] types = schema.getTypes();
      assertEquals(1, types.length);
      XSSimpleType simpleType = assertSimpleType(types[0]);
      assertAtomicType(simpleType);
      XSEnumeration[] enumerations = simpleType.getEnumerations();
View Full Code Here

  }

    /** Tests definition of a key.
     */
    public void testSimpleKey() throws Exception {
      XSParser xsParser = newXSParser();
      testSimpleKey(xsParser);
      JAXBParser jaxbParser = newJAXBParser();
      testSimpleKey(jaxbParser);
    }
View Full Code Here

    }

    /** <p>Tests whether xs:documentation may have arbitrary childs.</p>
     */
    public void testDocumentationChilds() throws Exception {
      XSParser xsParser = newXSParser();
        testDocumentationChilds(xsParser);
        JAXBParser jaxbParser = newJAXBParser();
        testDocumentationChilds(jaxbParser);
    }
View Full Code Here

    }
       
    /** <p>Test the handling of namespace lists.</p>
     */
    public void testNamespaceLists() throws Exception {
        XSParser xsParser = newXSParser();
        testNamespaceLists(xsParser);
        JAXBParser jaxbParser = newJAXBParser();
        testNamespaceLists(jaxbParser);
    }
View Full Code Here

          "</xs:schema>\n";

      InputSource isource = new InputSource(new StringReader(schemaSpec));
      isource.setSystemId("jira46.xsd");
      JAXBSchemaReader r = getSchemaReader();
      XSParser parser = r.getSGFactory().newXSParser();
      parser.setValidating(false);
      XSSchema schema = parser.parse(isource);
      XSAttribute[] attrs = schema.getAttributes();
      assertEquals(1, attrs.length);
      XSAttribute idAttr = attrs[0];
      assertTrue(idAttr instanceof JAXBAttribute);
      assertEquals(new XsQName(uri, "id"), idAttr.getName());
View Full Code Here

    result.init();
    return result;
  }
 
  public XSParser newXSParser(SGFactory pController) throws SAXException {
    XSParser parser = new JAXBParser();
    XSContext context = parser.getContext();
    context.setXsObjectFactory(pController.newXsObjectFactory());
    context.setXSObjectFactory(pController.newXSObjectFactory());
    return parser;
  }
View Full Code Here

    Element element = pSoapDataTypes.getDocumentElement();
    String namespace = element.getAttributeNS(null, "targetNamespace");
    if (namespace == null  ||  namespace.length() == 0) {
      throw new IllegalStateException("Namespace is not set");
    }
    XSParser parser = new XSParser();
    parser.addImport(namespace, pSoapDataTypes);
    XSSchema schema = parser.parse(ele);
    assertNotNull(schema);
    assertTrue(schema.getElements().length > 0);
  }
View Full Code Here

            if (targetNamespace != null  &&  !"".equals(targetNamespace)) {
              parser.setTargetNamespace(new XsAnyURI(targetNamespace));
            }
            schema = parser.parse(pSource);
        } else {
          XSParser parser = factory.newXSParser();
          log.finest(mName, "Parser = " + parser + ", validating = " + getGenerator().isValidating());
          parser.setValidating(getGenerator().isValidating());
          schema = parser.parse(pSource);
        }
      log.finest(mName, "Schema = " + schema);
      SchemaSG result = factory.getSchemaSG(schema);
      log.finest(mName, "<-", result);
      return result;
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.xs.XSParser

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.