Subject: RE: namespace issue
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Mon, 17 May 2004 09:21:04 +0100
|
Literal result elements are copied to the result tree together with all
their in-scope namespaces. You can suppress this by using
exclude-result-prefixes="dt" on xsl:stylesheet.
Michael Kay
> -----Original Message-----
> From: Jonathan Kart [mailto:jkart@xxxxxxxxxxxx]
> Sent: 17 May 2003 07:02
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: namespace issue
>
>
> Hi all,
>
> I have a namespace problem I can't figure out.
>
> my xsl stylesheet declaration looks like this:
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:dt="http://xsltsl.org/date-time" >
>
> then further on in the stylesheet i have various templates which use
> div tags. for example:
>
> <xsl:template match = "E-Mail_Addresses" >
> <div class="object" id="object28">
> <xsl:apply-templates select="Type" />
> <xsl:apply-templates select="Address" />
> </div>
> </xsl:template>
>
> the xml (for the E-Mail_Addresses element) looks like:
>
> <E-Mail_Addresses instance_uid = "34" >
> <Address >bob@xxxxxxxxxxxxx</Address>
> <Type >
> <option>-Select a Type-</option>
> <option value="4" >Home</option>
> <option value="3" selected="1">Work</option>
> </Type>
> </E-Mail_Addresses>
>
> the resulting xhtml looks like:
>
> <div xmlns:dt="http://xsltsl.org/date-time" class="object"
> id="object28">
> <span class="attribute" id="attribute74">Work</span>
> <span class="attribute"
> id="attribute73">bob@xxxxxxxxxxxxx</span>
> </div>
>
> I'm not worried about the inner spans. They're handled by other
> templates which seem to be doing their jobs. What I don't
> know is why
> the xmlns attribute is being inserted into the div element.
>
> Any help would be most appreciated.
> Thanks,
> -jonathan kart
|