Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
XML
select the following node
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="naima.mans, post: 5807644, member: 146507"] On 17 jan, 14:20, Joe Kesselman wrote: hello thanks for your answer.. by brother i mean the following node i have found what want with following-sibling::node[position=1] for information here my xslt: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/ Transform" xmlns:msg="http://xxxxxxxxxx"> <xsl:output method="text" encoding="ISO-8859-1" /> <xsl:strip-space elements="*" /> <xsl:template match="@*|node"> <xsl:copy> <xsl:apply-templates select="@*|node" /> </xsl:copy> </xsl:template> <xsl:template match="/"> <!--<xsl:element name="changes"> --> <xsl:apply-templates select="//*" /> <!--</xsl:element> --> </xsl:template> <xsl:template match="//*"> <xsl:variable name="actual" select="."/> <xsl:variable name="follow" select="following-sibling::node [position=1]"/> <xsl:variable name="brother" select="*[position=1]"/> <xsl:if test="local-name($actual) = name($follow)"> <xsl:if test="name($brother)=''"> <xsl:value-of select="local-name($actual)"/><xsl:text> ~ </xsl:text> <!-- value before --> <xsl:value-of select="($actual)"/><xsl:text> ~ </xsl:text> <!-- value after --> <xsl:value-of select="($follow)"/><xsl:text> ~ </xsl:text> <!-- attribut before --> <xsl:for-each select="($actual/@*)"> <xsl:value-of select="local-name"/> <xsl:text> = </xsl:text> <xsl:value-of select="."/> <xsl:if test="position!=last"> , </xsl:if> </xsl:for-each> <xsl:text> ~ </xsl:text> <!-- attribut after --> <xsl:for-each select="($follow/@*)"> <xsl:value-of select="local-name"/> <xsl:text> = </xsl:text> <xsl:value-of select="."/> <xsl:if test="position!=last"> , </xsl:if> </xsl:for-each> <xsl:text> ~ </xsl:text> <xsl:for-each select="ancestor::*"> <xsl:value-of select="local-name"/> <xsl:text> ( </xsl:text> <xsl:for-each select="@*"> <xsl:value-of select="local-name"/> <xsl:text> = </xsl:text> <xsl:value-of select="."/> <xsl:if test="position!=last"> , </xsl:if> </xsl:for-each> <xsl:text> ) </xsl:text> <xsl:if test="position!=last"> / </xsl:if> </xsl:for-each> <xsl:text> </xsl:text> </xsl:if> </xsl:if> </xsl:template> </xsl:stylesheet> [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
XML
select the following node
Top