ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* use of preceding-sibling in xmlsetsetup
@ 2015-10-12 15:38 massifr
  2015-10-14 11:34 ` massifr
  0 siblings, 1 reply; 7+ messages in thread
From: massifr @ 2015-10-12 15:38 UTC (permalink / raw)
  To: ntg-context

Hello list,
I need a lpath expression to intercept the first p (HTML paragraph) 
after a p of class "incipit". Here's a (not) working example:

\startbuffer[test]
<text>
  <p class="incipit">Dear list,</p>
  <p>this paragraph should not be indented, because it follows the “incipit”
  of the letter.</p>
  <p>This one and the following ones should be indented.</p>
  <p>You may question whether “Dear list,” should be a paragraph of his own,
  but my text is already formatted like that and I can’t do anything 
  about it.</p>
</text>
\stopbuffer

\startxmlsetups xml:somesetups
  \xmlsetsetup{#1}{text}{xml:text}
  \xmlsetsetup{#1}{p}{xml:p}
  \xmlsetsetup{#1}{p[@class='incipit']}{xml:p:noindent}
  % the following lpath expression does not work
  \xmlsetsetup{#1}{p[./preceding-sibling::[-1][@class = 'incipit']]}{xml:p:noindent}
\stopxmlsetups

\xmlregistersetup{xml:somesetups}

\startxmlsetups xml:text
  \indenting[{yes,first,12pt}]
  \xmlflush{#1}
\stopxmlsetups

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

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

\starttext
  \xmlprocessbuffer{main}{test}{}
\stoptext

Thanks for any help.
___________________________________________________________________________________
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] 7+ messages in thread
[parent not found: <mailman.1.1445248802.4863.ntg-context@ntg.nl>]

end of thread, other threads:[~2015-10-20 20:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-12 15:38 use of preceding-sibling in xmlsetsetup massifr
2015-10-14 11:34 ` massifr
2015-10-15 20:27   ` Thomas A. Schmitz
2015-10-17  9:19     ` mf
2015-10-19  7:43       ` Thomas A. Schmitz
     [not found] <mailman.1.1445248802.4863.ntg-context@ntg.nl>
2015-10-19 15:48 ` ntg-context Digest, Vol 136, Issue 30 massifr
2015-10-20  9:48   ` use of preceding-sibling in xmlsetsetup massifr
2015-10-20 20:30     ` 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).