HTML and CSS   XSLT   JavaScript   Images   Soft   Etc  
Vladimir Tokmakov

Namespace definition 19 June 2005


Task:

Prevent namespace confusion and, thus, avoid redundant xmlns attributes in the final script.

In the associated xsl templates you should also define xmlns attribute for element xsl:stylesheet. As to file symbols.ent, a reference in the root template is enough.

01 
02 
03 
04 
05 
06 
07 
08 
09 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet SYSTEM "symbols.ent">

<xsl:stylesheet version="1.0"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:output
        doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
        doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
        encoding="UTF-8"
    />

    <xsl:template match="/document">
        <html>
            <head>
                <title></title>
            
            <body>
                <xsl:apply-templates />
            </body>
        </html>
    </xsl:template>

</xsl:stylesheet>

Order a design...