Re: [xsl] Create an end element - possible?

Subject: Re: [xsl] Create an end element - possible?
From: "[x] cross solution" <info@xxxxxxxxxxxxxxxxxx>
Date: Sun, 3 Oct 2010 20:04:51 +0200
>> So now i have to find the "Start" and "End" Tags in the value-of content
(the content of <Data> is only an example).
>> Based on this information i have to create a new element "<w:p>" (this
works).
>> But to create the </w:p> element doesn't work.
>
> There is nothing like a <w:p> element or a </w:p> element in the data XSLT
operates on.
yes, right - i need it only for the WordML XML - Microsoft
> It operates on a tree of nodes. That tree might be created by parsing markup
with start and end tags but when XSLT works on data there are no start tags or
end tags, there are only nodes.
> And when you create output you also create a tree of nodes, you are not
creating tags.
yes, true - i create trees from the Database - only ROW/DATA trees and the
problem is, that all formattings of the DATA content is in the DATA content
self as <SPAN STYLE...
In XSLT 2.0 is an option to transform the Data content in tree based content,
but not in XSLT 1.0

> So xsl:element creates an element node in a result tree, it does not create
start or end tags.
yes, you'r right, but i have to create a new xml file with the structure of
WordML. And the formattings are in the content of the DATA.

> You might want to show us a sample of the input you have and the
corresponding output you want to create with XSLT 1.0, then we can try to
suggest an XSLT way of achieving that.
Enclose find a sample of the DATA content
<COL>
<DATA>&lt;SPAN STYLE= &quot;font-weight: bold;text-align: center;&quot;
&gt;VEREINBARUNG (VERTRAG)&lt;/SPAN&gt;&lt;SPAN STYLE= &quot;text-align:
center;&quot; &gt;</DATA>
</COL>


Done! It works!

I use the  <xsl:text> function

 <xsl:if test="contains($xString, '-Start') or not(contains($xString,
'-Cont')) and not(contains($xString, '-End'))">
        <xsl:text disable-output-escaping="yes">&lt;w:p&gt;</xsl:text>
 </xsl:if>
 <xsl:if test="contains($xString, '-End') or not(contains($xString, '-Cont'))
and not(contains($xString, '-Start'))">
         <xsl:text disable-output-escaping="yes">&lt;/w:p&gt;</xsl:text>
 </xsl:if>

and it works now.
Oxygen also accept it in the debugger.
The result is what i need.



Armin Egginger
[x] cross solution
Kurfuerstenstr. 28
82110 Germering
Germany
Phone:  +49 - (0)89 - 84 10 25 70
Fax: +49 - (0)89 - 84 10 25 73
USt.ID.: DE176843593

Current Thread