In faq1600-6410 the author teaches a method for converting a VBScript (ASP) recordset object to JSON.
It is relatively simple to convert an XML document to JSON on the server side (at the cost of some processing time on the server), thereby possibly simplifying the Javascript in the client.
Here is an XML document containing data similar to that found in faq1600-6409. [code XML]<?xml version="1.0"?>
<root>
<record>
<name handle="tsdragon">
<first>Tracy</first>
<last>Dryden</last>
</name>
</record>
<record>
<name handle="steved">
<first>Steven</first>
<last>Dee</last>
</name>
</record>
<record>
<name handle="thealias">
<first>John</first>
<last>Smith</last>
</name>
</record>
</root>[/code]
Here is an XSLT (translating stylesheet) to convert such a document to JSON suitable for sending to the client:[code XSLT]<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="text" encoding="UTF-8"/>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.