ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* xml-processing: missing or ungrouped '='
@ 2011-01-07 18:04 Achim Jander
  2011-01-07 21:52 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Achim Jander @ 2011-01-07 18:04 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: xml-processing: missing or ungrouped '='
  2011-01-07 18:04 xml-processing: missing or ungrouped '=' Achim Jander
@ 2011-01-07 21:52 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2011-01-07 21:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 7-1-2011 7:04, Achim Jander wrote:

> \startxmlsetups xml:title
> \startchapter[
> \xmlcommand{#1}{.}{xml:splitHeader}

title=...

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

there's also \xmlraw{#1}{spec} which works nice with tables of content 
as it passes the node id

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-07 21:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-07 18:04 xml-processing: missing or ungrouped '=' Achim Jander
2011-01-07 21:52 ` 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).