ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* btx/xml tree - entry with missing field
@ 2016-12-22 17:06 Michael Eidenbenz
  2016-12-22 17:30 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Eidenbenz @ 2016-12-22 17:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-22 19:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-22 17:06 btx/xml tree - entry with missing field Michael Eidenbenz
2016-12-22 17:30 ` Hans Hagen
2016-12-22 19:50   ` Michael Eidenbenz

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).