ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* xml entities and trailing space
@ 2010-02-07 21:19 Thomas A. Schmitz
  2010-02-09 17:50 ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas A. Schmitz @ 2010-02-07 21:19 UTC (permalink / raw)
  To: mailing ConTeXt users list for

Hi all, Hans,

this is something I had mentioned a few weeks ago, but wanted to complain about it again: when you define xml entities as TeX commands, those used to preserve trailing spaces. This hasn't been the case since a number of version. I would like to recommend havin the old behavior back (since adding spaces isn't as easy in xml as it is in TeX). The example below demonstrates the problem.

All best

Thomas

\startbuffer[xmltest]
<p>A &textbar; B</p>
\stopbuffer

\startxmlsetups xml:mysetups
    \xmlsetsetup{\xmldocument}{p}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:mysetups}

\startxmlsetups xml:p
    \xmlflush{#1} \par
\stopxmlsetups

\xmlsetentity{textbar}{\textbar}

\starttext
\xmlprocessbuffer{main}{xmltest}{}
\stoptext 

___________________________________________________________________________________
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] 4+ messages in thread

* Re: xml entities and trailing space
  2010-02-07 21:19 xml entities and trailing space Thomas A. Schmitz
@ 2010-02-09 17:50 ` Hans Hagen
  2010-02-09 18:04   ` Thomas A. Schmitz
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2010-02-09 17:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Thomas A. Schmitz

On 7-2-2010 22:19, Thomas A. Schmitz wrote:
> \startbuffer[xmltest]
> <p>A&textbar; B</p>
> \stopbuffer
>
> \startxmlsetups xml:mysetups
>      \xmlsetsetup{\xmldocument}{p}{xml:*}
> \stopxmlsetups
>
> \xmlregistersetup{xml:mysetups}
>
> \startxmlsetups xml:p
>      \xmlflush{#1} \par
> \stopxmlsetups
>
> \xmlsetentity{textbar}{\textbar}
>
> \starttext
> \xmlprocessbuffer{main}{xmltest}{}
> \stoptext

this is not that easy as effectively

A&textbar; B

becomes

A\textbar B

and tex will normally gobble that space as part of parsing the input and 
changing that aspect will not happen

chicken or egg so use:

\xmlsetentity{textbar}{\textbar{}}


Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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] 4+ messages in thread

* Re: xml entities and trailing space
  2010-02-09 17:50 ` Hans Hagen
@ 2010-02-09 18:04   ` Thomas A. Schmitz
  2010-02-09 18:09     ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas A. Schmitz @ 2010-02-09 18:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users


On Feb 9, 2010, at 6:50 PM, Hans Hagen wrote:

> this is not that easy as effectively
> 
> A&textbar; B
> 
> becomes
> 
> A\textbar B
> 
> and tex will normally gobble that space as part of parsing the input and changing that aspect will not happen
> 
> chicken or egg so use:
> 
> \xmlsetentity{textbar}{\textbar{}}
> 
> 
> Hans

OK, will do that - I was just curious because the behavior changed a while ago. I have older pdfs where  the space after such entities was preserved. But you're right, it's no big deal.

Thomas
___________________________________________________________________________________
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] 4+ messages in thread

* Re: xml entities and trailing space
  2010-02-09 18:04   ` Thomas A. Schmitz
@ 2010-02-09 18:09     ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2010-02-09 18:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Thomas A. Schmitz

On 9-2-2010 19:04, Thomas A. Schmitz wrote:
>
> On Feb 9, 2010, at 6:50 PM, Hans Hagen wrote:
>
>> this is not that easy as effectively
>>
>> A&textbar; B
>>
>> becomes
>>
>> A\textbar B
>>
>> and tex will normally gobble that space as part of parsing the input and changing that aspect will not happen
>>
>> chicken or egg so use:
>>
>> \xmlsetentity{textbar}{\textbar{}}
>>
>>
>> Hans
>
> OK, will do that - I was just curious because the behavior changed a while ago. I have older pdfs where  the space after such entities was preserved. But you're right, it's no big deal.

i might cook up something some day


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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] 4+ messages in thread

end of thread, other threads:[~2010-02-09 18:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-07 21:19 xml entities and trailing space Thomas A. Schmitz
2010-02-09 17:50 ` Hans Hagen
2010-02-09 18:04   ` Thomas A. Schmitz
2010-02-09 18:09     ` Hans Hagen

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