xmlAddNs
Add a namespace to a XML Element
Syntax
xmlAddNs(elem, [, ns1 [, ns2, ...]])
Arguments
- elem
a mlist typed XMLElem
- nsi
a mlist typed XMLNs
Description
Add one or more namespaces to an element
Examples
doc = xmlDocument("TMPDIR/foo.xml"); doc.root = xmlElement(doc, "root"); a = xmlElement(doc, "a"); b = xmlElement(doc, "b"); ns_scilab = xmlNs(a, "scilab", "https://www.scilab.org"); ns_balics = xmlNs(a, "balics", "http://gro.balics.www"); xmlAddNs(b, ns_scilab, ns_balics); doc.root.children(1) = a; doc.root.children(2) = b; xmlDump(doc) xmlDelete(doc);
See also
- XML Objects — Describe the properties of the different XML objects
- xmlDocument — Create a new XML document
- xmlElement — Create a new XML element
- xmlNs — Create a new XML Namespace
- xmlGetNsByHref — Get a namespace by its href
- xmlGetNsByPrefix — Get a namespace by prefix
History
Version | Description |
5.4.0 | XML module introduced. |
Report an issue | ||
<< htmlWrite | XML Management | xmlAppend >> |