\input lxml-ctx.mkiv \ctxlua{dofile("t:/sources/lxml-lpt.lua")} \startbuffer[xmltest] test a test b test c test d test e test f test g test h test i test j \stopbuffer % \enabletrackers[xml.lparse] \setuplayout[width=middle,height=middle,header=1cm,footer=1cm,topspace=2cm,backspace=2cm] \setupbodyfont[10pt] \setfalse\xmllshowbuffer \starttext \xmllshow{/(*:library|figurelibrary)/*:figure/*:label} \xmllshow{/(*:library|figurelibrary)/figure/*:label} \xmllshow{/(*:library|figurelibrary)/figure/label} \xmllshow{/(*:library|figurelibrary)/figure:*/label} % \xmllshow{collection[@version='all']/resources/manual[match()==1]/paper/command(xml:overview)} % \xmllshow{collection/resources/manual[match()=1]/paper/command(xml:overview)} % \xmllshow{answer//oeps} % \xmllshow{answer/*/oeps} % \xmllshow{answer/**/oeps} % \xmllshow{answer/***/oeps} % \xmllshow{answer/x//oeps} % \xmllshow{answer//x/oeps} % \xmllshow{//x/oeps} % \xmllshow{answer/test/*} % \xmllshow{answer/test/child::} % \xmllshow{answer/*} % \xmllshow{ oeps / answer / .. / * [tag()='p' and position()=1 and text()!=''] / oeps()} % \xmllshow{ artist / name [text()='Randy Newman'] / .. / albums / album [position()=3] / command(first:demo:two)} % \xmllshow{/exa:selectors/exa:selector/exa:list/component[count()>1]} \stoptext \xmllshow{/*} \xmllshow{child::} \xmllshow{child::test} \xmllshow{/test/test} \xmllshow{../theory/sections/section/exercises} \xmllshow{../training/practicalassignments} \xmllshow{../../Outcome[position()=rootposition()]/Condition/command(xml:answer:mc:condition)} % \stoptext % \typebuffer[xmltest] \page \xmllshowbuffer{xmltest}{**}{id} \xmllshowbuffer{xmltest}{*}{id} \xmllshowbuffer{xmltest}{..}{id} \xmllshowbuffer{xmltest}{.}{id} \xmllshowbuffer{xmltest}{//}{id} \xmllshowbuffer{xmltest}{/}{id} \xmllshowbuffer{xmltest}{**/}{id} \xmllshowbuffer{xmltest}{**/*}{id} \xmllshowbuffer{xmltest}{**/.}{id} \xmllshowbuffer{xmltest}{**//}{id} \xmllshowbuffer{xmltest}{*/}{id} \xmllshowbuffer{xmltest}{*/*}{id} \xmllshowbuffer{xmltest}{*/.}{id} \xmllshowbuffer{xmltest}{*//}{id} \xmllshowbuffer{xmltest}{/**/}{id} \xmllshowbuffer{xmltest}{/**/*}{id} \xmllshowbuffer{xmltest}{/**/.}{id} \xmllshowbuffer{xmltest}{/**//}{id} \xmllshowbuffer{xmltest}{/*/}{id} \xmllshowbuffer{xmltest}{/*/*}{id} \xmllshowbuffer{xmltest}{/*/.}{id} \xmllshowbuffer{xmltest}{/*//}{id} \xmllshowbuffer{xmltest}{./}{id} \xmllshowbuffer{xmltest}{./*}{id} \xmllshowbuffer{xmltest}{./.}{id} \xmllshowbuffer{xmltest}{.//}{id} \xmllshowbuffer{xmltest}{../}{id} \xmllshowbuffer{xmltest}{../*}{id} \xmllshowbuffer{xmltest}{../.}{id} \xmllshowbuffer{xmltest}{..//}{id} \xmllshowbuffer{xmltest}{descendant::whocares/ancestor::whoknows}{id} \xmllshowbuffer{xmltest}{descendant::whocares/ancestor::whoknows/parent::}{id} \xmllshowbuffer{xmltest}{descendant::whocares/ancestor::}{id} \xmllshowbuffer{xmltest}{child::something/child::whatever/child::whocares}{id} \xmllshowbuffer{xmltest}{child::something/child::whatever/child::whocares|whoknows}{id} \xmllshowbuffer{xmltest}{child::something/child::whatever/child::(whocares|whoknows)}{id} \xmllshowbuffer{xmltest}{child::something/child::whatever/child::!(whocares|whoknows)}{id} \xmllshowbuffer{xmltest}{child::something/child::whatever/child::(whocares)}{id} \xmllshowbuffer{xmltest}{child::something/child::whatever/child::(whocares)[position()>2]}{id} \xmllshowbuffer{xmltest}{child::something/child::whatever[position()>2][position()=1]}{id} \xmllshowbuffer{xmltest}{child::something/child::whatever[whocares][whocaresnot]}{id} \xmllshowbuffer{xmltest}{child::something/child::whatever[whocares][not(whocaresnot)]}{id} \xmllshowbuffer{xmltest}{child::something/child::whatever/self::whatever}{id} \xmllshowbuffer{xmltest}{/something/whatever}{id} \xmllshowbuffer{xmltest}{something/whatever}{id} \xmllshowbuffer{xmltest}{/**/whocares}{id} \xmllshowbuffer{xmltest}{whoknows/whocares}{id} \xmllshowbuffer{xmltest}{whoknows}{id} \xmllshowbuffer{xmltest}{whocares[contains(text(),'f') or contains(text(),'g')]}{id} \xmllshowbuffer{xmltest}{whocares/first()}{id} \xmllshowbuffer{xmltest}{whocares/last()}{id} \xmllshowbuffer{xmltest}{whatever/all()}{id} \xmllshowbuffer{xmltest}{whocares/position(2)}{id} \xmllshowbuffer{xmltest}{whocares/position(-2)}{id} \xmllshowbuffer{xmltest}{whocares[1]}{id} \xmllshowbuffer{xmltest}{whocares[-1]}{id} \xmllshowbuffer{xmltest}{whocares[2]}{id} \xmllshowbuffer{xmltest}{whocares[-2]}{id} \xmllshowbuffer{xmltest}{whatever[3]/attribute(id)}{id} \xmllshowbuffer{xmltest}{whatever[2]/attribute('id')}{id} \xmllshowbuffer{xmltest}{whatever[3]/text()}{id} \xmllshowbuffer{xmltest}{/whocares/first()}{id} \xmllshowbuffer{xmltest}{/whocares/last()}{id} \xmllshowbuffer{xmltest}{xml://whatever/all()}{id} \xmllshowbuffer{xmltest}{whatever/all()}{id} \xmllshowbuffer{xmltest}{//whocares}{id} \xmllshowbuffer{xmltest}{..[2]}{id} \xmllshowbuffer{xmltest}{../*[2]}{id} \xmllshowbuffer{xmltest}{/(whocares|whocaresnot)}{id} \xmllshowbuffer{xmltest}{/!(whocares|whocaresnot)}{id} \xmllshowbuffer{xmltest}{/!whocares}{id} % \page % \xmllshow{/interface/command/command(xml:setups:register)} % \xmllshow{/interface/command[@name='xxx']/command(xml:setups:typeset)} % \xmllshow{/arguments/*} % \xmllshow{/sequence/first()} % \xmllshow{/arguments/text()} % \xmllshow{/sequence/variable/first()} % \xmllshow{/interface/define[@name='xxx']/first()} % \xmllshow{/parameter/command(xml:setups:parameter:measure)} % \page % \xmllshow{interface/command/command(xml:setups:register)} % \xmllshow{interface/command[@name='xxx']/command(xml:setups:typeset)} % \xmllshow{arguments/*} % \xmllshow{sequence/first()} % \xmllshow{arguments/text()} % \xmllshow{sequence/variable/first()} % \xmllshow{interface/define[@name='xxx']/first()} % \xmllshow{parameter/command(xml:setups:parameter:measure)} \stoptext