Package org.apache.ws.jaxme.xs.xml

Examples of org.apache.ws.jaxme.xs.xml.XsESchema


  protected XsESchema parseSyntax(Node pNode) throws SAXException {
    XSContext data = getData();
    try {
      XsObjectFactory factory = data.getXsObjectFactory();
      XsESchema mySchema = factory.newXsESchema();
      XsSAXParser xsSAXParser = factory.newXsSAXParser(mySchema);
      addSyntaxSchema(mySchema);
      try {
        data.setCurrentContentHandler(xsSAXParser);
        DOMSerializer ds = new DOMSerializer();
View Full Code Here


  }


  protected XsESchema parseSyntax(Locator pLocator, String pSchemaLocation)
        throws SAXException, IOException, ParserConfigurationException {
      XsESchema result = getData().getXsObjectFactory().newXsESchema();
      parseSyntax(pLocator, pSchemaLocation, result);
      return result;
  }
View Full Code Here

    if (schemaLocation == null) {
      throw new LocSAXException("Invalid include: Missing 'schemaLocation' attribute.",
                                   pInclude.getLocator());
    }
    Locator locator = pInclude.getLocator();
    XsESchema includedSchema = parseSyntax(locator, schemaLocation.toString());
    XsAnyURI incNamespace = includedSchema.getTargetNamespace();
    if (incNamespace == null) {
        if (pIncludingSchema.getTargetNamespace() != null) {
            includedSchema.setTargetNamespace(pIncludingSchema.getTargetNamespace());
        }
    } else {
        XsAnyURI myNamespace = includedSchema.getTargetNamespace();
        if (!incNamespace.equals(myNamespace)) {
            throw new LocSAXException("Invalid include: The included schemas target namespace " +
                    incNamespace + " and the including schemas target namespace " +
                    myNamespace + " do not match.",
                    pInclude.getLocator());
View Full Code Here

    }
    if (importedSchemas == null) {
      importedSchemas = new HashSet();
    }
    importedSchemas.add(pSchemaLocation);
    XsESchema importedSchema = parseSyntax(pLocator, pSchemaLocation);
    importSchema(pImportingSchema, pNamespace, importedSchema, pLocator);
  }
View Full Code Here

  }

  protected void importSchema(XsESchema pImportingSchema, String pNamespace, Node pNode)
      throws SAXException, IOException, ParserConfigurationException {
    checkValidImportSchema(pImportingSchema, pNamespace, null);
    XsESchema importedSchema = parseSyntax(pNode);
    importSchema(pImportingSchema, pNamespace, importedSchema, null);
  }
View Full Code Here

    // may be used to replace the substitution groups head, if required.
    for (Iterator iter = substitutionGroups.values().iterator();  iter.hasNext()) {
      SubstitutionGroup group = (SubstitutionGroup) iter.next();
      XSElementImpl head = (XSElementImpl) group.getHead();
      XsObject object = head.getXsObject();
      XsESchema syntaxSchema = object.getXsESchema();

      // Find a name for the group
      String namespace = syntaxSchema.getTargetNamespace().toString();
      String localName = head.getName().getLocalName() + "Group";
      XsQName suggestion = new XsQName(namespace, localName);
      if (pSchema.getGroup(suggestion) != null) {
        for (int i = 0;  ;  i++) {
          suggestion = new XsQName(namespace, localName + i);
View Full Code Here

    parser = pParser;
    XSContext data = parser.getData();
    data.setXSLogicalParser(parser);
    parser.clearSyntaxSchemas();
    XsObjectFactory factory = data.getXsObjectFactory();
    XsESchema mySchema = factory.newXsESchema();
    parser.setSchema(data.getXSObjectFactory().newXSSchema(data, mySchema));
    xsSAXParser = factory.newXsSAXParser(mySchema);
    parser.addSyntaxSchema(mySchema);
    data.setCurrentContentHandler(xsSAXParser);
  }
View Full Code Here

    xsSAXParser.startDocument();
  }

  public void endDocument() throws SAXException {
    xsSAXParser.endDocument();
    XsESchema syntaxSchema = (XsESchema) xsSAXParser.getBean();
    parser.removeSyntaxSchema();
    XSContext data = parser.getData();
    data.setCurrentContentHandler(null);

    try {
View Full Code Here

      if (myName == null) {
        throw new LocSAXException("Invalid element: Must have either of its 'ref' or 'name' attributes set.",
                                     getLocator());
      }

      XsESchema schema = pBaseElement.getXsESchema();
      XsAnyURI namespace;
      String namespacePrefix;
      boolean qualified = pBaseElement.isGlobal();
      if (!qualified) {
        XsFormChoice form = pBaseElement.getForm();
        if (form == null) {
          form = schema.getElementFormDefault();
        }
        qualified = XsFormChoice.QUALIFIED.equals(form);
      }
      if (qualified) {
        namespace = schema.getTargetNamespace();
        namespacePrefix = schema.getTargetNamespacePrefix();
      } else {
        namespace = null;
        namespacePrefix = null;
      }
      qName = new XsQName(namespace, myName.toString(), namespacePrefix);
View Full Code Here

        };
        context = new XSContextImpl();
        context.setXSLogicalParser(this);
        context.setXsObjectFactory(xsObjectFactory);
        clearSyntaxSchemas();
        XsESchema syntaxSchema = new XsESchemaImpl(context){
        };
        parse(syntaxSchema, pInputSource);
        XSSchema schema = context.getXSObjectFactory().newXSSchema(context, syntaxSchema);
        setSchema(schema);
        addSyntaxSchema(syntaxSchema);
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.xs.xml.XsESchema

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.