ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Michael Eidenbenz <eidenbenz@arch.ethz.ch>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: btx/xml tree - entry with missing field
Date: Thu, 22 Dec 2016 18:06:37 +0100	[thread overview]
Message-ID: <0091C820-D45C-473B-A986-EF63C14F5CFD@arch.ethz.ch> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1614 bytes --]

Hello

I use the xml interface to list all publications that dont match a search criteria:

     /field[@name='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? 

Thanks Michael

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

\startbuffer[bib]

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

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

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

\stopbuffer

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

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

\startxmlsetups btx:demo
   \xmlfilter {#1} {
     /bibtex
     /*
     /field[@name='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 <mailto: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 <http://www.bauprozess.arch.ethz.ch/>

/ ITA
Institute of Technology in Architecture
Faculty of Architecture / ETH Zurich
www.ita.arch.ethz.ch <http://www.ita.arch.ethz.ch/>


[-- Attachment #1.2: Type: text/html, Size: 3674 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

             reply	other threads:[~2016-12-22 17:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-22 17:06 Michael Eidenbenz [this message]
2016-12-22 17:30 ` Hans Hagen
2016-12-22 19:50   ` Michael Eidenbenz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0091C820-D45C-473B-A986-EF63C14F5CFD@arch.ethz.ch \
    --to=eidenbenz@arch.ethz.ch \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).