ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* xmlchainatt and xmllastatt
@ 2018-09-11  8:13 Hans van der Meer
  2018-09-11  8:14 ` Fwd: " Hans van der Meer
  0 siblings, 1 reply; 2+ messages in thread
From: Hans van der Meer @ 2018-09-11  8:13 UTC (permalink / raw)
  To: NTG ConTeXt


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

I found at best an inconsistency in the xml-mkiv manual and at its worst an omission in the code.

I must conclude that \xmllastatt is not delivering the attribute retrieved with \xmlchainatt and that \xmllastatt seems restricted to calls of the \xmlatt family. This put me on the wrong foot for a while, because I understood the manual otherwise.
Vide the minimal example given.

dr. Hans van der Meer



[-- Attachment #1.2: Type: text/html, Size: 1597 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] 2+ messages in thread

* Fwd: xmlchainatt and xmllastatt
  2018-09-11  8:13 xmlchainatt and xmllastatt Hans van der Meer
@ 2018-09-11  8:14 ` Hans van der Meer
  0 siblings, 0 replies; 2+ messages in thread
From: Hans van der Meer @ 2018-09-11  8:14 UTC (permalink / raw)
  To: NTG ConTeXt


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

Sorry, wrong button. Now with the attachments.

> Begin forwarded message:
> 
> From: Hans van der Meer <havdmeer@ziggo.nl>
> Subject: xmlchainatt and xmllastatt
> Date: 11 September 2018 at 10:13:25 CEST
> To: NTG ConTeXt <ntg-context@ntg.nl>
> 
> I found at best an inconsistency in the xml-mkiv manual and at its worst an omission in the code.
> 
> I must conclude that \xmllastatt is not delivering the attribute retrieved with \xmlchainatt and that \xmllastatt seems restricted to calls of the \xmlatt family. This put me on the wrong foot for a while, because I understood the manual otherwise.
> Vide the minimal example given.
> 
> dr. Hans van der Meer
> 
> 

met vriendelijke groet
dr. Hans van der Meer


[-- Attachment #1.2.1: Type: text/html, Size: 4649 bytes --]

[-- Attachment #1.2.2: xml-tex-chainlastatt.pdf --]
[-- Type: application/pdf, Size: 13216 bytes --]

[-- Attachment #1.2.3: Type: text/html, Size: 197 bytes --]

[-- Attachment #1.2.4: xml-tex-chainlastatt.tex --]
[-- Type: application/octet-stream, Size: 1282 bytes --]

% test chainttribute failure.
\startxmlsetups demo:chainatt
	\xmlsetsetup{#1}{root|node}{demo:chainatt:*}
\stopxmlsetups
\xmlregisterdocumentsetup{demo}{demo:chainatt}
\startxmlsetups demo:chainatt:root
	root: attribute test = \xmlatt{#1}{test} --- xmllastatt = \xmllastatt\crlf
	root: chainattribute test = \xmlchainatt{#1}{test} --- xmllastatt = \xmllastatt\crlf
	\xmlall{#1}{*}
\stopxmlsetups
\startxmlsetups demo:chainatt:node
	First level child:\crlf
	node: attribute test = \xmlatt{#1}{test} --- xmllastatt = \xmllastatt\crlf
	node: chainattribute test = \xmlchainatt{#1}{test} --- xmllastatt = \xmllastatt\crlf
\stopxmlsetups
\startbuffer[chainatt]
<root test="abc">
  <node/>
</root>
\stopbuffer
\starttext
\currentdate-\currenttime\quad\ConTeXt-version=\contextversion\blank
The manual xml-mkiv page 22 on \tex{xmlchainatt} reads:\crlf
"returns the value of attribute NAME or empty if no such attribute exists; backtracks till a match is found"\crlf
And next on \tex{xmllastatt} it reads:\crlf
"returns the last attribute found (this avoids a lookup)"\blank
The last statement cannot be true because the attribute returned by \tex{xmlchainatt} is not retrieved with \tex{xmllastatt}, witness the following example.\blank
\xmlprocessbuffer{demo}{chainatt}{}\blank
\stoptext

[-- Attachment #1.2.5: Type: text/html, Size: 206 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] 2+ messages in thread

end of thread, other threads:[~2018-09-11  8:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-11  8:13 xmlchainatt and xmllastatt Hans van der Meer
2018-09-11  8:14 ` Fwd: " Hans 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).