[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: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 06 Oct 2008 10:14:22 -0400
Re:  Namespace conflicts processing Word documents
At 2008-10-06 14:30 +0100, Andrew Welch wrote:
> This makes it appear that namespaces cannot be inherited from an outer XSLT
> file to an included or imported one; in effect that the omission of
> namespace declarations on the included/imported xsl:stylesheet element
> nullifies all outer namespace declarations.
>
> Is this correct, or have I missed something?

No it's correct - namespaces operate at the XML level, not the XSLT
level.

But the XSLT level relies on the XML-level namespaces in context.


I often get confused about that, and think that somehow import
precedence would allow you to do what you are trying to do, so you're
no alone.

Since XSLT files are XML files, and each imported or included XSLT stylesheet has to be a properly formed XSLT stylesheet, I think the current specification is most appropriate.


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.


To fix your problem, you could just define two different prefixes, say
"w" and "w2" for example (not for real)  and then modify all of your
stylesheets to handle both... not great I know.  Or if possible just
match on *.  Or alternatively do a 2 pass transform and convert the
input to use the other namespace, then process as normal.

I'm not sure about the conversion ... if you transform an OOXML <p> into a WordML <p> then when it comes time to act on <p> you don't know which it really means.


I hope this helps.

. . . . . . . . . . . Ken

--
Upcoming XSLT/XSL-FO hands-on courses:      Wellington, NZ 2009-01
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video sample lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg
Video course overview:  http://www.youtube.com/watch?v=VTiodiij6gE
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

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.