[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Namespace conflicts processing Word documents

Subject: Re: Namespace conflicts processing Word documents
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Mon, 6 Oct 2008 15:39:01 +0100
Re:  Namespace conflicts processing Word documents
>> 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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.