xsl-list
[Top] [All Lists]

RE: [xsl] spirit an xml element away and bring it back

2006-08-22 01:39:05
There's nothing in standard XSLT, but you could use saxon:serialize() (and
of course saxon:parse() on the receiving end).

Michael Kay
http://www.saxonica.com/ 

-----Original Message-----
From: Frank Marent [mailto:frank(_dot_)marent(_at_)emnemics(_dot_)ch] 
Sent: 22 August 2006 06:35
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] spirit an xml element away and bring it back

hello.

we are trying (for a rountripping of xml documents between 
arbortext editor and adobe framemaker) to spirit mathml code 
away from xml arbortext editor documents (to open in adobe 
framemaker) and let the mathml code reappear again when 
returning to xml arbortext editor.

the best would be to hide the mathml code in an attribute and 
let it also reappear again from that, but we could only make 
*one* way (hiding the code) and only in a *processing 
instruction* by this xslt
fragment:

   ...
   <xsl:template match="FormulaEntity">
     <FormulaEntity>
       <xsl:text disable-output-escaping="yes">&lt;?MATH </xsl:text>
       <xsl:apply-templates/>
       <xsl:text disable-output-escaping="yes"> ?&gt;</xsl:text>
     </FormulaEntity>
   </xsl:template>
   ...

i wonder if there is any way to to spirit an xml element with 
all descendants away, hiding it in an attribute and bring it 
back to stage after that. our xml input code would be like:

<FormulaEntity>
   <m:math>
     <m:mrow>
       <m:mroot>
         <m:mrow>
           <m:mn>5</m:mn>
         </m:mrow>
         <m:mrow>
           <m:mn>2</m:mn>
         </m:mrow>
       </m:mroot>
     </m:mrow>
   </m:math>
</FormulaEntity>

we have to store the <m:math> element and the best would be 
to have after that something like:

<FormulaEntity
MathML="&lt;m:math&gt;&lt;m:mrow&gt;&lt;m:mroot&gt;&lt;m:mrow&
gt;&lt;m:m
n&gt;5&lt;/m:mn&gt;&lt;/m:mrow&gt;&lt;m:mrow&gt;&lt;m:mn&gt;2&lt;/
m:mn&gt;&lt;/m:mrow&gt;&lt;/m:mroot&gt;&lt;/m:mrow&gt;&lt;/m:m
ath&gt;">

and bringing the code back to the input code.

is there any solution in xslt for that? for tips many thanks 
in advance.

frank




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>