[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: [xsl] Namespace conflicts processing Word documents
Subject: Re: [xsl] Namespace conflicts processing Word documents From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx> Date: Mon, 6 Oct 2008 15:39:01 +0100 |
>> 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/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Namespace conflicts proce, Michael Kay | Thread | Re: [xsl] Namespace conflicts proce, Peter Flynn |
RE: [xsl] Namespace conflicts proce, Michael Kay | Date | Re: [xsl] Namespace conflicts proce, Peter Flynn |
Month |