Note that there are some explanatory texts on larger screens.

plurals
  1. POTransformation through msxsl namespace
    primarykey
    data
    text
    <p>I am using XSLT transformation template which works with MSSQL database in which i have to do some complex computing. I show piece of code below. Important is method GetZaloha. It returns large xml element which I want past it to output xml, but obv. this approach doesn't work. I tried to return value as string through xElem.ToString() but result is represented (ofc.) as string. so "&lt;" and ">" marks are represented as escaped &amp;gt and &amp;lt. Do somebody have idea how provide some object to transformation which will be represented as xml structured text? Thank you very much.</p> <pre><code>&lt;msxsl:script implements-prefix="utility" language="C#"&gt; &lt;msxsl:assembly name="System"/&gt; &lt;msxsl:assembly name="System.Data"/&gt; &lt;msxsl:using namespace="System"/&gt; &lt;msxsl:using namespace="System.Xml"/&gt; &lt;msxsl:assembly name="System.Core" /&gt; &lt;msxsl:assembly name="System.Xml.Linq" /&gt; &lt;msxsl:using namespace="System.Collections.Generic" /&gt; &lt;msxsl:using namespace="System.Linq" /&gt; &lt;msxsl:using namespace="System.Xml.Linq" /&gt; &lt;![CDATA[ public static XElement GetZaloha(string VariableSymbol) { XElement xElem = ..... return xElem; } ]]&gt; &lt;/msxsl:script&gt; &lt;xsl:template match="@* | node()"&gt; &lt;xsl:copy&gt; &lt;xsl:apply-templates select="@* | node()"/&gt; &lt;/xsl:copy&gt; &lt;/xsl:template&gt; &lt;xsl:template match="CisloDokladu"&gt; &lt;xsl:element name="CisloDokladu"&gt; &lt;xsl:copy-of select="@*" /&gt; &lt;xsl:apply-templates /&gt; &lt;/xsl:element&gt; &lt;xsl:variable name="VariabilniSymbol" select="./VariabilniSymbol"/&gt; &lt;xsl:element name="OdpoctyZaloh"&gt; &lt;xsl:attribute name="ObjectType"&gt;List&lt;/xsl:attribute&gt; &lt;xsl:attribute name="ObjectName"&gt;OdpocetZalohy&lt;/xsl:attribute&gt; &lt;xsl:value-of select="utility:GetZaloha($VariabilniSymbol)" /&gt; &lt;/xsl:element&gt; &lt;/xsl:template&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload