BizTalk Utilities CV ,   Jobs ,   Code library  
 
 
Page 6 of 28

 

Previous Page Table Of Contents Next Page

XSLT Tutorial

XPath : Axis, Predicate

Axis:

An axis returns a list of nodes, based on the context of the original node.

The following are examples of some the axis location paths.

Expression Abr. Comment
self . This selects the current node in the context.

Example :
<TD><xsl:value-of select="."/></TD>

If the context node contains a text value, insert this value.

ancestor   This selects a path of all parent and parent-of-parent nodes of the current node, starting from the first parent above the context node.
parent .. This selects only the single parent of the context node.
attribute  @ This selects all the attributes of an element.

Example:
<TD><xsl:value-of select="@PERSONID"/></TD>

Selects the PERSONID attribute.

child   Selects all the children of the current node.  This is the default in the abbreviated syntax.

Predicate

The Axis helps us to find nodes around the current node.  To be able to find a sub-node that contains a specific value, we use a predicate. It consists of a 'qualifying expression' to do the query.

The syntax for the predicate is:

[] Use square brackets around the expression.
Expression The expression is inside the brackets.
Example: book[name='Phar Lap']

The following are example of Predicates:

article[position()=2] This is syntax to find the second 'article' element.
article[starts-with(name, "B")] This is syntax to find all article nodes, whose name element starts with 'B'.

 

Page 6 of 28

 

Previous Page Table Of Contents Next Page
 

Recent Jobs

Sr. Software Engineer - Analytics
Immediate Mainframe openings for Ch
Immediate TANDEM-TAL openings for C
Immediate ASP.NET/C# Openings for C
Sr. Software Engineer

View all Jobs (Add yours)
View all CV (Add yours)



swimming pool builder
spfxmasks
water softener
Teleconference
Host Department NOLIMIT Web Hosting
MSN
sunglasses
conference calling


    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP