[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 12:30:51 -0400
Re:  Namespace conflicts processing Word documents
At 2008-10-06 16:52 +0100, Peter Flynn wrote:
Syntactically, yes. Semantically, a paragraph is a paragraph is a paragraph (unless it's a heading, or a list item -- but those are just qualified paragraphs in Word :-)
...
Right, so I can have two otherwise identical stylesheets, one declaring the WordML w: namespace and the other declaring the OOXML w: namespace, with both using the identical
<xsl:template match="w:p[w:pPr[w:pStyle[@w:val='Heading1']]]">
<h1><xsl:apply-templates/></h1>
</xsl:template>
but I can't have a shell stylesheet for each namespace which both import/include the template code from a common (shared) file, because (a) namespaces don't get inherited into imports/includes, and (b) the common file will necessarily lack any namespace declaration for w: and will therefore not be well-formed.


OK. So long as I wasn't missing a trick there.

Well, if they are going to be so very identical, use XSLT 2.0 and the following:


   <xsl:template match="*:p[*:pPr[*:pStyle[@*:val='Heading1']]]">
     <h1><xsl:apply-templates/></h1>
   </xsl:template>

... and take the risk that a <p> is a <p> is a <p>.

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.