ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] attribute selection
@ 2023-08-30 11:49 Hans van der Meer via ntg-context
  2023-08-30 11:59 ` [NTG-context] " Hans van der Meer via ntg-context
  0 siblings, 1 reply; 2+ messages in thread
From: Hans van der Meer via ntg-context @ 2023-08-30 11:49 UTC (permalink / raw)
  To: NTG ConTeXt; +Cc: Hans van der Meer

[-- Attachment #1: Type: text/plain, Size: 1165 bytes --]

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


[-- Attachment #2: xml-tex-attribute-select.pdf --]
[-- Type: application/pdf, Size: 12879 bytes --]

[-- Attachment #3: Type: text/plain, Size: 21 bytes --]




Hans van der Meer

[-- Attachment #4: 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
___________________________________________________________________________________

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

end of thread, other threads:[~2023-08-30 12:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-30 11:49 [NTG-context] attribute selection Hans van der Meer via ntg-context
2023-08-30 11:59 ` [NTG-context] " Hans van der Meer via ntg-context

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