xmlTreeXPathRegisterNs

SYNOPSIS

int xmlTreeXPathRegisterNs(xmlXPath xpath, string prefix,
                               string URI)

Parameters:

  • xpath - the xmlXPath to register a namespace for

  • prefix - the prefix for the namespace

  • URI - the URI for the namespace

Returns:

  • 0 - success

  • -1 - error


DESCRIPTION
xmlTreeXPathRegisterNs() registers a prefix that can be used in an XPath expression. This does not affect the document the xpath is operating on in any way, and only applies to XPath expressions that execute on the xmlXPath object.


EXAMPLE

<$xpath = (xmlTreeNewXPath($doc))>
 <$ret = (xmlTreeXPathRegisterNs($xpath,
             'ts', 'urn:Thunderstone'))>
  <$nodes = (xmlTreeXPathExecute($xpath, '//ts:item[@price>5]'))>


SEE ALSO
xmlTreeNewXPath, xmlTreeXPathExecute


Copyright © Thunderstone Software     Last updated: Apr 15 2024
Copyright © 2024 Thunderstone Software LLC. All rights reserved.