Subject: Re: [xsl] I need to make sure that all namespace declarations get output to a particular element, not the document element From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Thu, 22 Mar 2007 14:14:49 +0100 |
I have a situation where the processor is obviously optimising namespace creation and placing them all over the place, unfortunately I need to place them exactly on a particular element.
The relevant steps of the transformation are:
<xsl:template match="/">
<office:document-content office:version="1.0"
...
<xsl:apply-templates select="ns:node-set($instancedocument)/*" mode="toplevel"/>
</xsl:template>
the template that handles toplevel matching does a lot of ordering of the document and uses <xsl:copy-of select="self::*"/> to output the actual instance inside of an xforms:model element:
which looks like this when it comes out
<xforms:model id="Invoice" xmlns:n="nodesetvariables" xmlns:in="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"> <xforms:instance id="Instance_1"> <in:Invoice>
unfortunately I absolutely need to have xmlns:in to show up on the in:Invoice element (as well as a couple other namespace declarations) if I expect this to work with Open Office (rant about Open Office / xforms omitted for sake of not making people go insane)
So how should I best accomplish this, should I exclude namespace at the top of my stylesheet, thus forcing the processor to put it back in elsewhere (doesn't actually seem to work because hey I need to control exactly where my namespace gets put. nothing else will do. )
<xsl:template ...> <xsl:call-template name="do-invoice"/> </xsl:template>
<xsl:template name="do-invoice" match="in:Invoice" xmlns:in="...."> <in:Invoice ...> </xsl:template>
-- World-wide corporate, govt. & user group XML, XSL and UBL training RSS feeds: publicly-available developer resources and training G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] I need to make sure that all , bryan rasmussen | Thread | Re: [xsl] I need to make sure that , bryan rasmussen |
[xsl] I need to make sure that all , bryan rasmussen | Date | Re: [xsl] I need to make sure that , Abel Braaksma |
Month |