From: Hans Hagen <j.hagen@xs4all.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Fwd: Re: Fwd: (again) issue with lpath and conditional
Date: Thu, 22 Mar 2018 17:57:13 +0100 [thread overview]
Message-ID: <e15dc077-4d1f-d55c-62bc-dc0c7c380ba4@xs4all.nl> (raw)
In-Reply-To: <a9798e40-0d5f-8744-73d9-ff84476b22e6@xs4all.nl>
-------- Forwarded Message --------
Subject: Re: Fwd: [NTG-context] (again) issue with lpath and conditional
Date: Thu, 22 Mar 2018 17:56:54 +0100
From: Hans Hagen <j.hagen@xs4all.nl>
To: luigi scarso <luigi.scarso@gmail.com>
On 3/22/2018 9:40 AM, luigi scarso wrote:
> ---------- Forwarded message ----------
> From: Pablo Rodriguez <oinos@gmx.es>
> Date: Wed, Mar 21, 2018 at 8:29 PM
> Subject: [NTG-context] (again) issue with lpath and conditional
> To: mailing list for ConTeXt users <ntg-context@ntg.nl>
>
>
> Dear list,
>
> I have the following sample:
>
> \startbuffer[demo]
> <doc>
> <pre class="tex typeset fullwidth">
> <code>
> a
> </code>
> </pre>
> <pre class="tex typeset">
> <code>
> b
> </code>
> </pre>
> </doc>
> \stopbuffer
>
> \startxmlsetups xml:initialize
> \xmlsetsetup{#1}{doc}{xml:*}
> \xmlsetsetup{\xmldocument}
> {pre[contains(@class,'typeset')]/code}
> {xml:pre:code}
> \stopxmlsetups
>
> \xmlregistersetup{xml:initialize}
>
> \startxmlsetups xml:doc
> \xmlflush{#1}
> \stopxmlsetups
>
> \startxmlsetups xml:pre:code
> \xmlinfo{#1}
> \xmlpath{#1}
> \xmldoifelse{#1}{../pre[contains(@class,'fullwidth')]}
> %~ \xmldoifelse{#1}{{pre[class*="fullwidth"]}}
> {\startpar Full–width.\stoppar}
> {\startpar Another width.\stoppar}
> \stopxmlsetups
>
> \starttext
> \xmlprocessbuffer{main}{demo}{}
> \stoptext
>
> It is beyond my kmowledge why the lpath
> "{../pre[contains(@class,'fullwidth')]}" doesn’t return true, when
> \xmlinfo shows "[code]" and \xmlpath is "doc/pre/code" (indices aren’t
> relevant here).
>
> Neither does the css selector work.
>
> What am I missing in the lpath and the css selector?
\xmldoifelse {#1} {..[contains(@class,'fullwidth')]}
-----------------------------------------------------------------
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
___________________________________________________________________________________
next parent reply other threads:[~2018-03-22 16:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <a9798e40-0d5f-8744-73d9-ff84476b22e6@xs4all.nl>
2018-03-22 16:57 ` Hans Hagen [this message]
2018-03-22 20:21 ` Pablo Rodriguez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e15dc077-4d1f-d55c-62bc-dc0c7c380ba4@xs4all.nl \
--to=j.hagen@xs4all.nl \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).