From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/97001 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Eidenbenz Newsgroups: gmane.comp.tex.context Subject: btx/xml tree - entry with missing field Date: Thu, 22 Dec 2016 18:06:37 +0100 Message-ID: <0091C820-D45C-473B-A986-EF63C14F5CFD@arch.ethz.ch> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/mixed; boundary="===============0099543733524014011==" X-Trace: blaine.gmane.org 1482426434 3379 195.159.176.226 (22 Dec 2016 17:07:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 22 Dec 2016 17:07:14 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Dec 22 18:07:09 2016 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cK6pf-0008PY-2p for gctc-ntg-context-518@m.gmane.org; Thu, 22 Dec 2016 18:07:07 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 625E112202E8; Thu, 22 Dec 2016 18:06:53 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tQhoagaDrwCV; Thu, 22 Dec 2016 18:06:51 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id A9BD712202E3; Thu, 22 Dec 2016 18:06:51 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 7FA2F12202E3 for ; Thu, 22 Dec 2016 18:06:50 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fSTbpyUpNS35 for ; Thu, 22 Dec 2016 18:06:49 +0100 (CET) Original-Received: from edge10.ethz.ch (edge10.ethz.ch [82.130.75.186]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 9777E12202E2 for ; Thu, 22 Dec 2016 18:06:39 +0100 (CET) Original-Received: from CAS22.d.ethz.ch (172.31.51.112) by edge10.ethz.ch (82.130.75.186) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 22 Dec 2016 18:06:31 +0100 Original-Received: from [10.2.89.244] (10.2.89.244) by CAS22.d.ethz.ch (172.31.51.112) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 22 Dec 2016 18:06:38 +0100 X-Mailer: Apple Mail (2.3124) X-Originating-IP: [10.2.89.244] X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:97001 Archived-At: --===============0099543733524014011== Content-Type: multipart/alternative; boundary="Apple-Mail=_BDE758FA-BE78-49E7-8760-5F6745328B72" --Apple-Mail=_BDE758FA-BE78-49E7-8760-5F6745328B72 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" Hello I use the xml interface to list all publications that dont match a = search criteria: /field[@name=3D'keywords' and not (contains(text(),'alpha'))] but there are entries where the keywords field is missing. how can I include them (here "test-3") in the output?=20 Thanks Michael -------------------------- \startbuffer[bib] @article{test-1, title =3D {Article One}, author =3D {A. Foo and X. Bar}, year =3D {2001}, keywords =3D {alpha}, } @book{test-2, title =3D {Book Two}, author =3D {B. Foo}, year =3D {2002}, keywords =3D {beta}, } @whatever{test-3, title =3D {Book Three}, author =3D {C. Foo}, year =3D {2003}, } \stopbuffer \usebtxdataset [database] [bib.buffer] \convertbtxdatasettoxml [database] \startxmlsetups btx:tag \hbox{\xmlatt{#1}{tag}} \stopxmlsetups \startxmlsetups btx:demo \xmlfilter {#1} { /bibtex /* /field[@name=3D'keywords' and not (contains(text(),'alpha'))] /.. /command(btx:tag) } \stopxmlsetups \starttext \xmlsetup{btx:database}{btx:demo} \stoptext Michael Eidenbenz / Senior Researcher eidenbenz@arch.ethz.ch Phone +41 44 632 33 46 Chair of Architecture and Building Process ETH Zurich / Building HIB / Floor E / Room 33 Stefano-Franscini-Platz 1 / CH-8093 Zurich www.bauprozess.arch.ethz.ch / ITA Institute of Technology in Architecture Faculty of Architecture / ETH Zurich www.ita.arch.ethz.ch --Apple-Mail=_BDE758FA-BE78-49E7-8760-5F6745328B72 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="us-ascii" Hello

I use the xml interface to = list all publications that dont match a search criteria:
     /field[@name=3D'keywords'
          &nb= sp; and not (contains(text(),'alpha'))]

but there are entries where the keywords field is missing.
how can I include them (here "test-3") in the = output? 

Thanks Michael

--------------------------

\startbuffer[bib]

@article{test-1,
   title =    =3D {Article One},
   author   =3D {A. Foo and X. = Bar},
   year     =3D = {2001},
   keywords =3D {alpha},
}

@book{test-2,
   title    =3D {Book Two},
   author   =3D {B. Foo},
   year     =3D {2002},
   keywords =3D {beta},
}

@whatever{test-3,
   title    =3D {Book = Three},
   author   =3D {C. = Foo},
   year     =3D = {2003},
}

\stopbuffer

\usebtxdataset [database] [bib.buffer]
\convertbtxdatasettoxml [database]

\startxmlsetups btx:tag
\hbox{\xmlatt{#1}{tag}}
\stopxmlsetups

\startxmlsetups btx:demo
   \xmlfilter {#1} {
     /bibtex
     /*
     /field[@name=3D'keywords'
          &nb= sp; and not (contains(text(),'alpha'))]
     /..
     /command(btx:tag)
   }
\stopxmlsetups

\starttext
\xmlsetup{btx:database}{btx:demo}
\stoptext

Michael Eidenbenz / Senior Researcher
eidenbenz@arch.ethz.ch
Phone +41 44 632 33 = 46

Chair of Architecture and Building = Process
ETH Zurich / Building HIB / Floor E / Room 33
Stefano-Franscini-Platz 1 / CH-8093 Zurich
www.bauprozess.arch.ethz.ch

/ = ITA
Institute of Technology in Architecture
Faculty of Architecture / ETH Zurich
www.ita.arch.ethz.ch

= --Apple-Mail=_BDE758FA-BE78-49E7-8760-5F6745328B72-- --===============0099543733524014011== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============0099543733524014011==--