Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Libraries

    XTM::Path 0.37

    Download button

    No screenshots available
    Downloads: 360  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Robert Barta | More programs
    Perl Artistic License / FREE
    January 5th, 2007, 21:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    XTM::Path description

    XTM::Path is a Perl module with topic map management, XPath like retrieval and construction facility.

    XTM::Path is a Perl module with topic map management, XPath like retrieval and construction facility.

    SYNOPSIS

    use XTM::XML;
    $tm = new XTM (tie => new XTM::XML (file => 'mymap.tm')); # binds variable to channel

    use XTM::Path;
    my $xtmp = new XTM::Path (default => $tm);

    # find particular topics and print topic id
    foreach my $t ($xtmp->find ('/topic[.//baseNameString/text() = "test"]')) {
    print $t->id;
    }

    # same using find twice
    foreach my $t ($xtmp->find ('/topic[.//baseNameString/text() = "test"]')) {
    print $xtmp->find ('@id', $t);
    }

    # create a topic
    $t = $xtmp->create ('topic[@id = "id0815"]');
    # same but with baseName
    $t = $xtmp->create ('topic[@id = "id0815"]/baseNameString[text() = "test"]');
    # associations are always cumbersome
    $a = $xtmp->create ('association[member
    [roleSpec/topicRef/@href = "#role1"]
    [topicRef/@href = "#player1"]]
    [member
    [roleSpec/topicRef/@href = "#role2"]
    [topicRef/@href = "#player2"]]');

    This class provides a simple way to drill down the XTM data structures by following an XPath like approach.

    The XTM standard (http://www.topicmaps.org/xtm/) is used as the basis to formulate XTM-Path queries. To find a particular topic, for instance, you might use
    /topic[.//baseNameString = "some name"]

    It is important to note that this package will NOT work on the original XTM document (this might even not exist if the map is created via other means), but is instead using the XTM::base data structure. This implies that all querying is done after merging and consolidation has been done.

    Obviously, XTM::Path cannot be a complete query language, but it is useful in many development situations where drilling down the data structure is a cumbersome exercise. Together with intelligent add methods in XTM::Memory and XTM::generic this should simplify drastically the access, creation and manipulation of XTM data structures.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    map management | construction facility | Perl module | XTM::Path | map | management

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM