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.XmlNode
child(String name)
Get child node.XmlNode
child(String attribute, String value)
Get child node by attribute.Stream<XmlNode>
children()
Get all child nodes.XmlNode
firstChild()
Get first child.boolean
hasAttribute(String name, String value)
Check if an attribute exists.Optional<XmlNode>
optchild(String attribute, String value)
Get optional child node by attribute.String
text()
Retrieve node text content.void
validate()
Validate the node.List<String>
xpath(String xpath)
Find elements by xpath.
-
-
-
Method Detail
-
children
public Stream<XmlNode> children()
Description copied from interface:XmlNode
Get all child nodes.
-
attribute
public Optional<String> attribute(String name)
Description copied from interface:XmlNode
Get attribute.
-
xpath
public List<String> xpath(String xpath)
Description copied from interface:XmlNode
Find elements by xpath.
-
child
public XmlNode child(String attribute, String value)
Description copied from interface:XmlNode
Get child node by attribute.
-
optchild
public Optional<XmlNode> optchild(String attribute, String value)
Description copied from interface:XmlNode
Get optional child node by attribute.
-
firstChild
public XmlNode firstChild()
Description copied from interface:XmlNode
Get first child.- Specified by:
firstChild
in interfaceXmlNode
- Returns:
- First child node.
-
hasAttribute
public boolean hasAttribute(String name, String value)
Description copied from interface:XmlNode
Check if an attribute exists.- Specified by:
hasAttribute
in interfaceXmlNode
- Parameters:
name
- Attribute name.value
- Attribute value.- Returns:
- True if an attribute with specified value exists.
-
-