ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* XML - same element on more levels
@ 2001-11-16 19:34 Lukas Kubin
  2001-11-20 10:21 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Lukas Kubin @ 2001-11-16 19:34 UTC (permalink / raw)


Let's say I have following document:

<document>
  <title>My Document</title>
  <author>Myself</author>
  <text>  
    <chapter>
      <title>Chapter One</title>
      .
      .
      .
    </chapter>
  </text> 
</document>

How do I do the ConTeXt mapping for the second title element? I would like
to have the /document/title level mapped as \title{My Document} and
/document/text/chapter/title as \chapter{Chapter One}

Thank you.

lukas

-- 
Lukas Kubin
lukas.kubin@permonik.com
phone: 00420603836180


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

* Re: XML - same element on more levels
  2001-11-16 19:34 XML - same element on more levels Lukas Kubin
@ 2001-11-20 10:21 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2001-11-20 10:21 UTC (permalink / raw)
  Cc: ntg-context

At 08:34 PM 11/16/2001 +0100, Lukas Kubin wrote:
>Let's say I have following document:
>
><document>
>   <title>My Document</title>
>   <author>Myself</author>
>   <text>
>     <chapter>
>       <title>Chapter One</title>
>       .
>       .
>       .
>     </chapter>
>   </text>
></document>
>
>How do I do the ConTeXt mapping for the second title element? I would like
>to have the /document/title level mapped as \title{My Document} and
>/document/text/chapter/title as \chapter{Chapter One}

One way is to redefine elements within another one, so

\defineXMLenvironment [chapter]
   {\bgroup
    \defineXMLargument [chapter] \chapter}
   {\egroup}

Another one is, which may not yet work in your version,

\startXMLmapping [chapter]

\defineXMLargument [title] \chapter

\stopXMLmapping

\defineXMLenvironment [chapter]
   {\startXMLmapping[chapter]}
   {\stopXMLmapping}

Other methods will probably be implemented too

Hans

-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


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

end of thread, other threads:[~2001-11-20 10:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-16 19:34 XML - same element on more levels Lukas Kubin
2001-11-20 10:21 ` 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).