当前位置: 首页>>代码示例>>Java>>正文


Java XMLAttributes.removeAttributeAt方法代码示例

本文整理汇总了Java中org.apache.xerces.xni.XMLAttributes.removeAttributeAt方法的典型用法代码示例。如果您正苦于以下问题:Java XMLAttributes.removeAttributeAt方法的具体用法?Java XMLAttributes.removeAttributeAt怎么用?Java XMLAttributes.removeAttributeAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.xerces.xni.XMLAttributes的用法示例。


在下文中一共展示了XMLAttributes.removeAttributeAt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startElement

import org.apache.xerces.xni.XMLAttributes; //导入方法依赖的package包/类
/**
 * The start of an element. If the document specifies the start element
 * by using an empty tag, then the startElement method will immediately
 * be followed by the endElement method, with no intervening methods.
 * Overriding the parent to handle DOM_NAMESPACE_DECLARATIONS=false.
 *
 * @param element    The name of the element.
 * @param attributes The element attributes.
 * @param augs     Additional information that may include infoset augmentations
 *
 * @throws XNIException Thrown by handler to signal an error.
 */
public void startElement (QName element, XMLAttributes attributes, Augmentations augs) {
    // namespace declarations parameter has no effect if namespaces is false.
    if (!fNamespaceDeclarations && fNamespaceAware) {
        int len = attributes.getLength();
        for (int i = len - 1; i >= 0; --i) {
            if (XMLSymbols.PREFIX_XMLNS == attributes.getPrefix(i) ||
                XMLSymbols.PREFIX_XMLNS == attributes.getQName(i)) {
                attributes.removeAttributeAt(i);
            }
        }
    }
    super.startElement(element, attributes, augs);
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:26,代码来源:DOMParserImpl.java

示例2: startElement

import org.apache.xerces.xni.XMLAttributes; //导入方法依赖的package包/类
@Override
public void startElement(QName element, XMLAttributes attrs,
                         Augmentations augs) throws XNIException {
    int i;
    for (i = 0; i < attrs.getLength(); ++i) {
        if (isNamespace(attrs.getQName(i))) {
            attrs.removeAttributeAt(i);
            --i;
        }
    }

    element.uri = null;
    super.startElement(element, attrs, augs);
}
 
开发者ID:gocd,项目名称:gocd,代码行数:15,代码来源:HtmlDomParserContext.java

示例3: handleOpenTag

import org.apache.xerces.xni.XMLAttributes; //导入方法依赖的package包/类
/** Handles an open tag. */
protected boolean handleOpenTag(QName element, XMLAttributes attributes) {
    if (elementAccepted(element.rawname)) {
        Object key = element.rawname.toLowerCase();
        Object value = fAcceptedElements.get(key);
        if (value != NULL) {
            String[] anames = (String[])value;
            int attributeCount = attributes.getLength();
            LOOP: for (int i = 0; i < attributeCount; i++) {
                String aname = attributes.getQName(i).toLowerCase();
                for (int j = 0; j < anames.length; j++) {
                    if (anames[j].equals(aname)) {
                        continue LOOP;
                    }
                }
                attributes.removeAttributeAt(i--);
                attributeCount--;
            }
        }
        else {
            attributes.removeAllAttributes();
        }
        return true;
    }
    else if (elementRemoved(element.rawname)) {
        fRemovalElementDepth = fElementDepth;
    }
    return false;
}
 
开发者ID:ecologylab,项目名称:BigSemanticsJava,代码行数:30,代码来源:ElementRemover.java

示例4: startElement

import org.apache.xerces.xni.XMLAttributes; //导入方法依赖的package包/类
@Override
public void startElement(QName elem, XMLAttributes attrs, Augmentations augs)
    throws XNIException {
  // Normalize the case of forced-elements to lowercase for backward compatability
  if (!fSeenRootElement && elem.rawname.equalsIgnoreCase("html")) {
    elem.localpart = "html";
    elem.rawname = "html";
  } else if (!fSeenHeadElement && elem.rawname.equalsIgnoreCase("head")) {
    elem.localpart = "head";
    elem.rawname = "head";
  } else if (!fSeenBodyElement && elem.rawname.equalsIgnoreCase("body")) {
    elem.localpart = "body";
    elem.rawname = "body";
  }

  // Convert script tags of an OSML type to OSTemplate/OSData tags
  if ("script".equalsIgnoreCase(elem.rawname)) {
    String value = attrs.getValue("type");
    String osmlTagName = SCRIPT_TYPE_TO_OSML_TAG.get(value);
    if (osmlTagName != null) {
      if (currentOsmlTag != null) {
        throw new XNIException("Nested OpenSocial script elements");
      }
      currentOsmlTag = new QName(null, osmlTagName, osmlTagName, null);
      if (scriptContent == null) {
        scriptContent = new StringBuilder();
      }
      // Remove the type attribute
      attrs.removeAttributeAt(attrs.getIndex("type"));
      super.startElement(currentOsmlTag, attrs, augs);
      return;
    }
  }

  super.startElement(elem, attrs, augs);
}
 
开发者ID:inevo,项目名称:shindig-1.1-BETA5-incubating,代码行数:37,代码来源:NekoSimplifiedHtmlParser.java


注:本文中的org.apache.xerces.xni.XMLAttributes.removeAttributeAt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。