xsl-list
[Top] [All Lists]

Re: [xsl] Namespace conflicts processing Word documents

2008-10-06 10:39:29
To be honest, I'm not too sure things are correct as they stand now.
A prefix used in an XPath doesn't stop the XML from being namespace
well-formed, so I don't see why that namespace needs to be declared in
that particular file. It seems an artificial restriction.

Not to me.  Importation and inclusion doesn't happen at a syntax level, it
happens at a semantic level.  Therefore, building the semantic components of
an XSLT stylesheet has to happen solely from the XML syntax being used to
express the components, not to any contextual use of the syntax by other
copmonents.

My point is, given this:

<xsl:template match="/">
    <foo:bar>aaa</foo:bar>
</xsl:template>

...we have to declare the "foo" prefix to make the XML namespace
well-formed.  This makes sense, because XSLT is XML and must follow
the same rules as XML.

If you have this:

<xsl:template match="/">
    <xsl:copy-of select="/foo:bar"/>
</xsl:template>

...then the XML is namespace well-formed - it's just an attribute
value as far as XML is concerned, the XML parser certainly wouldn't
complain about it because it means nothing to XML.  I wonder why XSLT
requires that the foo prefix be declared in that particular file, as
opposed to the compiled stylesheet module?

Variables, named templates, keys etc can all be declared in any file,
why not namespaces in this way?  If it's just for consistency that's
fine, but it's far from intuitive.



-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--