Copyright © (C) 2011-2021, Erlang Solutions Ltd.
element_with_attr_of_value() = {element_with_attr, binary(), binary()}
element_with_name_and_ns() = {element_with_ns, binary(), binary()}
element_with_ns() = {element_with_ns, binary()}
path() = [cdata | {element, binary()} | {attr, binary()} | element_with_ns() | element_with_name_and_ns() | element_with_attr_of_value()]
attr/2 | Query attribute value by name. |
attr/3 | Query attribute value by name. |
cdata/1 | |
path/2 | Gets the element/attr/cdata contained in the leftmost path Find an element in the xml tree by a path that is pattern-matched against such xml tree structure. |
path/3 | Gets the element/attr/cdata in the leftmost possible described path. |
paths/2 | gets the elements/attrs/cdatas reachable by the described path. |
subelement/2 | |
subelement/3 | |
subelement_with_attr/3 | |
subelement_with_attr/4 | |
subelement_with_name_and_ns/3 | |
subelement_with_name_and_ns/4 | |
subelement_with_ns/2 | |
subelement_with_ns/3 | |
subelements/2 | |
subelements_with_attr/3 | |
subelements_with_name_and_ns/3 | |
subelements_with_ns/2 |
attr(Element::exml:element(), Name::binary()) -> binary() | undefined
Query attribute value by name.
Returns the attribute value associated with Name
if Element
contains such attribute.
Otherwise returns undefined
attr(Xmlel::exml:element(), Name::binary(), Other) -> binary() | Other
Query attribute value by name.
Returns the attribute value associated with Name
if Element
contains such attribute.
Otherwise returns Default
See also: attr/2.
cdata(Xmlel::exml:element()) -> binary()
path(Element::exml:element(), Path::path()) -> exml:element() | binary() | undefined
Gets the element/attr/cdata contained in the leftmost path Find an element in the xml tree by a path that is pattern-matched against such xml tree structure
For example, given an xml document like<message from='alice@localhost' to='alice@localhost/res1' id='id-1'> <result xmlns='urn:xmpp:mam:2' id='BGCH2R2950G1'> <forwarded xmlns='urn:xmpp:forward:0'> <delay xmlns='urn:xmpp:delay' stamp='2021-05-05T08:36:19Z' from='bob@localhost/res1'/> <message from='bob@localhost/res1' xmlns='jabber:client' xml:lang='en' to='alice@localhost/res1' type='chat'> <body>Message from bob to alice</body> </message> </forwarded> </result> </message>The path
[{element_with_ns, <<"result">>, <<"urn:xmpp:mam:2">>}, {element_with_ns, <<"forwarded">>, <<"urn:xmpp:forward:0">>}, {element_with_ns, <<"message">>, <<"jabber:client">>}, {element, <<"body">>}, cdata}],would return
<<"Message from bob to alice">>
path(Xmlel::exml:element(), Rest::path(), Other) -> exml:element() | binary() | Other
Gets the element/attr/cdata in the leftmost possible described path.
Like path/2
but returns the given Default
if no element matches the path.
See also: path/2.
paths(Xmlel::exml:element(), Rest::path()) -> [exml:element() | binary()]
gets the elements/attrs/cdatas reachable by the described path
See also: path/2.
subelement(Element::exml:element(), Name::binary()) -> exml:element() | undefined
subelement(Xmlel::exml:element(), Name::binary(), Other) -> exml:element() | Other
subelement_with_attr(Element::exml:element(), AttrName::binary(), AttrValue::binary()) -> exml:element() | undefined
subelement_with_attr(Element, AttrName, AttrValue, Other) -> SubElement | Other
subelement_with_name_and_ns(Element::exml:element(), Name::binary(), NS::binary()) -> exml:element() | undefined
subelement_with_name_and_ns(Element::exml:element(), Name::binary(), NS::binary(), Other) -> exml:element() | Other
subelement_with_ns(Element::exml:element(), NS::binary()) -> exml:element() | undefined
subelement_with_ns(Xmlel::exml:element(), NS::binary(), Other) -> exml:element() | Other
subelements(Xmlel::exml:element(), Name::binary()) -> [exml:element()]
subelements_with_attr(Xmlel::exml:element(), AttrName::binary(), Value::binary()) -> [exml:element()]
subelements_with_name_and_ns(Xmlel::exml:element(), Name::binary(), NS::binary()) -> [exml:element()]
subelements_with_ns(Xmlel::exml:element(), NS::binary()) -> [exml:element()]
Generated by EDoc