ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Pablo Rodriguez <oinos@gmx.es>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: question about an lpath
Date: Tue, 31 May 2016 19:21:18 +0200	[thread overview]
Message-ID: <c496884b-c1ef-4fbb-ec6e-e9ce8f4c0bbf@gmx.es> (raw)

Dear list,

I have the following sample:

    \startbuffer[demo]
    <div class="super">
          <h1>Chapter</h1>
          <p>This is the only paragraph in red.</p>
          <p>This is another paragraph.</p>
          <p>This is another paragraph.</p>
          <p>This is another paragraph.</p>
          <p>This is another paragraph.</p>
    </div>
    \stopbuffer

    \startxmlsetups xml:initialize
          \xmlsetsetup{#1}{*}{xml:*}
          \xmlsetsetup{#1}
            {div[contains(@class,'super')]/p[position()==1]}
            {xml:p:super}
    \stopxmlsetups

    \xmlregistersetup{xml:initialize}

    \startxmlsetups xml:div
          \xmlflush{#1}
    \stopxmlsetups

    \startxmlsetups xml:h1
          \title{\xmlflush{#1}}
    \stopxmlsetups

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

    \startxmlsetups xml:p:super
          \bgroup\red\xmlflush{#1}\egroup\par
    \stopxmlsetups

    \starttext

    \xmlprocessbuffer{main}{demo}{}

    \stoptext

Would it be possible to have another lpath for xml:p:super similar to
the following CSS selector? (Sorry, this is much easier for me.)

    div.super > h1 + p {}

After searching in xml-mkiv.pdf, I’m afraid I haven’t been able to find
which might be the lpath replacement for "+".

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

             reply	other threads:[~2016-05-31 17:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-31 17:21 Pablo Rodriguez [this message]
2016-05-31 17:56 ` Hans Hagen

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=c496884b-c1ef-4fbb-ec6e-e9ce8f4c0bbf@gmx.es \
    --to=oinos@gmx.es \
    --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).