I’m learning how to represent non-English data in XML and ran into an article titled “Well-structured XML Goes Cosmopolitan” written by Ilari Aarnio and hosted by DevX.com. Buried in the article was an interesting technique that showed how to read XML documents from within XSLT.

<?xml version=”1.0” encoding=”UTF-8”?>
<xsl:stylesheet version=”1.0” xmlns:xsl=”http://www.w3.org/1999/XSL/Transform” xmlns=”http://www.w3.org/1999/xhtml”>
    <xsl:param name=”currLang”>en</xsl:param>
    <xsl:output method=”xml” encoding=”UTF-8” indent=”yes” doctype-public=”-//W3C//DTD XHTML 1.0 Strict//EN”/>

    <xsl:template match=”/”>
        <xsl:variable name=”cvData”>
            <xsl:value-of select=”$currLang”/>
    <xsl:apply-templates select=”document($cvData)”/>

    <!– add normal XSLT processing here –>