org.dom4j.Attribute.getPath()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(148)

本文整理了Java中org.dom4j.Attribute.getPath()方法的一些代码示例,展示了Attribute.getPath()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Attribute.getPath()方法的具体详情如下:
包路径:org.dom4j.Attribute
类名称:Attribute
方法名:getPath

Attribute.getPath介绍

暂无

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

private void setAttributeField( Attribute attribute, IProgressMonitor monitor ) {
 String attributnametxt = cleanString( attribute.getPath() );
 if ( !Utils.isEmpty( attributnametxt ) && !list.contains( attribute.getPath() ) ) {
  nr++;
  monitor.subTask( BaseMessages.getString( PKG, "GetXMLDataXMLInputFieldsImportProgressDialog.Task.FetchFields",
   row.addValue( VALUE_FORMAT, Value.VALUE_TYPE_STRING, null );
  list.add( attribute.getPath() );

代码示例来源:origin: micromata/projectforge

private void checkForIgnoredElements(final StringBuffer buf, final Element el)
{
 if (processedElements.contains(el) == false) {
  buf.append("Ignored xml element: ").append(el.getPath()).append("\n");
 }
 @SuppressWarnings("rawtypes")
 final List attributes = el.attributes();
 if (attributes != null) {
  final Set<String> attributeSet = processedAttributes.get(el);
  for (final Object attr : attributes) {
   if (attributeSet == null || attributeSet.contains(((Attribute) attr).getName()) == false) {
    buf.append("Ignored xml attribute: ").append(((Attribute) attr).getPath()).append("\n");
   }
  }
 }
 @SuppressWarnings("rawtypes")
 final List children = el.elements();
 if (children != null) {
  for (final Object child : children) {
   checkForIgnoredElements(buf, (Element) child);
  }
 }
}

代码示例来源:origin: dom4j/dom4j

public void testBug569927() {
  Document doc = DocumentHelper.createDocument();
  QName elName = DocumentFactory.getInstance().createQName("a", "ns",
      "uri://myuri");
  Element a = doc.addElement(elName);
  QName attName = DocumentFactory.getInstance().createQName("attribute",
      "ns", "uri://myuri");
  a = a.addAttribute(attName, "test");
  Attribute att = a.attribute(attName);
  assertSame(att, doc.selectSingleNode(att.getPath()));
  assertSame(att, doc.selectSingleNode(att.getUniquePath()));
}

相关文章