| <?xml version="1.0" encoding="iso-8859-1"?> |
| <xsl:transform |
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| version="1.0" |
| > |
| |
| <xsl:template match="/"> |
| <html><body> |
| <h1>Table of elements</h1> |
| <table border="1" cellpadding="5"> |
| <tr><td>Element</td><td>Prefix</td><td>Local name</td><td>Namespace URI</td></tr> |
| <xsl:apply-templates select="//*"> |
| <xsl:sort select="namespace-uri()"/> |
| <xsl:sort select="local-name()"/> |
| </xsl:apply-templates> |
| </table></body></html> |
| </xsl:template> |
| |
| <xsl:template match="*"> |
| <xsl:variable name="prefix"> |
| <xsl:choose> |
| <xsl:when test="contains(name(), ':')"> |
| <xsl:value-of select="substring-before(name(),':')"/> |
| </xsl:when> |
| <xsl:otherwise/> |
| </xsl:choose> |
| </xsl:variable> |
| <tr> |
| <td><xsl:value-of select="name()"/></td> |
| <td><xsl:value-of select="$prefix"/></td> |
| <td><xsl:value-of select="local-name()"/></td> |
| <td><xsl:value-of select="namespace-uri()"/></td> |
| </tr> |
| </xsl:template> |
| |
| |
| </xsl:transform> |
| |