XMLTools
Transform
apply XSLT transformation to an XML document
Calling Sequence
Parameters
Description
Examples
Transform(xslTransform, xmlDoc)
xslTransform
-
XSLT transformation, which can be a filename or a Maple XML tree
xmlDoc
XML document, which can be a filename or a Maple XML tree
The Transform(xslTransform, xmlDoc) command applies the XSLT transformation xslTransform to the XML document xmlDoc.
with⁡XMLTools:
ss≔<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\"><xsl:output method=\"xml\" indent=\"yes\"/><xsl:template match=\"a\"><A><xsl:apply-templates select=\"b\"/></A></xsl:template><xsl:template match=\"b\">B:<xsl:value-of select=\"@d\"/></xsl:template></xsl:stylesheet>:
doc≔<a><b d=\"foo\"/></a>
doc≔<a><b d="foo"/></a>
res≔ToString⁡Transform⁡ParseString⁡ss,ParseString⁡doc
res≔<?xml version="1.0" encoding="ISO-8859-1"?> <A>B:foo</A>
Transform⁡transform.xsl,doc.xml:
See Also
XMLTools[ParseFile]
XMLTools[ParseString]
Download Help Document