xmlTreeNewAttribute

SYNOPSIS

xmlNode xmlTreeNewAttribute(xmlNode parent, string name,
                                [, string content[, xmlNs ns]])

Parameters:

  • parent - the xmlNode to create the attribute on

  • name - the name of the new attribute

  • content (optional) - the content for the attribute

  • ns (optional) - the namespace to use for the attribute

Returns:

  • the xmlNode for the new attribute


DESCRIPTION
xmlTreeNewAttribute() creates a new attribute. Attribute names must be unique, so if another attribute with the same name already exists, the existing one will be unlinked.


EXAMPLE

<$attr = (xmlTreeNewAttribute($element, 'id', '12345'))>


SEE ALSO
xmlTreeNewElement, xmlTreeNewPI, xmlTreeNewText, xmlTreeNewCDATA, xmlTreeNewComment, xmlTreeNewNs


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