本文整理了Java中nu.xom.Element.getAttribute()
方法的一些代码示例,展示了Element.getAttribute()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getAttribute()
方法的具体详情如下:
包路径:nu.xom.Element
类名称:Element
方法名:getAttribute
暂无
代码示例来源:origin: jaxen/jaxen
public Object get(Object o, int i) {
return ((Element)o).getAttribute(i);
}
};
代码示例来源: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: com.thoughtworks.xstream/xstream
public String getAttribute(int index) {
return currentElement.getAttribute(index).getValue();
}
代码示例来源: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: com.thoughtworks.xstream/xstream
public String getAttributeName(int index) {
return decodeAttribute(currentElement.getAttribute(index).getQualifiedName());
}
代码示例来源: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: org.xml-cml/cmlxom
/**
* gets local value of dictRef value on element
* eg dictRef="a:b" returns b
* @param element
* @return null id no dictRef ; value if no prefix
*/
public static String getLocalValue(Element element) {
Attribute att = element.getAttribute(NAME);
String value = (att == null) ? null : att.getValue();
String[] values = (value == null) ? null : value.split(CMLConstants.S_COLON);
return (values == null) ? null : values[values.length-1];
}
代码示例来源: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: com.io7m.jstructural/io7m-jstructural-xom
private static String kindAttribute(
final Element e)
{
final Attribute et = e.getAttribute("kind", SXML.XML_URI.toString());
assert et != null;
final String r = et.getValue();
assert r != null;
return r;
}
代码示例来源: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: com.io7m.jstructural/io7m-jstructural-xom
private static URI sourceAttribute(
final Element ec)
throws URISyntaxException
{
final Attribute a = ec.getAttribute("source", SXML.XML_URI.toString());
return new URI(a.getValue());
}
代码示例来源:origin: com.io7m.jstructural/io7m-jstructural-xom
private static String targetAttribute(
final Element ec)
{
final Attribute a = ec.getAttribute("target", SXML.XML_URI.toString());
return a.getValue();
}
代码示例来源:origin: x-stream/xstream
@Override
public String getAttribute(final int index) {
return currentElement.getAttribute(index).getValue();
}
代码示例来源:origin: com.io7m.jstructural/io7m-jstructural-xom
private static
@Nullable
Integer heightAttribute(
final Element ec)
{
final Attribute a = ec.getAttribute("height", SXML.XML_URI.toString());
if (a == null) {
return null;
}
return Integer.valueOf(a.getValue());
}
代码示例来源:origin: com.io7m.jstructural/io7m-jstructural-xom
private static
@Nullable
String typeAttribute(
final Element e)
{
final Attribute et = e.getAttribute("type", SXML.XML_URI.toString());
if (et == null) {
return null;
}
return et.getValue();
}
代码示例来源:origin: org.openbase/jul.extension.xml
public static String parseAttributeValue(final String attributeName, final Element sourceElement) throws MissingAttributeException {
Attribute attribute = sourceElement.getAttribute(attributeName);
if (attribute == null) {
throw new MissingAttributeException(attributeName, sourceElement);
}
return attribute.getValue();
}
代码示例来源:origin: x-stream/xstream
@Override
public String getAttributeName(final int index) {
return decodeAttribute(currentElement.getAttribute(index).getQualifiedName());
}
代码示例来源:origin: org.concordion/concordion
private boolean hasContentTypeMetadata(Element head) {
Elements metaChildren = head.getChildElements("meta");
for (int i=0; i < metaChildren.size(); i++) {
Element metaChild = metaChildren.get(i);
Attribute httpEquiv = metaChild.getAttribute("http-equiv");
if (httpEquiv != null && "content-type".equalsIgnoreCase(httpEquiv.getValue())) {
return true;
}
}
return false;
}
}
代码示例来源:origin: com.io7m.jstructural/io7m-jstructural-xom
private static
@Nullable
SID idAttribute(
final Element e)
{
final Attribute eid =
e.getAttribute("id", "http://www.w3.org/XML/1998/namespace");
if (eid == null) {
return null;
}
return SID.newID(eid.getValue());
}
代码示例来源:origin: concordion/concordion
private boolean hasContentTypeMetadata(Element head) {
Elements metaChildren = head.getChildElements("meta");
for (int i=0; i < metaChildren.size(); i++) {
Element metaChild = metaChildren.get(i);
Attribute httpEquiv = metaChild.getAttribute("http-equiv");
if (httpEquiv != null && "content-type".equalsIgnoreCase(httpEquiv.getValue())) {
return true;
}
}
return false;
}
}
内容来源于网络,如有侵权,请联系作者删除!