|
SYNOPSIS
xmlNs xmlTreeNewNs(xmlNode element, string prefix, string URI)
Parameters:
-
parent - the element that will be parent of this xmlNs -
prefix - the prefix for the new namespace. '' may
be used to indicate no prefix. -
URI - the URI for the new namespace. '' may be
used for the default, empty namespace.
Returns:
- the
xmlNs of the new namespace
DESCRIPTION
xmlTreeNewNs() creates a new namespace declaration on
element. This xmlNs can then be assigned to nodes via
xmlTreeSetNs() to put nodes in that namespace.
EXAMPLE Given an xml document
<rootNode>
<item>stuff</item>
</rootNode>
calling the following
<$root = (xmlTreeGetRootElement($doc))>
<$ns = (xmlTreeNewNs($root, 'ts',
'http://www.thunderstone.com'))>
<$ret = (xmlTreeSetNs($root, $ns))>
and printing the doc will produce
<ts:rootNode xmlns:ts="http://www.thunderstone.com">
<item>stuff</item>
</ts:rootNode>
SEE ALSO
xmlTreeNewElement,
xmlTreeNewPI,
xmlTreeNewText,
xmlTreeNewCDATA,
xmlTreeNewComment,
xmlTreeNewAttribute
Copyright © Thunderstone Software Last updated: Mon Feb 18 10:28:15 EST 2013
|