Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSElementDeclaration


                // check for namespaces
                if (cppName.equals(config.getRootElementName())) {
                    elementsToIgnoreNSDecls.add(element);
                }
                XSElementDeclaration parentElement = getParentElementFromStack();
                if (parentElement != null) {
                    String parentNS = parentElement.getNamespace();
                    if (parentNS != null && !parentNS.equals(element.getNamespace())) {
                        elementsToParseNSDecls.add(parentElement);
                        elementsToIgnoreNSDecls.add(element);
                    } else if (parentNS == null && element.getNamespace() != null) {
                        elementsToParseNSDecls.add(parentElement);
View Full Code Here


        String tmpl = null;
        StateMachineRootNode sm = stateMachineMap.get(parentType);

        boolean isChildOfUnreferencedTopLevelElement = false;
        XSElementDeclaration parentElement = null;

        ElementUsage elementUsage = completeElementUsage.get(element.getName());
        List<XSElementDeclaration> parents = elementUsage.collectParents();
        for (XSElementDeclaration parent : parents) {
            if (parent.getTypeDefinition() == parentType) {
                parentElement = parent;
                break;
            }
        }

        if (parentElement != null && !parentElement.getName().equals(config.getRootElementName())) {
            if (parentElement.getSubstitutionGroupAffiliation() == null) {
                ElementUsage parentUsage = completeElementUsage.get(parentElement.getName());
                if (parentUsage.collectParents().isEmpty()) {
                    isChildOfUnreferencedTopLevelElement = true;
                }
            }
        }

        if (isChildOfUnreferencedTopLevelElement) {
            tmpl = "#ind##ind#// no validation because is child of unreferenced top level element#nl#";
            if (parentElement != null && parentElement.getName() != null) {
                tmpl += "#ind##ind#// parent element: " + parentElement.getName() + "#nl#";
            }
        } else {
            if (sm == null) {
                tmpl = config.getTemplateComplexValidationChildValidateBegin();
            } else {
View Full Code Here

        findElementHashFile.println("if ( mElementDataStack.empty() )");
        findElementHashFile.print(config.getIndentation());
        findElementHashFile.println("{");

        String codeTemplate = config.getTemplateFindHashSetValues();
        XSElementDeclaration rootElement = findRootElement(getModel(), config.getRootElementName());

        findElementHashFile.print(config.getIndentation());
        findElementHashFile.print(config.getIndentation());
        findElementHashFile.println("if( elementData.elementHash == "
                + Util.createElementNameHashIdentifier(rootElement.getName()) + " )");
        findElementHashFile.print(config.getIndentation());
        findElementHashFile.print(config.getIndentation());
        findElementHashFile.println("{");

        findElementHashFile.println(TemplateEngine.fillInTemplate(TemplateEngine.fillInFindHashTemplate(codeTemplate,
View Full Code Here

            for (int i = 0; i < modelGroup.getParticles().getLength(); i++) {
                XSObject particleObject = modelGroup.getParticles().item(i);
                if (particleObject instanceof XSParticle) {
                    XSParticle currentParticle = (XSParticle) particleObject;
                    if (currentParticle.getTerm() instanceof XSElementDeclaration) {
                        XSElementDeclaration particleElement = (XSElementDeclaration) currentParticle.getTerm();
                        if (particleElement.getName().equals(element.getName())) {
                            particle = currentParticle;
                            break;
                        }
                    }
                }
View Full Code Here

        // case 3: anonymous type inside a type with a name
        SortedSet<XSTypeDefinition> parentTypes = collectParentTypes(element, elementUsage);
        // XSTypeDefinition exactParentType = findExactParentType(element,
        // parentTypes);
        XSElementDeclaration parentElement = getParentElementFromStack();
        XSTypeDefinition exactParentType = parentElement.getTypeDefinition();
        if (exactParentType != null && exactParentType.getName() != null) {
            String uniqueParentName = makeXstypeNamespaceUnique(parentElement);
            name = uniqueParentName + delmi + delmi + element.getName();
            CppElementNameParentTypesPair returnVal = new CppElementNameParentTypesPair();
            returnVal.cppElementName = Util.replaceCharactersForbiddenInCppIdentifiers(name);
View Full Code Here

   public QName getXMLType(QName xmlName)
   {
      QName xmlType = null;
      String nsURI = xmlName.getNamespaceURI();
      String localPart = xmlName.getLocalPart();
      XSElementDeclaration xsel = schemaModel.getElementDeclaration(localPart, nsURI);
      if (xsel != null)
      {
         XSTypeDefinition xstype = xsel.getTypeDefinition();
         if (xstype == null)
            throw new WSException("Cannot obtain XSTypeDefinition for: " + xmlName);

         if (xstype.getAnonymous() == false)
         {
View Full Code Here

         }

         namedMap = model.getComponents(XSConstants.ELEMENT_DECLARATION);
         for (int i = 0; i < namedMap.getLength(); i++)
         {
            XSElementDeclaration element = (XSElementDeclaration)namedMap.item(i);
            analyzeElement(element, null, element.getNamespace(), null, null);
         }
      }
View Full Code Here

               XSObjectList list = group.getParticles();
               for (int i = 0; i < list.getLength(); i++)
                  analyzeParticle((XSParticle)list.item(i), parentName, namespace);
               break;
            case XSConstants.ELEMENT_DECLARATION:
               XSElementDeclaration decl = (XSElementDeclaration)term;
               analyzeElement(decl, parentName, namespace, new Integer(particle.getMinOccurs()), new Integer(particle.getMaxOccurs()));
         }
      }
View Full Code Here

     * @param rootElementName
     *            Name of element to start with.
     */
    public void startWithRootElement(XSModel model, String rootElementName) {
        this.model = model;
        XSElementDeclaration rootElement = findRootElement(model, rootElementName);
        if (handleElement(rootElement)) {
            start(model);
        }
    }
View Full Code Here

    protected List<XSElementDeclaration> buildCurrentAncestorList() {
        List<XSElementDeclaration> list = new ArrayList<XSElementDeclaration>();

        // this consumes too much memory for COLLADA 1.5
        for (int i = getElementStack().size() - 1; i >= 0; i--) {
            XSElementDeclaration elemDecl = getElementStack().get(i);
            list.add(elemDecl);
        }

        // if (getElementStack().size() >= 1)
        // list.add(getElementStack().get(getElementStack().size() - 1));
View Full Code Here

TOP

Related Classes of org.apache.xerces.xs.XSElementDeclaration

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.