Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xml::xupdate::libxml(3pm) [debian man page]

XML::XUpdate::LibXML(3pm)				User Contributed Perl Documentation				 XML::XUpdate::LibXML(3pm)

NAME
XML::XUpdate::LibXML - Simple implementation of XUpdate format SYNOPSIS
use XML::LibXML; use XML::XUpdate::LibXML; $parser = XML::LibXML->new(); $dom = $parser->parse_file("mydoc.xml"); $actions = $parser->parse_file("update.xml"); $xupdate = XML::XUpdate::LibXML->new(); $xupdate->process($dom->getDocumentElement(), $actions); print $dom->toString()," "; DESCRIPTION
This module implements the XUpdate format described in XUpdate Working Draft from 2000-09-14 (http://www.xmldb.org/xupdate/xupdate-wd.html). The implementation is based on XML::LibXML DOM API. "new" my $xupdate = XML::XUpdate::LibXML->new(); Creates a new XUpdate object. You may use this object to update several different DOM trees using several different XUpdate descriptions. The advantage of it is that an xupdate object remembers values all variables declared in XUpdate documents. "$xupdate->registerNs($prefix,$uri)" Tell the XPath engine to resolve given namespace prefix as the given namespace URI. This is particularly useful to bind a default namespace to a prefix because XPath doesn't honour default namespaces. "$xupdate->process($document_dom,$xupdate_dom)" This function takes two DOM trees as its arguments. It works by updating the first tree according to all XUpdate commands included in the second one. All XUpdate commands must be children of the root element of the second tree and must all belong to XUpdate namespace "http://www.xmldb.org/xupdate". The namespace URI may be changed with set_namespace method. "$xupdate->set_namespace($URI)" You may use this method to change the namespace of XUpdate elements. The default namespace is "http://www.xmldb.org/xupdate". "$xupdate->namespace()" Returns XUpdate namespace URI used by XUpdate processor to identify XUpdate commands. EXPORT None. DIFFERENCES BETWEEN 0.2.x and 0.3.x In 0.3.x different implementation of XUpdate variables is used. Now variables contain the actual objects resulting from an XPath query, and not their textual content as in versions 0.2.x of XML::XUpdate::LibXML. Also, value-of instruction results in copies of the actual objects it selects rather than their textual content as in 0.2.x. I hope the new implementation is more conformant with the (not very clear) XUpdate Working Draft and therefore more compatible with other XUpdate implementations. DIFFERENCES BETWEEN 0.3.x and 0.4.x Commands are applied to all nodes of the select nodeset, not just the first one. DIFFERENCES BETWEEN 0.4.x and 0.5.x XML::LibXML::XPathContext is used for variable code providing more flexible and powerfull implementation. New and hopefully correct implementation of the problematic child attribute of update command has been introduced. Support for registrering namespace prefix with the XPath engine (allows binding document's default namespace to a prefix). Several bug fixes. DIFFERENCES BETWEEN 0.5.x and 0.6.x xu:if command implementation contributed by Amir Guindehi. AUTHOR
Petr Pajas, pajas@matfyz.cz COPYRIGHT
Copyright 2002-2005 Petr Pajas, All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
XML::LibXML XML::LibXML::XPathContext perl v5.10.1 2005-05-13 XML::XUpdate::LibXML(3pm)

Check Out this Related Man Page

XML::LibXML::Namespace(3)				User Contributed Perl Documentation				 XML::LibXML::Namespace(3)

NAME
XML::LibXML::Namespace - XML::LibXML Namespace Implementation SYNOPSIS
use XML::LibXML; # Only methods specific to Namespace nodes are listed here, # see XML::LibXML::Node manpage for other methods my $ns = XML::LibXML::Namespace->new($nsURI); print $ns->nodeName(); print $ns->name(); $localname = $ns->getLocalName(); print $ns->getData(); print $ns->getValue(); print $ns->value(); $known_uri = $ns->getNamespaceURI(); $known_prefix = $ns->getPrefix(); $key = $ns->unique_key(); DESCRIPTION
Namespace nodes are returned by both $element->findnodes('namespace::foo') or by $node->getNamespaces(). The namespace node API is not part of any current DOM API, and so it is quite minimal. It should be noted that namespace nodes are not a sub class of XML::LibXML::Node, however Namespace nodes act a lot like attribute nodes, and similarly named methods will return what you would expect if you treated the namespace node as an attribute. Note that in order to fix several inconsistencies between the API and the documentation, the behavior of some functions have been changed in 1.64. METHODS
new my $ns = XML::LibXML::Namespace->new($nsURI); Creates a new Namespace node. Note that this is not a 'node' as an attribute or an element node. Therefore you can't do call all XML::LibXML::Node Functions. All functions available for this node are listed below. Optionally you can pass the prefix to the namespace constructor. If this second parameter is omitted you will create a so called default namespace. Note, the newly created namespace is not bound to any document or node, therefore you should not expect it to be available in an existing document. declaredURI Returns the URI for this namespace. declaredPrefix Returns the prefix for this namespace. nodeName print $ns->nodeName(); Returns "xmlns:prefix", where prefix is the prefix for this namespace. name print $ns->name(); Alias for nodeName() getLocalName $localname = $ns->getLocalName(); Returns the local name of this node as if it were an attribute, that is, the prefix associated with the namespace. getData print $ns->getData(); Returns the URI of the namespace, i.e. the value of this node as if it were an attribute. getValue print $ns->getValue(); Alias for getData() value print $ns->value(); Alias for getData() getNamespaceURI $known_uri = $ns->getNamespaceURI(); Returns the string "http://www.w3.org/2000/xmlns/" getPrefix $known_prefix = $ns->getPrefix(); Returns the string "xmlns" unique_key $key = $ns->unique_key(); This method returns a key guaranteed to be unique for this namespace, and to always be the same value for this namespace. Two namespace objects return the same key if and only if they have the same prefix and the same URI. The returned key value is useful as a key in hashes. AUTHORS
Matt Sergeant, Christian Glahn, Petr Pajas VERSION
2.0110 COPYRIGHT
2001-2007, AxKit.com Ltd. 2002-2006, Christian Glahn. 2006-2009, Petr Pajas. LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2014-02-01 XML::LibXML::Namespace(3)
Man Page