Package org.apache.xerces.util

Examples of org.apache.xerces.util.XMLAttributesImpl


      actualValue = attDV.validate(attrValue, fValidationState, fValidatedInfo);
      // store the normalized value
      if (fNormalizeData)
        attributes.setValue(index, fValidatedInfo.normalizedValue);
      if (attributes instanceof XMLAttributesImpl) {
        XMLAttributesImpl attrs = (XMLAttributesImpl) attributes;
        boolean schemaId =
          fValidatedInfo.memberType != null
            ? fValidatedInfo.memberType.isIDType()
            : attDV.isIDType();
        attrs.setSchemaId(index, schemaId);
      }

      // PSVI: element notation
      if (attDV.getVariety() == XSSimpleType.VARIETY_ATOMIC
        && attDV.getPrimitiveKind() == XSSimpleType.PRIMITIVE_NOTATION) {
View Full Code Here


        attName =
          new QName(null, currDecl.fName, currDecl.fName, currDecl.fTargetNamespace);
        String normalized = (defaultValue != null) ? defaultValue.stringValue() : "";
        int attrIndex = attributes.addAttribute(attName, "CDATA", normalized);
        if (attributes instanceof XMLAttributesImpl) {
          XMLAttributesImpl attrs = (XMLAttributesImpl) attributes;
          boolean schemaId =
            defaultValue != null
              && defaultValue.memberType != null
                ? defaultValue.memberType.isIDType()
                : currDecl.fType.isIDType();
          attrs.setSchemaId(attrIndex, schemaId);
        }

        if (fAugPSVI) {

          // PSVI: attribute is "schema" specified
View Full Code Here

    if (isTopLevelIncludedItem())
    {
      if ((this.fFixupBaseURIs) && (!sameBaseURIAsIncludeParent()))
      {
        if (paramXMLAttributes == null)
          paramXMLAttributes = new XMLAttributesImpl();
        String str1 = null;
        try
        {
          str1 = getRelativeBaseURI();
        }
        catch (URI.MalformedURIException localMalformedURIException)
        {
          str1 = this.fCurrentBaseURI.getExpandedSystemId();
        }
        int k = paramXMLAttributes.addAttribute(XML_BASE_QNAME, XMLSymbols.fCDATASymbol, str1);
        paramXMLAttributes.setSpecified(k, true);
      }
      if ((this.fFixupLanguage) && (!sameLanguageAsIncludeParent()))
      {
        if (paramXMLAttributes == null)
          paramXMLAttributes = new XMLAttributesImpl();
        int i = paramXMLAttributes.addAttribute(XML_LANG_QNAME, XMLSymbols.fCDATASymbol, this.fCurrentLanguage);
        paramXMLAttributes.setSpecified(i, true);
      }
      Enumeration localEnumeration = this.fNamespaceContext.getAllPrefixes();
      while (localEnumeration.hasMoreElements())
      {
        String str2 = (String)localEnumeration.nextElement();
        str3 = this.fNamespaceContext.getURIFromIncludeParent(str2);
        str4 = this.fNamespaceContext.getURI(str2);
        if ((str3 == str4) || (paramXMLAttributes == null))
          continue;
        int n;
        if (str2 == XMLSymbols.EMPTY_STRING)
        {
          if (paramXMLAttributes.getValue(NamespaceContext.XMLNS_URI, XMLSymbols.PREFIX_XMLNS) != null)
            continue;
          if (paramXMLAttributes == null)
            paramXMLAttributes = new XMLAttributesImpl();
          localObject = (QName)NEW_NS_ATTR_QNAME.clone();
          ((QName)localObject).prefix = null;
          ((QName)localObject).localpart = XMLSymbols.PREFIX_XMLNS;
          ((QName)localObject).rawname = XMLSymbols.PREFIX_XMLNS;
          n = paramXMLAttributes.addAttribute((QName)localObject, XMLSymbols.fCDATASymbol, str4 != null ? str4 : XMLSymbols.EMPTY_STRING);
          paramXMLAttributes.setSpecified(n, true);
          this.fNamespaceContext.declarePrefix(str2, str4);
        }
        else
        {
          if (paramXMLAttributes.getValue(NamespaceContext.XMLNS_URI, str2) != null)
            continue;
          if (paramXMLAttributes == null)
            paramXMLAttributes = new XMLAttributesImpl();
          localObject = (QName)NEW_NS_ATTR_QNAME.clone();
          ((QName)localObject).localpart = str2;
          localObject.rawname += str2;
          ((QName)localObject).rawname = (this.fSymbolTable != null ? this.fSymbolTable.addSymbol(((QName)localObject).rawname) : ((QName)localObject).rawname.intern());
          n = paramXMLAttributes.addAttribute((QName)localObject, XMLSymbols.fCDATASymbol, str4 != null ? str4 : XMLSymbols.EMPTY_STRING);
View Full Code Here

    super.startElement(element, attributes, augs);
  }
 
   void insertStartElement(String name, QName base) {
          QName element = createQName(name, base);
    XMLAttributes attrs = new XMLAttributesImpl();
    Augmentations augs = new HTMLAugmentations();
    super.startElement(element,attrs,augs);
  }
View Full Code Here

        break;

      case Node.ELEMENT_NODE:
        QName name = new QName("", node.getNodeName(), node.getNodeName(), getNamespace());
        XMLAttributes attrs = new XMLAttributesImpl();
       
        NamedNodeMap attributes = node.getAttributes();
        if (attributes != null) {
          int l = attributes.getLength();
 
          for (int i = 0; i < l; i++) {
            Node attributeNode = attributes.item(i);
            attrs.addAttribute(new QName(prefix, attributeNode.getNodeName(),
                attributeNode.getNodeName(), uri), "CDATA",
                attributeNode.getNodeValue());
          }
         
        }
View Full Code Here

      return false;
    }

    void insertStartElement(String name,Augmentations augs) {
      QName element = new QName("", name, name, getNamespace());
      XMLAttributes attrs = new XMLAttributesImpl();
      super.startElement(element, attrs, augs);
    }
View Full Code Here

         this.qname = new QName(qname);
         if (attributes != null) {
            int length = attributes.getLength();
            if (length > 0) {
               QName aqname = new QName();
               XMLAttributes newattrs = new XMLAttributesImpl();
               for (int i = 0; i < length; i++) {
                  attributes.getName(i, aqname);
                  String type = attributes.getType(i);
                  String value = attributes.getValue(i);
                  String nonNormalizedValue = attributes.getNonNormalizedValue(i);
                  boolean specified = attributes.isSpecified(i);
                  newattrs.addAttribute(aqname, type, value);
                  newattrs.setNonNormalizedValue(i, nonNormalizedValue);
                  newattrs.setSpecified(i, specified);
               }
               this.attributes = newattrs;
            }
         }
      } // <init>(HTMLElements.Element,QName,XMLAttributes)
View Full Code Here

            this.qname = new QName(qname);
            if (attributes != null) {
                int length = attributes.getLength();
                if (length > 0) {
                    QName aqname = new QName();
                    XMLAttributes newattrs = new XMLAttributesImpl();
                    for (int i = 0; i < length; i++) {
                        attributes.getName(i, aqname);
                        String type = attributes.getType(i);
                        String value = attributes.getValue(i);
                        String nonNormalizedValue = attributes.getNonNormalizedValue(i);
                        boolean specified = attributes.isSpecified(i);
                        newattrs.addAttribute(aqname, type, value);
                        newattrs.setNonNormalizedValue(i, nonNormalizedValue);
                        newattrs.setSpecified(i, specified);
                    }
                    this.attributes = newattrs;
                }
            }
        } // <init>(HTMLElements.Element,QName,XMLAttributes)
View Full Code Here

TOP

Related Classes of org.apache.xerces.util.XMLAttributesImpl

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.