Skip to content

Xml2XPathObject

[Source]

Factory for converting a raw libxml2 xmlXPathObject* into a high-level Xml2XPathResult (nodes, boolean, number, or string) usable from Pony.

primitive val Xml2XPathObject

Constructors

create

[Source]

new val create()
: Xml2XPathObject val^

Returns


Public Functions

apply

[Source]

Wrap a nullable xmlXPathObject* and return an Xml2XPathResult matching the XPath result type.

Behaviour:

  • If ptrx is None or cannot be dereferenced, returns None.
  • If the XPath type is nodeset and nodesetval is non-null, converts it into an Array[Xml2Node], one wrapper per node in the set.
  • If the type is boolean, returns a Pony Bool (true when boolval == 1, otherwise false).
  • If the type is number, returns a Pony F64 from floatval.
  • If the type is string, returns an immutable Pony String cloned from stringval.
  • 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

Returns


eq

[Source]

fun box eq(
  that: Xml2XPathObject val)
: Bool val

Parameters

Returns


ne

[Source]

fun box ne(
  that: Xml2XPathObject val)
: Bool val

Parameters

Returns