XPath2Go

Dit is veel sneller dan DbXML, maar is het ook sneller dan libxml2?
Eerste tests: 4.3 tot 4.8 keer zo snel als libxml2
Zie ook: time.txt

Voorbeelden complexer xquery

We gaan fietsen met dat kind .
dependency structure
boomweergave van xml
een terminal wordt weergegeven in twee delen
<?xml version="1.0"?>
<alpino_ds">
  <node cat="top">
    <node rel="--" cat="smain" >
      <node rel="su" pt="vnw" word="We" index="1" />
      <node rel="hd" pt="ww" word="gaan" />
      <node rel="vc" cat="inf">
        <node rel="su" index="1" />
        <node rel="hd" pt="ww" word="fietsen" />
        <node rel="mod" cat="pp">
          <node rel="hd" pt="vz" word="met" />
          <node rel="obj1" cat="np">
            <node rel="det" pt="vnw" word="dat" />
            <node rel="hd" pt="n" word="kind" />
          </node>
        </node>
      </node>
    </node>
    <node rel="--" pt="let" word="." />
  </node>
  <sentence>We gaan fietsen met dat kind .</sentence>
</alpino_ds>
xpath: //aap[@noot]
SORT
  COLLECT  'child' 'name' 'node' aap
    COLLECT  'descendant-or-self' 'type' 'node'
      ROOT
    PREDICATE
      COLLECT  'attributes' 'name' 'node' noot
        NODE
&xPath{
    arg1: &dSort{
        arg1: &dCollect{
            ARG: collect__child__aap,
            arg1: &dCollect{
                ARG:  collect__descendant__or__self__type__node,
                arg1: &dRoot{},
            },
            arg2: &dPredicate{
                arg1: &dCollect{
                    ARG:  collect__attributes__noot,
                    arg1: &dNode{},
                },
            },
        },
    },
}
xpath: //aap/@noot
SORT
  COLLECT  'attributes' 'name' 'node' noot
    COLLECT  'descendant' 'name' 'node' aap
      ROOT
&xPath{
    arg1: &dSort{
        arg1: &dCollect{
            ARG: collect__attributes__noot,
            arg1: &dCollect{
                ARG:  collect__descendant__aap,
                arg1: &dRoot{},
            },
        },
    },
}
xpath: $aap/noot
SORT
  COLLECT  'child' 'name' 'node' noot
    VARIABLE aap
&xPath{
    arg1: &dSort{
        arg1: &dCollect{
            ARG: collect__child__noot,
            arg1: &dVariable{
                VAR: aap,
            },
        },
    },
}
Demo's:
  1. minimale opzet
  2. assen zoals ancestors vooraf compileren
  3. XPath 2
  4. indexen
  5. extra info in context en nodes (zoals in alud)
  6. variabelen in XPath (zoals in alud)
  7. als alternatief voor xquery