[NTG-context] issue with lpath containing a hyphen

Pablo Rodriguez oinos at gmx.es
Fri Nov 18 23:32:10 CET 2016


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


More information about the ntg-context mailing list