* issue with lpath containing a hyphen
@ 2016-11-18 22:32 Pablo Rodriguez
2016-11-20 11:13 ` Hans Hagen
0 siblings, 1 reply; 4+ messages in thread
From: Pablo Rodriguez @ 2016-11-18 22:32 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hans,
I have the following sample:
\startbuffer[demo]
<doc>
<div id="a-b">
is it working
</div>
</doc>
\stopbuffer
\startxmlsetups xml:initialize
\xmlsetsetup{#1}{doc}{xml:*}
\xmlsetsetup{#1}
{div[@id='a\letterpercent-b']}
{xml:a:b}
\stopxmlsetups
\xmlregistersetup{xml:initialize}
\startxmlsetups xml:doc
\xmlflush{#1}
\stopxmlsetups
\startxmlsetups xml:a:b
\input knuth
\stopxmlsetups
\starttext
\xmlprocessbuffer{main}{demo}{}
\stoptext
The only way to get the Knuth in the quote is to remove "\letterpercent"
in the lpath.
I guess I must be doing something wrong in this sample. In my real
document, I cannot simply remove it, I get an error.
As a general consideration, houw about making not mandatory to escape
characters in lpaths? This would ease the traslation from XML code to
lpaths.
Many thanks for your help,
Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
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] 4+ messages in thread
* Re: issue with lpath containing a hyphen
2016-11-18 22:32 issue with lpath containing a hyphen Pablo Rodriguez
@ 2016-11-20 11:13 ` Hans Hagen
2016-11-20 19:47 ` Pablo Rodriguez
0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2016-11-20 11:13 UTC (permalink / raw)
To: ntg-context
On 11/18/2016 11:32 PM, Pablo Rodriguez wrote:
> Hans,
>
> I have the following sample:
>
> \startbuffer[demo]
> <doc>
> <div id="a-b">
> is it working
> </div>
> </doc>
> \stopbuffer
>
> \startxmlsetups xml:initialize
> \xmlsetsetup{#1}{doc}{xml:*}
> \xmlsetsetup{#1}
> {div[@id='a\letterpercent-b']}
> {xml:a:b}
> \stopxmlsetups
>
> \xmlregistersetup{xml:initialize}
>
> \startxmlsetups xml:doc
> \xmlflush{#1}
> \stopxmlsetups
>
> \startxmlsetups xml:a:b
> \input knuth
> \stopxmlsetups
>
> \starttext
> \xmlprocessbuffer{main}{demo}{}
> \stoptext
>
> The only way to get the Knuth in the quote is to remove "\letterpercent"
> in the lpath.
so why do you use the \letterpercent then
> I guess I must be doing something wrong in this sample. In my real
> document, I cannot simply remove it, I get an error.
>
> As a general consideration, houw about making not mandatory to escape
> characters in lpaths? This would ease the traslation from XML code to
> lpaths.
>
> Many thanks for your help,
>
> Pablo
>
--
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: issue with lpath containing a hyphen
2016-11-20 11:13 ` Hans Hagen
@ 2016-11-20 19:47 ` Pablo Rodriguez
2016-11-21 13:15 ` Hans Hagen
0 siblings, 1 reply; 4+ messages in thread
From: Pablo Rodriguez @ 2016-11-20 19:47 UTC (permalink / raw)
To: mailing list for ConTeXt users
On 11/20/2016 12:13 PM, Hans Hagen wrote:
> On 11/18/2016 11:32 PM, Pablo Rodriguez wrote:
>> [...]
>> The only way to get the Knuth in the quote is to remove "\letterpercent"
>> in the lpath.
>
> so why do you use the \letterpercent then
It was a minimal sample taken from from a larger project.
I have just discovered that the compilation error has nothing to do with
the hyphen.
Then I have the question about lpaths: do I have to remove all instances
of \letterpercent?
They seem to work fine, but I had the impression that \letterpercent was
mandatory and now I don’t know whether it is allowed or simply forbidden.
Many thanks for your help,
Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
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] 4+ messages in thread
* Re: issue with lpath containing a hyphen
2016-11-20 19:47 ` Pablo Rodriguez
@ 2016-11-21 13:15 ` Hans Hagen
0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2016-11-21 13:15 UTC (permalink / raw)
To: ntg-context
On 11/20/2016 8:47 PM, Pablo Rodriguez wrote:
> On 11/20/2016 12:13 PM, Hans Hagen wrote:
>> On 11/18/2016 11:32 PM, Pablo Rodriguez wrote:
>>> [...]
>>> The only way to get the Knuth in the quote is to remove "\letterpercent"
>>> in the lpath.
>>
>> so why do you use the \letterpercent then
>
> It was a minimal sample taken from from a larger project.
>
> I have just discovered that the compilation error has nothing to do with
> the hyphen.
>
> Then I have the question about lpaths: do I have to remove all instances
> of \letterpercent?
>
> They seem to work fine, but I had the impression that \letterpercent was
> mandatory and now I don’t know whether it is allowed or simply forbidden.
afaiks they are not needed unless you use lua function that use find or
gsub
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-11-21 13:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-18 22:32 issue with lpath containing a hyphen Pablo Rodriguez
2016-11-20 11:13 ` Hans Hagen
2016-11-20 19:47 ` Pablo Rodriguez
2016-11-21 13:15 ` 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).