I am trying to convert the following XML to JSON for an assignment but am getting the error:
This XML file does not appear to have any style information associated with it.
source.xml
<people>
<name>John</name>
</people>
converter.xslt
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
{
"people":
{
<xsl:for-each select="people">
"name":
["
<xsl:value-of select="people/name"/>
"]
</xsl:for-each>
}
}
</xsl:template>
</xsl:stylesheet>
Any advice as to what I am doing wrong is appreciated. I believe the issue is the value-of element but cant understand what the issue is.