本文整理了Java中nu.xom.Element.getAttributeCount()
方法的一些代码示例,展示了Element.getAttributeCount()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getAttributeCount()
方法的具体详情如下:
包路径:nu.xom.Element
类名称:Element
方法名:getAttributeCount
暂无
代码示例来源:origin: com.thoughtworks.xstream/xstream
public int getAttributeCount() {
return currentElement.getAttributeCount();
}
代码示例来源:origin: jaxen/jaxen
public Iterator getAttributeAxisIterator(Object o) {
if (isElement(o)) {
return new IndexIterator(o, 0, ((Element)o).getAttributeCount()) {
public Object get(Object o, int i) {
return ((Element)o).getAttribute(i);
}
};
}
return JaxenConstants.EMPTY_ITERATOR;
}
代码示例来源:origin: x-stream/xstream
@Override
public int getAttributeCount() {
return currentElement.getAttributeCount();
}
代码示例来源:origin: edu.internet2.middleware.grouper/grouperClient
public int getAttributeCount() {
return currentElement.getAttributeCount();
}
代码示例来源:origin: org.jvnet.hudson/xstream
public int getAttributeCount() {
return currentElement.getAttributeCount();
}
代码示例来源:origin: ovea-deprecated/jetty-session-redis
public int getAttributeCount() {
return currentElement.getAttributeCount();
}
代码示例来源:origin: com.haulmont.thirdparty/xstream
public int getAttributeCount() {
return currentElement.getAttributeCount();
}
代码示例来源:origin: org.xml-cml/cmlxom
private void substituteAttributes(Element element) {
// make a copy of attribute lists as we are resetting them
int attCount = element.getAttributeCount();
List<Attribute> attList = new ArrayList<Attribute>();
for (int j = 0; j < attCount; j++) {
Attribute att = element.getAttribute(j);
attList.add(att);
}
for (Attribute att : attList) {
this.substituteNameByValue(att);
}
}
代码示例来源:origin: teiid/teiid
private NodeInfo advance() {
Element elem = (Element) start.node;
if (cursor == elem.getAttributeCount()) {
return null;
}
NodeInfo curr = makeWrapper(elem.getAttribute(cursor), docWrapper, start, cursor);
cursor++;
return curr;
}
代码示例来源:origin: org.jboss.teiid/teiid-engine
private NodeInfo advance() {
Element elem = (Element) start.node;
if (cursor == elem.getAttributeCount()) return null;
NodeInfo curr = makeWrapper(elem.getAttribute(cursor), docWrapper, start, cursor);
cursor++;
return curr;
}
代码示例来源:origin: org.teiid/saxon-xom
private NodeInfo advance() {
Element elem = (Element) start.node;
if (cursor == elem.getAttributeCount()) {
return null;
}
NodeInfo curr = makeWrapper(elem.getAttribute(cursor), docWrapper, start, cursor);
cursor++;
return curr;
}
代码示例来源:origin: org.xml-cml/cmlxom
/**
* copies attributes. makes subclass if necessary.
*
* @param element to copy from
*/
public void copyAttributesFrom(Element element) {
for (int i = 0; i < element.getAttributeCount(); i++) {
Attribute att = element.getAttribute(i);
Attribute newAtt = (Attribute) att.copy();
this.addAttribute(newAtt);
}
}
代码示例来源:origin: concordion/concordion
public void moveAttributesTo(Element element) {
for (int i=0; i<xomElement.getAttributeCount(); i++) {
Attribute attribute = xomElement.getAttribute(i);
xomElement.removeAttribute(attribute);
element.xomElement.addAttribute(attribute);
}
}
代码示例来源:origin: org.concordion/concordion
public void moveAttributesTo(Element element) {
for (int i=0; i<xomElement.getAttributeCount(); i++) {
Attribute attribute = xomElement.getAttribute(i);
xomElement.removeAttribute(attribute);
element.xomElement.addAttribute(attribute);
}
}
代码示例来源:origin: org.xml-cml/cmlxom
/**
* copies atributes of 'from' to 'to'
* @param element
*/
public static void copyAttributes(Element from, Element to) {
int natt = from.getAttributeCount();
for (int i = 0; i < natt; i++) {
Attribute newAtt = new Attribute(from.getAttribute(i));
to.addAttribute(newAtt);
}
}
代码示例来源:origin: DSpace/DSpace
protected void processUnexpectedAttributes(Element element, List<SwordValidationInfo> attributeItems) {
int attributeCount = element.getAttributeCount();
Attribute attribute = null;
for (int i = 0; i < attributeCount; i++) {
attribute = element.getAttribute(i);
XmlName attributeName = new XmlName(attribute.getNamespacePrefix(),
attribute.getLocalName(),
attribute.getNamespaceURI());
SwordValidationInfo info = new SwordValidationInfo(xmlName, attributeName,
SwordValidationInfo.UNKNOWN_ATTRIBUTE,
SwordValidationInfoType.INFO);
info.setContentDescription(attribute.getValue());
attributeItems.add(info);
}
}
代码示例来源:origin: se.vgregion.pubsubhubbub/pubsubhubbub-hub-composite-pubsub
public DefaultField(Element elm) {
this.name = elm.getLocalName();
this.namespace = elm.getNamespaceURI();
this.prefix = elm.getNamespacePrefix();
for(int i = 0; i<elm.getAttributeCount(); i++) {
Attribute attribute = elm.getAttribute(i);
fields.add(new DefaultField(attribute.getNamespaceURI(), attribute.getNamespacePrefix(), attribute.getLocalName(), attribute.getValue()));
}
this.content = XmlUtil.innerToString(elm);
}
代码示例来源:origin: teiid/teiid
final void writeStartTag(Element elem) {
writeIndex(elem.getNamespacePrefix(), elem.getLocalName());
int type = BEGIN_ELEMENT;
if (elem.getNamespaceURI().length() == 0) {
type = Util.noNamespace(type);
} else {
writeIndex(elem.getNamespaceURI());
}
nodeTokens.add((byte)type);
for (int i = 0; i < elem.getAttributeCount(); i++) {
writeAttribute(elem.getAttribute(i));
}
writeNamespaceDeclarations(elem);
}
代码示例来源:origin: org.teiid/saxon-xom
final void writeStartTag(Element elem) {
writeIndex(elem.getNamespacePrefix(), elem.getLocalName());
int type = BEGIN_ELEMENT;
if (elem.getNamespaceURI().length() == 0) {
type = Util.noNamespace(type);
} else {
writeIndex(elem.getNamespaceURI());
}
nodeTokens.add((byte)type);
for (int i = 0; i < elem.getAttributeCount(); i++) {
writeAttribute(elem.getAttribute(i));
}
writeNamespaceDeclarations(elem);
}
代码示例来源:origin: wiztools/xsd-gen
private void processAttributes(final Element inElement, final Element outElement) {
for (int i = 0; i < inElement.getAttributeCount(); i++) {
final Attribute attr = inElement.getAttribute(i);
final String name = attr.getLocalName();
final String value = attr.getValue();
Element attrElement = new Element(xsdPrefix + ":attribute", XSD_NS_URI);
attrElement.addAttribute(new Attribute("name", name));
attrElement.addAttribute(new Attribute("type", xsdPrefix + TypeInferenceUtil.getTypeOfContent(value)));
attrElement.addAttribute(new Attribute("use", "required"));
outElement.appendChild(attrElement);
}
}
内容来源于网络,如有侵权,请联系作者删除!