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: Sep 25 2019
Copyright © 2019 Thunderstone Software LLC. All rights reserved.