Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Node names of siblings in xslt

843834Aug 14 2009 — edited Aug 17 2009
I have following xslt code
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="*">
		<root>
			<xsl:for-each select="*/*">
				<xsl:variable name="mainNode" select="name()" />
				<xsl:if
					test="starts-with($mainNode,'Add_1') and contains($mainNode,'street1')">
					<Add>
						<xsl:value-of select="." />
						
<!-- I want something that goes in here that allows me to select next node name of "mainNode" and its next node-- i.e. Node names of next two siblings of mainNode -->

				
					</Add>
				</xsl:if>
			
			</xsl:for-each>
		</root>
	</xsl:template>
</xsl:stylesheet>
As mentioned in the code, I want to find node names of next two siblings of mainNode

Any suggestions?

Thanks...
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 14 2009
Added on Aug 14 2009
5 comments
1,286 views