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

    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 = soapDataTypes.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();
          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

  public SyntaxTest(String pName) {
    super(pName);
  }

  protected void parseSyntax(File f) throws IOException, SAXException, ParserConfigurationException {
    XSParser xsp = new XSParser();
    InputSource isource = new InputSource(new FileInputStream(f));
    isource.setSystemId(f.toURL().toString());
    xsp.parseSyntax(isource);
  }
View Full Code Here

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

    isource.setSystemId(f.toURL().toString());
    xsp.parseSyntax(isource);
  }

  protected void parseLogical(File f) throws IOException, SAXException, ParserConfigurationException {
    XSParser xsp = new XSParser();
    InputSource isource = new InputSource(new FileInputStream(f));
    isource.setSystemId(f.toURL().toString());
    xsp.parse(isource);
  }
View Full Code Here

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

  public ClaesLarssonTest(String pName) {
    super(pName);
  }

  public void testParse() throws Exception {
    XSParser xsp = new XSParser();
    xsp.setValidating(false);

    String xmlFileName = "examples/xs/Claes_Larsson/schema.xsd";
    java.net.URL xmlSystemId = new File(xmlFileName).toURL();

    InputSource isource = new InputSource(new FileInputStream(xmlFileName));
    isource.setSystemId(xmlSystemId.toString());
    XSSchema schema = xsp.parse(isource);

    // Print the names of all global elements:
    XSElement[] elements = schema.getElements();
    assertEquals(154, elements.length);
  }
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, 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 SchemaSG parse(InputSource pSource) throws Exception {
    final String mName = "parse";
    log.finest(mName, "->", pSource.getSystemId());
    SGFactory factory = getSGFactory();
    XSParser parser = factory.newXSParser();
    log.finest(mName, "Parser = " + parser + ", validating = " + getGenerator().isValidating());
    parser.setValidating(getGenerator().isValidating());
    XSSchema schema = parser.parse(pSource);
    log.finest(mName, "Schema = " + schema);
    SchemaSG result = factory.getSchemaSG(schema);
    log.finest(mName, "<-", result);
    return result;
  }
View Full Code Here

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

  /** <p>Tests whether the basic simple types can be parsed:
   * Atomic, List, and Union.</p>
   * @throws Exception
   */
  public void testSimpleTypes() throws Exception {
    XSParser xsParser = newXSParser();
    testSimpleTypes(xsParser);
    JAXBParser jaxbParser = newJAXBParser();
    testSimpleTypes(jaxbParser);
  }
View Full Code Here

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

    XSSimpleType st3 = assertSimpleType(t3);
    assertAtomicType(st3);
  }

  public void testAttributes() throws Exception {
    XSParser xsParser = newXSParser();
    testAttributes(xsParser);
    JAXBParser jaxbParser = newJAXBParser();
    testAttributes(jaxbParser);
  }
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.