Thanks to everyone for the very informative followups to my last post
(sorry about the busted subject line, Tommie). I took <xsl:template
match="text()"/> out of all of my sheets.
I'm having trouble with transformations involving namespaces though.
All of my xsl files begin with a preamble that I've till now considered
a magic incantation generated by my editor. It includes a number of
statements that assign namespaces to various prefixes like xsl, xs, xn,
xdt, etc. There is no assignment for the default namespace.
So I've been cruising along making xml docs and xsl transformations
with no xmlns= at all. I now realize I may have erred.
If I'm transforming one of my namespaceless docs with one of my
namespaceless sheets, everything is fine until I <xsl:apply-templates
select="document()"> a sheet with an xmlns="something" on its root
node. If I remove this attribute from the root node, all is well, but
that's more of a phenomenon than a solution.
I had assumed that this was simply a matter of matching the values of
xmlns in all my various documents' root nodes. I tried this but it
doesn't work. If I have:
<root>
<child>
foo
</child>
<child>
foo
</child>
</root>
and run it through:
<xsl:stylesheet....>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="root">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="child">
child processed
</xsl:template>
</xsl:stylesheet>
I get my expected output of:
child processed
child processed
If I add:
xmlns="foo" to <root> and <stylesheet> though, I get:
foo
foo
The result of the default rules, I imagine.
I also tried changing the attribute on the stylesheet to
xpath-default-namespace="foo" because I thought 'hey, these Exprs are
all XPath, right?". That does nothing.
The only thing that seems to do what I want is to assign a foo prefix
in the namespace to the desired ns, and then prepending all the XPath
Exprs with foo:. This is not what I want to do though. I just want
my stylesheet and source docs to all be in the same namespace, with no
prepending of anything. The stylesheets are already written with all
the xsl tags prefixed with xsl: so I don't see how there's a potential
problem with namespace collision.
Thanks in advance for any help.