ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* xml mapping on the fly - revisit
@ 2008-07-14 14:52 Johannes Graumann
  2008-07-14 16:35 ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Graumann @ 2008-07-14 14:52 UTC (permalink / raw)
  To: ntg-context

Hello,

I while ago
(http://archive.contextgarden.net/message/20080214.090451.b23da5b9.en.html)
I asked whether the creation of a xml mapping tag was possible using mark
V. I'm about to revisit this after some long absence and would like to know
whether there's anything new and nifty which might help achieving this.

Thanks for your hints,

Joh

___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: xml mapping on the fly - revisit
  2008-07-14 14:52 xml mapping on the fly - revisit Johannes Graumann
@ 2008-07-14 16:35 ` Hans Hagen
  2008-07-14 21:26   ` Johannes Graumann
  2008-07-31 21:44   ` Johannes Graumann
  0 siblings, 2 replies; 6+ messages in thread
From: Hans Hagen @ 2008-07-14 16:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Johannes Graumann wrote:
> Hello,
> 
> I while ago
> (http://archive.contextgarden.net/message/20080214.090451.b23da5b9.en.html)
> I asked whether the creation of a xml mapping tag was possible using mark
> V. I'm about to revisit this after some long absence and would like to know
> whether there's anything new and nifty which might help achieving this.
> 
> Thanks for your hints,

\starttext

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

\xmlregistersetup{office}

\startxmlsetups text:p
     [p: \xmlflush{#1}]
\stopxmlsetups

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

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

\xmlmapvalue {fo:font-weight} {bold} {\bf}

\startbuffer
<?xml version='1.0'?>
<office>
     <office:automatic-styles>
         <style:style style:name="T1" style:family="text" >
             <style:text-properties fo:font-weight="bold" 
style:font-weight-asian="bold" style:font-weight-complex="bold" />
         </style:style>
     </office:automatic-styles>
     <office:body>
         <office:text>
             <text:p text:style-name="Standard">
                 oeps
                 <text:span text:style-name="T1">oeps</text:span>
                 oeps
             </text>
         </office:text>
     </office:body>
</office>
\stopbuffer

\xmlprocessbuffer{main}{}{}


-----------------------------------------------------------------
                                           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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: xml mapping on the fly - revisit
  2008-07-14 16:35 ` Hans Hagen
@ 2008-07-14 21:26   ` Johannes Graumann
  2008-07-14 21:51     ` Hans Hagen
  2008-07-31 21:44   ` Johannes Graumann
  1 sibling, 1 reply; 6+ messages in thread
From: Johannes Graumann @ 2008-07-14 21:26 UTC (permalink / raw)
  To: ntg-context

... deafening speechlessness ... interrupted by the sound of a tear of joy hitting the keyboard ... 

LOVELY! I'm off to play!

Can you elaborate a bit on what "% todo: namespaces in attributes" means and what the goal here would be? 

Joh

Hans Hagen wrote:

> Johannes Graumann wrote:
>> Hello,
>> 
>> I while ago
>> (http://archive.contextgarden.net/message/20080214.090451.b23da5b9.en.html)
>> I asked whether the creation of a xml mapping tag was possible using mark
>> V. I'm about to revisit this after some long absence and would like to
>> know whether there's anything new and nifty which might help achieving
>> this.
>> 
>> Thanks for your hints,
> 
> \starttext
> 
> \startxmlsetups office
>      \xmlsetsetup{main}{text:p|text:span}{*}
> \stopxmlsetups
> 
> \xmlregistersetup{office}
> 
> \startxmlsetups text:p
>      [p: \xmlflush{#1}]
> \stopxmlsetups
> 
> \startxmlsetups text:span
>      \bgroup
>  
> \xmlfilter{main}{office:automatic-styles/style:style/style:text-properties/command(do:style:text-properties)}
>      [span: \xmlflush{#1}]
>      \egroup
> \stopxmlsetups
> 
> \startxmlsetups do:style:text-properties
>      \xmlval{fo:font-weight}{\xmlatt{#1}{font-weight}}{}% todo:
> namespaces in attributes
> \stopxmlsetups
> 
> \xmlmapvalue {fo:font-weight} {bold} {\bf}
> 
> \startbuffer
> <?xml version='1.0'?>
> <office>
>      <office:automatic-styles>
>          <style:style style:name="T1" style:family="text" >
>              <style:text-properties fo:font-weight="bold"
> style:font-weight-asian="bold" style:font-weight-complex="bold" />
>          </style:style>
>      </office:automatic-styles>
>      <office:body>
>          <office:text>
>              <text:p text:style-name="Standard">
>                  oeps
>                  <text:span text:style-name="T1">oeps</text:span>
>                  oeps
>              </text>
>          </office:text>
>      </office:body>
> </office>
> \stopbuffer
> 
> \xmlprocessbuffer{main}{}{}
> 
> 
> -----------------------------------------------------------------
>                                            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
> -----------------------------------------------------------------
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________


___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: xml mapping on the fly - revisit
  2008-07-14 21:26   ` Johannes Graumann
@ 2008-07-14 21:51     ` Hans Hagen
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2008-07-14 21:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Johannes Graumann wrote:
> .... deafening speechlessness ... interrupted by the sound of a tear of joy hitting the keyboard ... 
> 
> LOVELY! I'm off to play!
> 
> Can you elaborate a bit on what "% todo: namespaces in attributes" means and what the goal here would be? 
> 

in attributes fo:whatever is currently only seen as whatever (i never 
had attributes with a namespace (i'm not even sure yet how to deal with 
them comfortably)


-----------------------------------------------------------------
                                           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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: xml mapping on the fly - revisit
  2008-07-14 16:35 ` Hans Hagen
  2008-07-14 21:26   ` Johannes Graumann
@ 2008-07-31 21:44   ` Johannes Graumann
  2008-08-01  9:50     ` Hans Hagen
  1 sibling, 1 reply; 6+ messages in thread
From: Johannes Graumann @ 2008-07-31 21:44 UTC (permalink / raw)
  To: ntg-context

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

Hello,

I have been trying to extend the example sent by Hans as shown below and run into trouble. Can I please have another nudge?

On a side note - "\xmlprocess{main}{zip::\env{odt}::content.xml}{}" used to work in this context (;0) but doesn't anymore. What's currently accepted?

Thanks, Joh

\startenvironment t-openoffice.tex

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

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

  \startxmlsetups text:span
    \bgroup
      \xmlfilter{main}{office:automatic-styles/style:style/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}}{}
  \stopxmlsetups

  \xmlmapvalue {fo:font-weight} {bold} {\bf}
  \xmlmapvalue {fo:font-style} {italic} {\it}

  \starttext
%    \xmlprocess{main}{zip::\env{odt}::content.xml}{}
    \xmlprocess{main}{content.xml}{}
  \stoptext

\stopenvironment

Hans Hagen wrote:

> Johannes Graumann wrote:
>> Hello,
>> 
>> I while ago
>> (http://archive.contextgarden.net/message/20080214.090451.b23da5b9.en.html)
>> I asked whether the creation of a xml mapping tag was possible using mark
>> V. I'm about to revisit this after some long absence and would like to
>> know whether there's anything new and nifty which might help achieving
>> this.
>> 
>> Thanks for your hints,
> 
> \starttext
> 
> \startxmlsetups office
>      \xmlsetsetup{main}{text:p|text:span}{*}
> \stopxmlsetups
> 
> \xmlregistersetup{office}
> 
> \startxmlsetups text:p
>      [p: \xmlflush{#1}]
> \stopxmlsetups
> 
> \startxmlsetups text:span
>      \bgroup
>  
> \xmlfilter{main}{office:automatic-styles/style:style/style:text-properties/command(do:style:text-properties)}
>      [span: \xmlflush{#1}]
>      \egroup
> \stopxmlsetups
> 
> \startxmlsetups do:style:text-properties
>      \xmlval{fo:font-weight}{\xmlatt{#1}{font-weight}}{}% todo:
> namespaces in attributes
> \stopxmlsetups
> 
> \xmlmapvalue {fo:font-weight} {bold} {\bf}
> 
> \startbuffer
> <?xml version='1.0'?>
> <office>
>      <office:automatic-styles>
>          <style:style style:name="T1" style:family="text" >
>              <style:text-properties fo:font-weight="bold"
> style:font-weight-asian="bold" style:font-weight-complex="bold" />
>          </style:style>
>      </office:automatic-styles>
>      <office:body>
>          <office:text>
>              <text:p text:style-name="Standard">
>                  oeps
>                  <text:span text:style-name="T1">oeps</text:span>
>                  oeps
>              </text>
>          </office:text>
>      </office:body>
> </office>
> \stopbuffer
> 
> \xmlprocessbuffer{main}{}{}
> 
> 
> -----------------------------------------------------------------
>                                            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
> -----------------------------------------------------------------
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

[-- Attachment #2: content.xml --]
[-- Type: application/xml, Size: 3470 bytes --]

[-- Attachment #3: 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
___________________________________________________________________________________

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

* Re: xml mapping on the fly - revisit
  2008-07-31 21:44   ` Johannes Graumann
@ 2008-08-01  9:50     ` Hans Hagen
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2008-08-01  9:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Johannes Graumann wrote:
> Hello,
> 
> I have been trying to extend the example sent by Hans as shown below and run into trouble. Can I please have another nudge?
> 
> On a side note - "\xmlprocess{main}{zip::\env{odt}::content.xml}{}" used to work in this context (;0) but doesn't anymore. What's currently accepted?

\xmlprocess{main}{zip://\env{odt}/content.xml}{}

or something like that

-----------------------------------------------------------------
                                           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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


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

end of thread, other threads:[~2008-08-01  9:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-14 14:52 xml mapping on the fly - revisit Johannes Graumann
2008-07-14 16:35 ` Hans Hagen
2008-07-14 21:26   ` Johannes Graumann
2008-07-14 21:51     ` Hans Hagen
2008-07-31 21:44   ` Johannes Graumann
2008-08-01  9:50     ` 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).