[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: I need to make sure that all namespace declaration
At 2007-03-22 13:51 +0100, bryan rasmussen wrote:
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. I've not heard of a processor moving a required namespace declaration "up" the result tree. Once an element in the result tree is constructed, the adding of children nodes to the element wouldn't typically change the completed parent element. The relevant steps of the transformation are: But you are missing showing us the declaration at the top and the namespaces in the stylesheet document element ... are you declaring the "xmlns:in" namespace there? <xsl:template match="/"> Your output indicates to me that an ancestor of the xforms:model element in your stylesheet has the invoice namespace. That is assuming the xforms:model comes from a literal result element in your stylesheet. 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. ) Sometimes I have used techniques such as: <xsl:stylesheet xmlns:xforms="..." ...> <xsl:template ...> <xsl:call-template name="do-invoice"/> </xsl:template> <xsl:template name="do-invoice" match="in:Invoice" xmlns:in="...."> <in:Invoice ...> </xsl:template> ... so as to focus the use of namespaces in my stylesheet. Alternatively, one might use an imported or included stylesheet in which the UBL namespaces are declared, but not in the importing or including stylesheet. I hope this helps. . . . . . . . . . . . . Ken -- 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
|
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
|