ZVON > > Templatotron
>> Page 10 << | Prev | Next | contents | introduction | reference | download |

Sometimes it is required that t:* elements should output elements in different namespace than their parent. In this case an element tn:namespace from "http://zvon.org/templatotron/namespace" can be used. This attribute determines the required target namespace.

XML source

<aaa>
     <bbb>
          <ccc>1</ccc>
          <ccc>2</ccc>
     </bbb>
     <bbb>
          <ccc>3</ccc>
          <ccc>4</ccc>
     </bbb>
</aaa>

Templatotron source

<xhtml xmlns="http://www.w3.org/1999/xhtml" xmlns:t="http://zvon.org/templatotron" xmlns:tn="http://zvon.org/templatotron/namespace" >
     <head>
          <title>A mixed XHTML and MathML example</title>
     </head>
     <body>
          <h1>Fractions</h1>
          <t:math t:select="//bbb" tn:namespace="http://www.w3.org/1998/Math/MathML">
               <mfrac>
                    <t:mn t:select="ccc"/>
               </mfrac>
          </t:math>
     </body>
</xhtml>
Output

<xhtml xmlns="http://www.w3.org/1999/xhtml" >
     <head>
          <title>A mixed XHTML and MathML example</title>
     </head>
     <body>
          <h1>Fractions</h1>
          <math xmlns="http://www.w3.org/1998/Math/MathML" >
               <mfrac>
                    <mn>1</mn>
                    <mn>2</mn>
               </mfrac>
          </math>
          <math xmlns="http://www.w3.org/1998/Math/MathML" >
               <mfrac>
                    <mn>3</mn>
                    <mn>4</mn>
               </mfrac>
          </math>
     </body>
</xhtml>