Xml2XPathObject¶
Factory for converting a raw libxml2 xmlXPathObject* into a high-level
Xml2XPathResult (nodes, boolean, number, or string) usable from Pony.
Constructors¶
create¶
Returns¶
- Xml2XPathObject val^
Public Functions¶
apply¶
Wrap a nullable xmlXPathObject* and return an Xml2XPathResult
matching the XPath result type.
Behaviour:
- If
ptrxisNoneor cannot be dereferenced, returnsNone. - If the XPath type is
nodesetandnodesetvalis non-null, converts it into anArray[Xml2Node], one wrapper per node in the set. - If the type is
boolean, returns a PonyBool(truewhenboolval == 1, otherwisefalse). - If the type is
number, returns a PonyF64fromfloatval. - If the type is
string, returns an immutable PonyStringcloned fromstringval. - For undefined, point, range, location-set, user, or XSLT-tree types,
returns
None(currently unsupported).
This function does not take ownership of the underlying xmlXPathObject*
lifetime; it only interprets its contents and wraps them into Pony data
structures.
fun box apply(
xml2doc: Xml2Doc tag,
ptrx: NullablePointer[XmlXPathObject ref] ref)
: (None val | Array[Xml2Node ref] ref | Bool val |
String val | F64 val)
Parameters¶
- xml2doc: Xml2Doc tag
- ptrx: NullablePointer[XmlXPathObject ref] ref
Returns¶
eq¶
Parameters¶
- that: Xml2XPathObject val
Returns¶
- Bool val
ne¶
Parameters¶
- that: Xml2XPathObject val
Returns¶
- Bool val