Hi Serena,
try changing "transation" to "transaction". Change "$transation/istype='udp'" to "$transaction/istype/@type eq 'type1'".
Hartelijke groet,
Huib Verweij.
-- Drs. Huib Verweij Senior software developer - The Language Archive Max Planck Institute for Psycholinguistics P.O. Box 310 6500 AH Nijmegen The Netherlands t +31-24-3521911 e huib.verwey@mpi.nlmailto:huib.verwey@mpi.nl w http://www.mpi.nl/
Op 6 jul 2011, om 20:37 heeft Lusha Wang het volgende geschreven:
Hello Everyone I am a newbie to baseX For the following xml, how can I select all the transactions with type udp. This command doesn't work: for $transation in doc('test')//transation where $transation/istype='udp' return <transation>{ $transation/@id }</transation>
Thanks a million Serena Wang
<root> <Journal> <Document id="1"> <Author name="do-not-reply%40domaintools.com" reputation="1.0"/> <Time>Sat, 1 May 2010 00:55:20 -0700 (PDT)</Time> <Entity> <URL>http%3A%2F%2Fwww.domaintools.com%2Fmark-alert%2F</URL> <Domain>mexicoisart.com</Domain> <IP>199.236.158.250</IP> </Entity> </Document> <Document id="2"> <Author name="apache%40den.giac.net+%28Apache%29" reputation="10.0"/> <Time>Sat, 1 May 2010 10:35:54 +0000 (UTC)</Time> <Entity> <URL>https%3A%2F%2Fisc.sans.org%2Fdiary.html%3Fstoryid%3D8605</URL> <IP>66.28.0.45</IP> </Entity> </Document> </Journal> <transactions> <transation id="56977"> <time>09 Sep 10 23:00:52</time> <istype type="type1"/> <src>10.8.124.143</src> <dst>66.28.0.45</dst> <status>INT</status> </transation> </transactions> <types> <type id="type1"> <name>udp</name> </type> </types> </root> _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.demailto:BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk