OCLOperators XsltTransformXml
No edit summary
(Updated Edited template to July 12, 2025.)
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
You use XsltTransformXml(<xsltstring>, <xmlstring>)  transforms xml using the provided XSLT text.
<message>Write the content here to display this box</message>
Using <code>selfVM.XsltTransformXml(<xsltstring>, <xmlstring>)</code> transforms XML using the provided XSLT text.
 
Below is a sample that replaces the root node named "root" with "PrspctsDataRpt" - and drops the node named XSLT from the output but keeps everything else intact:


<pre>
<pre>
Line 18: Line 21:
</xsl:stylesheet>
</xsl:stylesheet>
</pre>
</pre>
[[Category:OCLOperators]]
[[Category:OCL ViewModel Operators]]
{{Edited|July|12|2025}}

Latest revision as of 05:56, 20 January 2025

This page was created by Lars.olofsson@mdriven.net on 2019-02-25. Last edited by Edgar on 2025-01-20.

Using selfVM.XsltTransformXml(<xsltstring>, <xmlstring>) transforms XML using the provided XSLT text.

Below is a sample that replaces the root node named "root" with "PrspctsDataRpt" - and drops the node named XSLT from the output but keeps everything else intact:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="xml" indent="yes"/>
  <xsl:strip-space elements="*" />
  <xsl:template match="@* | node()">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
  </xsl:template>
  <xsl:template match="xslt"/>

 
  <xsl:template match="root">
    <PrspctsDataRpt><xsl:apply-templates select="@*|node()" /></PrspctsDataRpt>
  </xsl:template>
</xsl:stylesheet>