@Override public List<Namespace> getNamespacesIntroduced() { if (getParent() == null) { return Collections.singletonList(getNamespace()); } return Collections.emptyList(); }
final Element f = from.getParent(); if (f == null) { throw new IllegalArgumentException(
"Cannot create a path to a null target"); final Element f = from.getParent(); if (f == null) { throw new IllegalArgumentException(
"Cannot create a path to a null Attribute"); final Element t = to.getParent(); if (t == null) { throw new IllegalArgumentException(
@Override public final Object getParentNode(Object contextNode) throws UnsupportedAxisException { if (contextNode instanceof Document) { return null; } if (contextNode instanceof NamespaceContainer) { return ((NamespaceContainer)contextNode).getParentElement(); } if (contextNode instanceof Content) { return ((Content)contextNode).getParent(); } if (contextNode instanceof Attribute) { return ((Attribute)contextNode).getParent(); } return null; }
final Element t = to.getParent(); if (t == null) { throw new IllegalArgumentException(
@Override public final Iterator<?> getParentAxisIterator(Object contextNode) throws UnsupportedAxisException { Parent p = null; if (contextNode instanceof Content) { p = ((Content)contextNode).getParent(); } else if (contextNode instanceof NamespaceContainer) { p = ((NamespaceContainer)contextNode).getParentElement(); } else if (contextNode instanceof Attribute) { p = ((Attribute)contextNode).getParent(); } if (p != null) { return new SingleObjectIterator(p); } return JaxenConstants.EMPTY_ITERATOR; }
public MCRChangeData(String type, Attribute attribute) { this(type, attribute2text(attribute), 0, attribute.getParent()); }
private void filterLang(org.jdom2.Document j2Doc) { XPathFactory xpfac = XPathFactory.instance(); XPathExpression<Attribute> xp = xpfac.compile("//*/@lang", Filters.attribute()); for (Attribute att : xp.evaluate(j2Doc)) { if(!att.getValue().equals(lang)) { att.getParent().detach(); } } }
private void filterLang(org.jdom2.Document j2Doc) { XPathFactory xpfac = XPathFactory.instance(); XPathExpression<Attribute> xp = xpfac.compile("//*/@classifier", Filters.attribute()); for (Attribute att : xp.evaluate(j2Doc)) { boolean remove = true; for(String classifier : classifiers) { if(att.getValue().equals(classifier)) { remove = false; } } if(remove){att.getParent().detach();} } } }