xsl-list
[Top] [All Lists]

Re: [xsl] logic for remove namespace

2016-09-05 08:34:07
Hi,


Yes, it is possible to have both "main logic" templates and "remove-namespace" 
templates in the same stylesheet. It might be helpful to set the priority of 
your "main logic" templates higher than the priority of the "remove-namespace" 
templates, which can be done by adding a priority="" attribute on xsl:template 
elements. It might also be helpful to use xsl:next-match in some of the "main 
logic" templates. Start by copying the main logic and namespace templates into 
one stylesheet, then think through what needs to happen in the stylesheet, 
test, and adjust accordingly until what you want to have happen is being done 
correctly by the stylesheet.


I hope this helps,


Vincent




________________________________
From: Rahul Singh rahulsinghindia15(_at_)gmail(_dot_)com 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Monday, September 5, 2016 7:56:12 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] logic for remove namespace

Hi,

I am using below code to remove namespace, but i want to add this XSL in my 
main XSL for related output fetch. Can this possible to add in same page means 
main logic to extract something as well remove namespave logic:


<xsl:template match="name">
        <xsl:element name="lname">
                    <xsl:value-of select="/lname"/>
        </xsl:element>
    </xsl:template>

    <xsl:template match="*">
        <xsl:element name="{local-name()}">
            <xsl:for-each select="@*">
                <xsl:attribute name="{local-name()}">
                    <xsl:value-of select="."/>
                </xsl:attribute>
            </xsl:for-each>
            <xsl:apply-templates/>
        </xsl:element>
    </xsl:template>

XSL-List info and archive<http://www.mulberrytech.com/xsl/xsl-list>
EasyUnsubscribe<-list/194671> (by email<>)
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>