ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Johannes Graumann <johannes_graumann@web.de>
To: ntg-context@ntg.nl
Subject: Re: XML
Date: Wed, 22 Oct 2008 23:04:33 +0200	[thread overview]
Message-ID: <gdo4f2$m25$1@ger.gmane.org> (raw)
In-Reply-To: <115224fb0810212350m697afcf6m730992a71374de21@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1302 bytes --]

I keep gnawing on this now ...

Added the following (see attachment):

\xmlval{fo:color}{\xmlatt{#1}{color}}{}

and

\xmlmapvalue{fo:color}{#ff0000}{\color[red]}

Which works just fine (given you use "\setupcolors[state=start]" as well), but is there a way to generically paste the "ff0000" bit into the place of "red"? I played around with "system=rgb", but context won't take "ff0000" as a parameter ...

Another question: underlining in ConTeXt (as far as I can discern) needs a "\startunderline"/"\stopunderline" pair, no? Accordingly the combination of

\xmlval{style:text-underline-style}{\xmlatt{#1}{text-underline-style}}{}

and

\xmlmapvalue{style:text-underline-style}{solid}{?}

doesn't work ... what's the proper construct to have xmlflush flanked by underline statements?

And even more ... how to match

<style:text-properties style:text-position="sub 58%"/>

generically, such that "sub*" (which doesn't work) might be used in a combination of

\xmlval{style:text-position}{\xmlatt{#1}{text-position}}{}

and

\xmlmapvalue{style:text-position}{sub*}{\subscript}

and any percentage following "sub" will be matched? Essentially I'm asking here how to use the regex "sub.*" in xmlmapvalue ...

Thanks for your time - the learning curve is steep. Where can one look up stuff like this?

Joh

[-- Attachment #2: Attempt.odt --]
[-- Type: application/vnd.oasis.opendocument.text, Size: 9324 bytes --]

[-- Attachment #3: t-openoffice.ctx --]
[-- Type: application/xml, Size: 386 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: t-openoffice.tex --]
[-- Type: text/x-tex; name="t-openoffice.tex", Size: 1515 bytes --]

%context --ctx=t-openoffice BoldAndItalicContent.xml

\startenvironment t-openoffice.tex

  \startxmlsetups office
    \xmlsetsetup{main}{text:p|text:span}{*}
  \stopxmlsetups
  \xmlregistersetup{office}

  \startxmlsetups text:p
    \xmlflush{#1}\endgraf
  \stopxmlsetups

  \startxmlsetups text:span
    \bgroup
      \xmlfilter{main}{office:automatic-styles/style:style[@style:name='\xmlatt{#1}{style-name}']/style:text-properties/command(do:style:text-properties)}
      \xmlflush{#1}
    \egroup
  \stopxmlsetups

  \startxmlsetups do:style:text-properties
    \xmlval{fo:font-weight}{\xmlatt{#1}{font-weight}}{}% todo: namespaces in attributes
    \xmlval{fo:font-style}{\xmlatt{#1}{font-style}}{}
    \xmlval{fo:color}{\xmlatt{#1}{color}}{}
    \xmlval{style:text-position}{\xmlatt{#1}{text-position}}{}
    %\xmlval{style:text-underline-style}{\xmlatt{#1}{text-underline-style}}{}
  \stopxmlsetups

  \xmlmapvalue{fo:font-weight}{bold}{\bf}
  \xmlmapvalue{fo:font-style}{italic}{\it}
  \xmlmapvalue{fo:color}{#ff0000}{\color[ff0000]}
  
%  \xmlmapvalue{style:text-position}{sub 58\%}{\subscript}
%  \xmlmapvalue{style:text-position}{super*}{\superscript}
  %\xmlmapvalue{style:text-underline-style}{solid}{\startunderline}{\stopunderline}

  \starttext
    \setupcolors[state=start]
    %\xmlprocess{main}{zip:///\inputfilename.odt?name=content.xml}{}
    \usezipfile[\inputfilename.odt]
    \xmlprocess{main}{*/content.xml}{}
  \stoptext
  
\stopenvironment



[-- Attachment #5: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  parent reply	other threads:[~2008-10-22 21:04 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-07 22:14 XML johannes_graumann
2008-10-08  6:34 ` XML luigi scarso
2008-10-08  8:02   ` XML Johannes Graumann
2008-10-08  8:11     ` XML luigi scarso
2008-10-09  7:50 ` XML Wolfgang Schuster
2008-10-09 18:13   ` XML Johannes Graumann
2008-10-14  7:24     ` XML Wolfgang Schuster
2008-10-16  8:24       ` XML Johannes Graumann
2008-10-18  7:28         ` XML olivier Turlier
2008-10-19 13:25           ` XML Johannes Graumann
2008-10-16  8:27       ` XML Johannes Graumann
2008-10-19 20:38       ` XML Johannes Graumann
2008-10-22  6:50         ` XML Wolfgang Schuster
2008-10-22 14:56           ` XML Johannes Graumann
2008-10-22 21:04           ` Johannes Graumann [this message]
2008-10-22 21:30             ` XML Hans Hagen
2008-10-26 14:05               ` XML Johannes Graumann
2008-10-27 10:42                 ` XML Wolfgang Schuster
2008-10-27 20:16                   ` XML Johannes Graumann
2008-10-29  7:09                     ` XML Wolfgang Schuster
  -- strict thread matches above, loose matches on Subject: below --
2005-09-22  6:29 XML Jessica Holle
2005-09-22  6:39 ` XML Henning Hraban Ramm

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='gdo4f2$m25$1@ger.gmane.org' \
    --to=johannes_graumann@web.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).