OCLOperators XsltTransformXml
No edit summary
(Automatically adding template at the end of the page.)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Use selfVM.XsltTransformXml(<xsltstring>, <xmlstring>) transforms XML using the provided XSLT text.
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:
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:
Line 21: Line 21:
</pre>
</pre>
[[Category:OCLOperators]]
[[Category:OCLOperators]]
[[Category:OCL ViewModel Operators]]
{{Edited|July|12|2024}}

Latest revision as of 15:40, 10 February 2024

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>
This page was edited 96 days ago on 02/10/2024. What links here