ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* problem with character entities in XML processing
@ 2018-04-19  8:53 Hans van der Meer
       [not found] ` <bd67389b-f37b-68c7-ba08-72792542a235@xs4all.nl>
  0 siblings, 1 reply; 2+ messages in thread
From: Hans van der Meer @ 2018-04-19  8:53 UTC (permalink / raw)
  To: NTG ConTeXt


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

The following use of character entities &#038; aborts in ConTeXt. That is of course because the # is seen as a parameter. Changing this to &\#xxx; or &\letterhash xxx; typesets &#038; as is, but that is not the intention, because an ampersand should appear. So, how do I proceed here?


Minimal example:
% test character entity failure.
\startxmlsetups demo:entity
	\xmlsetsetup{#1}{root}{demo:entity:*}
\stopxmlsetups
\xmlregisterdocumentsetup{demo}{demo:entity}
\startxmlsetups demo:entity:root
	\blank Start test:\crlf
	root: <amp> = "&amp;"\crlf
	root: <number> = "&\letterhash 038;”\crlf % &\#038; produces the same
	End test\blank
\stopxmlsetups
\startbuffer[demo]
<root></root>
\stopbuffer
\starttext
\currentdate-\currenttime\quad\ConTeXt-version=\contextversion\blank
{\bf Testing use of character entities}\blank
These should produce the same result: \type{&amp;} and \type{&#038;}\blank
\xmlprocessbuffer{demo}{demo}{}\blank
\stoptext


dr. Hans van der Meer



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

[-- Attachment #1.2.2: xml-entity.pdf --]
[-- Type: application/pdf, Size: 14827 bytes --]

[-- Attachment #1.2.3: Type: text/html, Size: 1154 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-04-19 13:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-19  8:53 problem with character entities in XML processing Hans van der Meer
     [not found] ` <bd67389b-f37b-68c7-ba08-72792542a235@xs4all.nl>
2018-04-19 13:55   ` 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).