I apologize for what must be the hundredth question about xsl:template and namespaces. I did read other questions (for example here, here and here), but still cannot put the pieces together.
This is my input:
<?xml version="1.0" encoding="UTF-8" ?>
<AuthorIT version="6.2.0" xmlns="http://www.authorit.com/xml/authorit"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.authorit.com/xml/authorit AuthorIT.xsd">
<Objects>
<Book>
<Object>
<Description>1089-802-01</Description>
</Object>
</Book>
</Objects>
</AuthorIT>
This is my stylesheet:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ait="http://www.authorit.com/xml/authorit" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.authorit.com/xml/authorit AuthorIT.xsd">
<xsl:template match="/">
<Table>
<apply-templates/>
</Table>
</xsl:template>
<xsl:template match="ait:Book">
<Row>
<Cell>
<Data><xsl:value-of select="./Object/Description"/></Data>
</Cell>
</Row>
</xsl:template>
Expected result:
<Table>
<Row>
<Cell>
<Data>1089-802-01</Data>
</Cell>
</Row>
</Table>
Actual result:
<Table>
1089-802-01
</Table>
In other words, xsl:template match="/" matches, but xsl:template match="ait:Book" does not.
How do I match the Book element?
Note that I took the default namespace from the input root element AuthorIT xmlns="http://www.authorit.com/xml/authorit" and added it to the stylesheet as xmlns:ait="http://www.authorit.com/xml/authorit". I then try to match Book elements as ait:Book. But I must have misunderstood this answer.
I do not know if it is important, but I am using Saxon HE 9 and the Notepad++ XML plugin.