ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* xml selection on attribute expressions
@ 2013-12-03  9:14 H. van der Meer
  2013-12-03  9:18 ` H. van der Meer
  0 siblings, 1 reply; 2+ messages in thread
From: H. van der Meer @ 2013-12-03  9:14 UTC (permalink / raw)
  To: NTG ConTeXt


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

Following an example in the chapter on Expressions and filters for xml-processing one can select on an attribute ‘name’ in the node <file name=“whatever”/>

   file[@name=="whatever”]/command(todo) 

However, I would like to select on a combination of alternatives, so that equivalent are
    <file name=“whatever”/> and  <file src=“whatever”/>

I tried several variations but none of them work.
   \xmlfilter{#1}{file([@name=="whatever”] or [@src=="whatever”])/command(todo)
   \xmlfilter{#1}{file[@name=="whatever”] or [@src=="whatever”]/command(todo)
   \xmlfilter{#1}{file[@name=="whatever”] or file[@src=="whatever”]/command(todo)
   \xmlfilter{#1}{(file[@name=="whatever”]|file[@src=="whatever”])/command(todo)


How to? Or is this impossible?

Hans van der Meer




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

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: xml selection on attribute expressions
  2013-12-03  9:14 xml selection on attribute expressions H. van der Meer
@ 2013-12-03  9:18 ` H. van der Meer
  0 siblings, 0 replies; 2+ messages in thread
From: H. van der Meer @ 2013-12-03  9:18 UTC (permalink / raw)
  To: NTG ConTeXt


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

Sorry for the noise, but I just forget to try the obvious and correct solution:

   \xmlfilter{#1}{file[@name=="whatever" or @src=="whatever"]/command(todo)}

Must have been a temporary ‘blindness’.

Hans van der Meer



On 3 dec. 2013, at 10:14, H. van der Meer <H.vanderMeer@uva.nl> wrote:

> Following an example in the chapter on Expressions and filters for xml-processing one can select on an attribute ‘name’ in the node <file name=“whatever”/>
> 
>    file[@name=="whatever”]/command(todo) 
> 
> However, I would like to select on a combination of alternatives, so that equivalent are
>     <file name=“whatever”/> and  <file src=“whatever”/>
> 
> I tried several variations but none of them work.
>    \xmlfilter{#1}{file([@name=="whatever”] or [@src=="whatever”])/command(todo)
>    \xmlfilter{#1}{file[@name=="whatever”] or [@src=="whatever”]/command(todo)
>    \xmlfilter{#1}{file[@name=="whatever”] or file[@src=="whatever”]/command(todo)
>    \xmlfilter{#1}{(file[@name=="whatever”]|file[@src=="whatever”])/command(todo)
> 
> 
> How to? Or is this impossible?
> 
> Hans van der Meer
> 
> 
> 
> ___________________________________________________________________________________
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________


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

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2013-12-03  9:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-03  9:14 xml selection on attribute expressions H. van der Meer
2013-12-03  9:18 ` H. van der Meer

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