Class JcabiXmlNode
- java.lang.Object
-
- org.eolang.jeo.representation.xmir.JcabiXmlNode
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>attribute(String name)Get attribute.XmlNodechild(String name)Get child node.XmlNodechild(String attribute, String value)Get child node by attribute.Stream<XmlNode>children()Get all child nodes.XmlNodefirstChild()Get first child.booleanhasAttribute(String name, String value)Check if an attribute exists.Optional<XmlNode>optchild(String attribute, String value)Get optional child node by attribute.Stringtext()Retrieve node text content.voidvalidate()Validate the node.List<String>xpath(String xpath)Find elements by xpath.
-
-
-
Method Detail
-
children
public Stream<XmlNode> children()
Description copied from interface:XmlNodeGet all child nodes.
-
attribute
public Optional<String> attribute(String name)
Description copied from interface:XmlNodeGet attribute.
-
xpath
public List<String> xpath(String xpath)
Description copied from interface:XmlNodeFind elements by xpath.
-
child
public XmlNode child(String attribute, String value)
Description copied from interface:XmlNodeGet child node by attribute.
-
optchild
public Optional<XmlNode> optchild(String attribute, String value)
Description copied from interface:XmlNodeGet optional child node by attribute.
-
firstChild
public XmlNode firstChild()
Description copied from interface:XmlNodeGet first child.- Specified by:
firstChildin interfaceXmlNode- Returns:
- First child node.
-
hasAttribute
public boolean hasAttribute(String name, String value)
Description copied from interface:XmlNodeCheck if an attribute exists.- Specified by:
hasAttributein interfaceXmlNode- Parameters:
name- Attribute name.value- Attribute value.- Returns:
- True if an attribute with specified value exists.
-
-