|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Namespace conflicts processing Word documents
G. Ken Holman wrote: [...] Prefixes are cheap and ambiguous ... namespace-aware processing is based on the URI a prefix points to, not the prefix itself. A WordML document using "w:" as a prefix is independent of an OOXML document using "w:" as a prefix. 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 :-) On the surface, this appears to mean that an XSLT file written to process WordML files' w:* elements cannot be used to process OOXML files' w:* elements -- two parallel versions are needed, one with the WordML w: namespace and one with the OOXML w: namespace. 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. What I think you are missing is that an XSLT stylesheet has no obligation to use the same prefix as another XSLT stylesheet or any XML document being used as a source file. Except that when it comes to process the document, the declared namespace URI (IRI) must be the same in both the stylesheet and the document. I was hoping to do without preprocessing, but as this is all in Cocoon anyway, pipelining it isn't really a problem. ///Peter
|
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
|

Cart








