GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  XML::TINYXML::SELECTOR::XPATH (3)

.ds Aq ’

NAME

XML::TinyXML::Selector::XPath - XPath-compliant selector for XML::TinyXML

CONTENTS

SYNOPSIS



  use XML::TinyXML;

  # first obtain an xml context:
  $xml = XML::TinyXML->new("rootnode", param => "somevalue", attrs => { attr1 => v1, attr2 => v2 });

  $selector = XML::TinyXML::Selector->new($xml, "XPath");

  #####
  Assuming the following xml data :
  <?xml version="1.0"?>
  <xml>
    <hello>world</hello>
    <foo>
      <![CDATA[ this should unescape <&; etc... :) ]]>
    </foo>
    <parent>
      <child1/>
      <child2/>
      <child3/>
    </parent>
    <parent>
      <blah>SECOND</blah>
    </parent>
  </xml>
  #####

  @res = $selector->select(//parent);
  @res = $selector->select(//child*);
  @res = $selector->select(/parent[2]/blah/..);
  @res = $selector->select(//blah/..);
  @res = $selector->select(//parent[1]/..);
  @res = $selector->select(//parent[1]/.);
  @res = $selector->select(//blah/.);

  # or using the unabbreviated syntax:

  @res = $selector->select(/descendant-or-self::node()/child::parent);
  @res = $selector->select(/descendant-or-self::node()/child::child*);
  @res = $selector->select(/child::parent[2]/child::blah/parent::node());
  @res = $selector->select(/descendant-or-self::node()/child::blah/parent::node());
  @res = $selector->select(/descendant-or-self::node()/child::parent[1]/parent::node());
  @res = $selector->select(/descendant-or-self::node()/child::parent[1]/self::node());
  @res = $selector->select(/descendant-or-self::node()/child::blah/self::node());


  # refer to XPath documentation for further examples and details on the supported syntax:
  # ( http://www.w3.org/TR/xpath )



DESCRIPTION

XPath-compliant selector for XML::TinyXML

INSTANCE VARIABLES

METHODS

o init ()
o select ($expr, [ $cnode ])

SEE ALSO

XML::TinyXML XML::TinyXML::Node XML::TinyXML::Selector

AUTHOR

xant, <xant@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2009-2010 by xant

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 XML::TINYXML::SELECTOR::XPATH (3) 2013-09-16

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.