ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Thomas A. Schmitz" <thomas.schmitz@uni-bonn.de>
To: mailing ConTeXt users list for <ntg-context@ntg.nl>
Subject: Re: Fwd: Re: xml-processing: missing or ungrouped '='
Date: Sat, 8 Jan 2011 18:00:59 +0100	[thread overview]
Message-ID: <60F4B08E-CF99-4FE8-B8B0-0084F281BDB2@uni-bonn.de> (raw)
In-Reply-To: <4D287357.3000906@jander.de>


On Jan 8, 2011, at 3:23 PM, Achim Jander wrote:

> Hi Thomas,
> yes, of course you are right, but thats not making the problems. Its switched in while making a "minimal" example.
> My problem or maxbe misunderstanding ist what I try to achieve with

Sorry, but I still don't have the faintest idea what it is you want to do. Your minimal example doesn't show it, and your explanations differ from one message to the next. 

In one of your mails, you said this:

> If the title comes with an number-element  I want to set ownnumber=..., but if they have no numbers, I want to set number=no

If this is what you're looking for, here's what I would suggest:

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

\startxmlsetups xml:testsetups
  \xmlsetsetup{\xmldocument}{a|b|chapter}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:testsetups}

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

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

\startxmlsetups xml:chapter
 \doifelse {\xmlatt{#1}{num}} {}
 {\setuphead[chapter][number=no]
  \startchapter[title={\xmlatt{#1}{title}}]
    \xmlflush{#1}
  \stopchapter}
 {\setuphead[chapter][number=yes]
  \setupheadnumber[chapter][\xmlatt{#1}{num}]
  \startchapter[title={\xmlatt{#1}{title}}] 
    \xmlflush{#1}
  \stopchapter}
\stopxmlsetups

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

It's trivial to change the test from an attribute to a <num> element>, but maybe that's not what you're looking for...

Thomas
___________________________________________________________________________________
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-08 17:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-08 10:20 Achim Jander
2011-01-08 11:15 ` Hans Hagen
2011-01-08 12:39   ` Achim Jander
2011-01-08 13:07     ` Thomas A. Schmitz
2011-01-08 14:23       ` Achim Jander
2011-01-08 17:00         ` Thomas A. Schmitz [this message]
2011-01-09 11:05           ` Achim Jander

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=60F4B08E-CF99-4FE8-B8B0-0084F281BDB2@uni-bonn.de \
    --to=thomas.schmitz@uni-bonn.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).