[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Namespace conflicts processing Word documents
Peter,
You might also consider making your shared module completely namespace-neutral, by using such tricks as <xsl:template name="make-h1"> <xsl:param name="contents"> <xsl:apply-templates/> </xsl:param> <h1> <xsl:copy-of select="$contents"/> </h1> </xsl:template> ... then calling the template by name from the namespace-specific stylesheets, instead of using a pattern match. (Other things can be parameterized too, including the context.) So: <xsl:template match="w:p[w:pPr[w:pStyle[@w:val='Heading1']]]"> <xsl:call-template name="make-h1"/> </xsl:template> but also <xsl:template match="w:p[w:pPr[w:pStyle[@w:val='Heading1']]]]" mode="special> <xsl:call-template name="make-h1"> <xsl:with-param name="contents"> <xsl:apply-templates mode="special"/> </xsl:with-param> </xsl:call-template> </xsl:template> Mind you, I'd still rather pipeline. Basically the API you design amounts to mapping to a neutral language in any case, and what you gain in being able to compile for one pass is arguably lost in flexibility. Cheers, Wendell At 11:52 AM 10/6/2008, you wrote: 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 ====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|