Examples of XSParser


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

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

      "  <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

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

        "    </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

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

  }

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

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

    }

    /** <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

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

    }
       
    /** <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

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

    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, null, pSoapDataTypes);
    XSSchema schema = parser.parse(ele);
    assertNotNull(schema);
    assertTrue(schema.getElements().length > 0);
  }
View Full Code Here

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

    public void startElement(String pNamespaceURI, String pLocalName, String pQName,
                              Attributes pAttr) throws SAXException {
      if (xsContentHandler == null) {
        if (XSParser.XML_SCHEMA_URI.equals(pNamespaceURI&&  "schema".equals(pLocalName)) {
          XSParser parser = new XSParser();
          Element element = myDataTypes.getDocumentElement();
          String namespace = element.getAttributeNS(null, "targetNamespace");
          if (namespace == null  ||  namespace.length() == 0) {
            throw new IllegalStateException("Namespace is not set");
          }
          parser.addImport(namespace, soapDataTypes);
          xsContentHandler = new XSParser().getXSContentHandler(null);
          if (locator != null) {
            xsContentHandler.setDocumentLocator(locator);
          }
          xsContentHandler.startDocument();
          for (int i = 0;  i < prefixes.size();  i += 2) {
View Full Code Here

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

    private XSSchema parse(String pSchema, String pName)
            throws ParserConfigurationException, SAXException, IOException {
        InputSource isource = new InputSource(new StringReader(pSchema));
        isource.setSystemId(pName);
        XSParser parser = new XSParser();
        parser.setValidating(false);
        return parser.parse(isource);
    }
View Full Code Here

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

  protected ParserTestBase(String pName) {
    super(pName);
  }

  protected XSParser newXSParser() {
    XSParser parser = new XSParser();
    parser.setValidating(false);
    return parser;
  }
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.