ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans van der Meer via ntg-context <ntg-context@ntg.nl>
To: NTG ConTeXt <ntg-context@ntg.nl>
Cc: Hans van der Meer <havdmeer@ziggo.nl>
Subject: [NTG-context] Re: attribute selection
Date: Wed, 30 Aug 2023 13:59:32 +0200	[thread overview]
Message-ID: <131A5BC2-F30D-4766-83C6-85B32AFEA154@ziggo.nl> (raw)
In-Reply-To: <0596FD9A-5F81-4C0A-A924-9FE55621BD8E@ziggo.nl>


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

Finally I saw the problem. Calling \xmlfilter{#1}{./node/command(demo:attribute:node)} is the right way.
Sorry for the noise.

dr. Hans van der Meer
> On 30 Aug 2023, at 13:49, Hans van der Meer via ntg-context <ntg-context@ntg.nl> wrote:
> 
> This line of code comes from the xml documentation (page 31):
> \xmlfilter{#1}{./node[@type=="cleanup"]}
> It should select among the <node>'s those with <node type="cleanup">.
> However, this node is not selected in the call to \xmlfilter.
> Where am I wrong?
> 
> MWE follows
> 
> 
> % failure to typeset attribute selected.
> \setuppapersize[A5][A5]
> \startxmlsetups demo:attribute
> 	\xmlsetsetup{#1}{root|node}{demo:attribute:*}
> \stopxmlsetups
> \xmlregisterdocumentsetup{demo}{demo:attribute}
> \startxmlsetups demo:attribute:root
> 	Execute \type{\xmlall{#1}{./node}}
> 		\crlf
> 		\xmlall{#1}{./node}
> 		\crlf
> 	Execute \type{\xmlfilter{#1}{./node[@type=="cleanup"]}}
> 		\xmlfilter{#1}{./node[@type=="cleanup"]}
> 		\crlf
> \stopxmlsetups
> \startxmlsetups demo:attribute:node
> 	calling node <\xmltag{#1}>
> 	\xmlflush{#1}
> 	\crlf
> \stopxmlsetups
> \startbuffer[attribute]
> <root>
> <node>no attribute</node>
> <node type="cleanup">attribute type = cleanup</node>
> </root>
> \stopbuffer
> \startbuffer[attribute2]
> <root>
> <node>no attribute</node>
> <node type="cleanup">attribute type=cleanup</node>
> </root>
> \stopbuffer
> \starttext
> \ConTeXt\ version\contextversion\blank
> \xmlprocessbuffer{demo}{attribute}{}
> \stoptext
> 
> <xml-tex-attribute-select.pdf>
> 
> 
> 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 / https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : https://contextgarden.net
> ___________________________________________________________________________________


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

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

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

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

      reply	other threads:[~2023-08-30 12:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-30 11:49 [NTG-context] " Hans van der Meer via ntg-context
2023-08-30 11:59 ` Hans van der Meer via ntg-context [this message]

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=131A5BC2-F30D-4766-83C6-85B32AFEA154@ziggo.nl \
    --to=ntg-context@ntg.nl \
    --cc=havdmeer@ziggo.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).