XSL Namespaces

qualified name xsl:stylesheet
prefix xsl
local part stylesheet

 

<xsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/Transform">

Normal start tag
<xsl:template match="pattern"> normal <xsl:.. starting, processor will process this according to the specs above
<template><value-of select="." /></template> no <xsl:.. here -- processor will just print this as is
</xsl:template> normal closing </xsl:.. tag
</xsl:stylesheet> closes our <xsl: stylesheet .. tag

So......

declare our "proprietary" template tag -- which we will do stuff with elsewhere

 

<xsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/Transform"

Normal start tag
xmlns:mine="http://www.mysite.com/namespaces.txt"> our new definition of where to look for our special tags
<xsl:template match="pattern"> normal <xsl:.. starting, processor will process this according to the specs above
<mine:template> <value-of select="." /> </mine:template> processor looks at the "mine" namespaces.txt for our tag definitions
</xsl:template> normal closing </xsl:.. tag
</xsl:stylesheet> closes our <xsl: stylesheet .. tag

 

Default

declare our "proprietary" template tag --as the default

 

<xsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/Transform"

Normal start tag
xmlns="http://www.mysite.com/namespaces.txt"> took out the "mine" and the colon, too.
<xsl:template match="pattern"> normal <xsl:.. starting, processor will process this according to the specs above
<template> <value-of select="." /> </template> processor looks at the namespaces.txt for our tag definitions
</xsl:template> normal closing </xsl:.. tag
</xsl:stylesheet> closes our <xsl: stylesheet .. tag

Default to use HTML

declare our "HTML" template tag --as the default

 

<xsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/Transform"

Normal start tag
xmlns:mine="http://www.mysite.com/namespaces.txt" added the "mine" and the colon, too.
xmlns="http://www.w3.org/TR/REC-html40"> No prefix here, but defaults to html40.
<xsl:output method="html" indent="yes"> a output method for xsl, to allow normal html processing
<xsl:template match="pattern"> normal <xsl:.. starting, processor will process this according to the specs above
<HTML>
<HEAD>
<TITLE>My Page</TITLE>
</HEAD>
<BODY>
These now default to HTML tags
<mine:template> <value-of select="." /> </mine:template> processor looks at the namespaces.txt for our tag definitions
</BODY>
</HTML>
normal closing for html
</xsl:template> normal closing </xsl:.. tag
</xsl:stylesheet> closes our <xsl: stylesheet .. tag