ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Achim Jander <achim@jander.de>
To: ntg-context@ntg.nl
Subject: xml-processing: missing or ungrouped '='
Date: Fri, 07 Jan 2011 19:04:15 +0100	[thread overview]
Message-ID: <4D27559F.7040103@jander.de> (raw)

Hi all
a problem with processing XML data (maybe a lack of knowledge). If in 
the example below I set the chapter-attributes directly in 
\startxmlsetups xml:title (commented out)
everything is like I expected. Because I have headings to be treated 
equally in multiple hierarchies I tried to delegate the processing to 
splitHeader.
But then the processing always complains about a missing or ungrouped 
'=' in line ... (activated in the examle given).

\startbuffer[test]
<a>
<title>some text</title>
<b>more text </b>
<b>more text </b>
<title><num>333</num>some text</title>
<b>more text </b>
<b>more text </b>
</a>
\stopbuffer

\startxmlsetups xml:testsetups
     \xmlsetsetup{\xmldocument}{a|b|title}{xml:*}
     \xmlsetsetup{\xmldocument}{num}{-}
\stopxmlsetups

\xmlregistersetup{xml:testsetups}

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

\startxmlsetups xml:b
     \startparagraph
     \xmlflush{#1}
     \stopparagraph
\stopxmlsetups

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

\startxmlsetups xml:splitHeader %works not
number=\xmldoifelse{#1}{/num}{yes}{no},
ownnumber=\xmldoifelse{#1}{/num}{\xmlcommand{#1}{/num}{xml:ueberForceFlush}}{},
title={\xmlflush{#1}},
\stopxmlsetups


\startxmlsetups xml:title
\startchapter[
\xmlcommand{#1}{.}{xml:splitHeader}
%number=\xmldoifelse{#1}{/num}{yes}{no}, %works
%ownnumber=\xmldoifelse{#1}{/num}{\xmlcommand{#1}{/num}{xml:ueberForceFlush}}{},%works
%title={\xmlflush{#1}},%works
]
\xmlflush{#1}
\stopchapter
\stopxmlsetups

\setupheader[chapter][ownnumber=yes]

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



Thanks,
Achim
___________________________________________________________________________________
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:[~2011-01-07 18:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-07 18:04 Achim Jander [this message]
2011-01-07 21:52 ` 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=4D27559F.7040103@jander.de \
    --to=achim@jander.de \
    --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).