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

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


        };
        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);
    parse(syntaxSchema, pInputSource.getSystemId());
View Full Code Here


 
  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 (pSchemaLocation == null) {
      return;
    }
    checkValidImportSchema(pImportingSchema, pNamespace, pLocator);
   
    XsESchema importedSchema = parseSyntax(pLocator, pSchemaLocation);
    importSchema(pImportingSchema, pNamespace, importedSchema, pLocator, pSchemaLocation);
  }
View Full Code Here

 
  protected void importSchema(XsESchema pImportingSchema, String pNamespace, Node pNode,
      String pSchemaLocation)
  throws SAXException, IOException, ParserConfigurationException {
    checkValidImportSchema(pImportingSchema, pNamespace, null);
    XsESchema importedSchema = parseSyntax(pNode);
    importSchema(pImportingSchema, pNamespace, importedSchema, null, pSchemaLocation);
  }
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

  protected XsQName getQName(XsNCName pName) throws SAXException {
    if (pName == null) {
      throw new LocSAXException("Invalid group: Either of its 'ref' or 'name' attributes must be set.",
                                   getLocator());
    }
    XsESchema syntaxSchema = getXsObject().getXsESchema();
    return new XsQName(syntaxSchema.getTargetNamespace(), pName.toString(), syntaxSchema.getTargetNamespacePrefix());
  }
View Full Code Here

      XsNCName myName = pBaseAttribute.getName();
      if (myName == null) {
        throw new LocSAXException("Invalid attribute: Neither of its 'name' or 'ref' attributes are set.",
                                     pBaseAttribute.getLocator());
      }
      XsESchema schema = pBaseAttribute.getXsESchema();
      XsAnyURI namespace;
      String namespacePrefix;
      boolean qualified = isGlobal = pBaseAttribute.isGlobal();
      if (!qualified) {
        XsFormChoice form = pBaseAttribute.getForm();
        if (form == null) {
          form = schema.getAttributeFormDefault();
        }
        qualified = XsFormChoice.QUALIFIED.equals(form);
      }
      if (qualified) {
        namespace = schema.getTargetNamespace();
        namespacePrefix = schema.getTargetNamespacePrefix();
      } else {
        namespace = null;
        namespacePrefix = null;
      }
      this.name = new XsQName(namespace, myName.toString(), namespacePrefix);
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

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.