Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Exclusion of Xsl Processing for a particular Node Set

From: "Dimitre Novatchev" <dimitren@---.---.-->
To: NULL
Date: 10/6/2006 7:39:00 PM

It would be good to know that George has used one of the most powerful XSLT 
design pattern -- the identity template and overriding it for a few 
exceptional types of nodes.

Cheers,
Dimitre Novatchev

"George Bina" <george@o...> wrote in message 
news:1160121153.189605.276550@e......
> Hi,
>
> There are many ways you can achieve that, one possibility is below.
> That matches on elements that have at most one ancestor element and
> replaces them with div and by default copies any node to the output.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
>    <xsl:template match="*[count(ancestor::*)&lt;2]">
>        <div><xsl:apply-templates/></div>
>    </xsl:template>
>    <xsl:template match="node() | @*">
>        <xsl:copy>
>            <xsl:apply-templates select="node() | @*"/>
>        </xsl:copy>
>    </xsl:template>
> </xsl:stylesheet>
>
> Best Regards,
> George
> ---------------------------------------------------------------------
> George Cristian Bina
> <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
> www.---.com
>
>
>
>
> deepak.programming@g... wrote:
>> Dear All,
>>       I have a problem regarding Xsl Transformation. The Problem is
>> that I want to apply xsl transformation till a level and after that i
>> want that the original structure should be copied as it is. For ex.
>>
>> <node>
>>   <subNode>
>>     <childNode1>
>>      </childNode1>
>>      <childNode2>
>>      </childNode2>
>>   </subNode>
>> </node>
>>  in the above xml only the xsl transformation should apply to node and
>> subnode. After that the transformation should result in same node
>> structure as it is given. somewhat like this
>> <div>  --- replaced node
>>   <div>  -- replace subnode
>>   --structure as it is.
>>   <childNode1>
>>   </childNode1>
>>   <childNode2>
>>   </childNode2>
>>   </div>
>> </div> Can any one tell me how to achieve that. thanks in advance.
>> Deepak.
> 




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent