ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: Problems mapping Xml into ConTeXt
Date: Thu, 12 Oct 2006 08:53:45 +0200	[thread overview]
Message-ID: <452DE679.2040406@wxs.nl> (raw)
In-Reply-To: <OF3DDF58E5.DB65EA6F-ONCA257205.0009290A-CA257205.0013C7F5@asic.gov.au>

Michael Wigston wrote:
>
> Hans Hagen wrote:
> > Michael Wigston wrote:
> > > 1.  This def of <u> does nothing ...
> > > \defineXMLgrouped [u] \underbar
> > >
> > \defineXMLargument[u]{\underbar}
> >
> > underbar is not a font switch but a macro that takes an argument
>
> Hans,
>
> Thanks, that works fine with \underbar, as well as \underbars, 
> \overstrike, \overstrikes, \low, \high and \lohi.
>
> You mentioned that \underbar (and presumably the others I mentioned 
> above) are macros taking arguments e.g. \acommand{...}. However 
> presumably something like \midaligned{...}  is also a macro requiring 
> an argument, but this works as a \defineXMLgrouped and as a 
> \defineXMLargument - why does it  work with both?
the macro ones do manipulate their argument, for instance, underbar is 
not a font charateristic or color switch or so i.e. not a real 
attribute; esp using setups will make your style look better (look into 
x-fo for instance, forget about the dirty tricks there, but it's pretty 
clean; mapping values and so save many macro definitions
>
> The manual "XML in ConTeXt" very briefly sketched over these XML 
> commands and I can see great potential to use them directly on XML to 
> generate ConTeXt for PDF rather than the XSLT/XSL-FO route which seems 
> to be gaining momentum in much of the industry. I don't suppose there 
> is another more detailed document which elaborates on the XML 
> commands, and how you may determine which of these is most appropriate 
> for what kind of ConTeXt command mapping? 
you can take a look into the x-* files which show quite some mappings; 
indeed direct mapping is often more convenient than transformations; 
future versions of context will also offer more manipulation possibilities
>
>
> Also at the moment a non-mapped element seems to automatically type 
> out its contents as straight text - is there a way to override this 
> behaviour and specify this as an error? (This is rather like the Ruby 
> duck-typing approach - if an XML element is mapped, process it, else 
> it is an error).  
\startXMLignore
\stopXMLignore 

in xtag-pre you can see: 

\defineXMLenvironment [\s!default] \defaultXMLelement \defaultXMLelement
\defineXMLsingular    [\s!default] \defaultXMLelement

% \def\defaultXMLelement
%   {\iftraceXMLelements[\currentXMLfullidentifier]\fi}

\def\defaultXMLelement
  {\iftraceXMLelements{\infofont<\currentXMLfullidentifier>}\fi}

%D We can use the default handler to implement automatic
%D element hiding. Beware: this overloads the tracer.

\def\startXMLignore{\dododefineXMLignore \s!default}
\def\stopXMLignore {\dododefineXMLprocess\s!default}

so you can play with the default handlers 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

  reply	other threads:[~2006-10-12  6:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1.1160560804.6611.ntg-context@ntg.nl>
2006-10-12  3:36 ` Michael Wigston
2006-10-12  6:53   ` Hans Hagen [this message]
2006-10-13  0:43     ` Michael Wigston
2006-10-11  5:12 Michael Wigston
2006-10-11  7:49 ` 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=452DE679.2040406@wxs.nl \
    --to=pragma@wxs.nl \
    --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).