# XMLTOXML

Updated: 10/19/2021, 9:29:48 PM
Created: 10/19/2021, 9:29:48 PM
Last Updated By: Kevin Munoz
Read Time: 1 minute(s)

# Description

This function transforms XML using a given XSL. It takes the general form:

XMLTOXML(xml,xsl,result)
1

Where:

xml is to be transformed using xsl.

Given:

# XSL Contents

<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="person">
<p><xsl:value-of select="name" /></p>
</xsl:template>
</xsl:stylesheet>
1
2
3
4
5
6
7

# XML Contents

<list>
<person>
<name>Bob</name>
</person>
<person>
<name>Amy</name>
</person>
</list>
1
2
3
4
5
6
7
8

An example of use is as:

XML_VAR = XMLTOXML(xml, xsl, rc)
CRT XML_VAR
1
2

to display:

<p>Bob</p><p>Amy</p>
1

If result = 0, XML_VAR will contain a transformed version of xml using xsl.

If result = 1, XML_VAR will hold an error message.

Go back to jBASE BASIC

Go back to Programmers' Reference Guide