Academic Tutorials



English | French | Portugese | German | Italian
Home Advertise Payments Recommended Websites Interview Questions FAQs
News Source Codes E-Books Downloads Jobs Web Hosting
Chats

XSL Tutorial
XSL Introduction
Introduction to XSL
XSL Templates
XSL Attributes
The XSL Axes
Repetitions And Sortings in XSL
XSL Elements
XSL Conditional processing
Number generation and formatting in XSL
XSL Variables
Numeric Calculation in XSL
XSL Boolean Function
XSL String Functions
XSL Nodeset
XSL Output Element
Copy and Copy-of Constructs in XSL
Miscellaneous Additional Functions
XSL Combining
XSL Internationalization
Summary to xsl

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
CSS 1.0
CSS 2.0
HLML
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
CVS
Python
Apple Script
PL/SQL Tutorial
SQL Server
PHP
.NET (dotnet)
Microsoft.Net
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
VC++
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Photoshop Tutorial
Gimp Tutorial
Matlab
Gnuplot Programming
GIF Animation Tutorial
Scientific Visualization Tutorial
Graphics
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Weblogic Tutorial
SEO
Web Site Hosting
Domain Name
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Eclipse
J2ME
JBOSS
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Cobol
Assembly Language
Mainframe
Forth Programming
Lisp Programming
Pascal
Delphi
Fortran
OOPs
Data Warehousing
CGI Programming
Emacs Tutorial
Gnome
ILU
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills
Database Tutorials
Oracle
MySQL
Operating System
BSD
Symbian
Unix
Internet
IP-Masquerading
IPC
MIDI
Software Testing
Testing
Firewalls
SAP Module
ERP
ABAP
Business Warehousing
SAP Basis
Material Management
Sales & Distribution
Human Resource
Netweaver
Customer Relationship Management
Production and Planning
Networking Programming
Corba Tutorial
Networking Tutorial
Microsoft Office
Microsoft Word
Microsoft Outlook
Microsoft PowerPoint
Microsoft Publisher
Microsoft Excel
Microsoft Front Page
Microsoft InfoPath
Microsoft Access
Accounting
Financial Accounting
Managerial Accounting
Network Sites


The XSL Axes


Previoushome Next





The XSL Axes

Axes do play very important role in XSL. All the axes are used in the example given below


A D V E R T I S E M E N T


XML source

<?xml version="1.0"?>
<xslTutorial >

<doc>
<ancprec>
<p>Preceeding Ancestor. <br/></p>
</ancprec>

<gf>
<p>Ancestor. <br/></p>

<pprec choice="a">
<p>Preceeding Parent.<br/> </p>
</pprec>

<par>
<p>Parent. <br/></p>
<sibprec>
<p>Preceeding sibling.<br/> </p>
</sibprec>

<me id="id001">
<p>Me.<br/> </p>
<!-- Comment after Me -->

<chprec >
<p>Preceeding child.<br/> </p >
</chprec>
<child idref="id001">
<p>Child. <br/></p>
<?pi Processing Instruction ?>
<dprec>
<p>preceeding Descendant.<br/> </p>
</dprec>
<desc>
<p>Descendant.<br/> </p>
</desc>
<dfoll>
<p>Following Descendant.<br/> </p>
</dfoll>
</child>
<chfoll>
<p>following child.<br/> </p>
</chfoll>

</me>

<sibfoll>
<p>Following Sibling.<br/> </p>
</sibfoll>
</par>
<pfoll>
<p>Following Parent.<br/> </p>
</pfoll>
</gf>
<ancfoll>
<p>following Ancestor.<br/></p>
</ancfoll>

</doc>
</xslTutorial>
HTML output 1
<HTML>
<HEAD> </HEAD>
<BODY>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Document</title> </head>
<body>
<H2>Following Axis</H2>
<b>Following Sibling.
<br> Following Parent.
<br> following Ancestor.
<br> </b>
<H2>Descendant or Self Axis</H2>
<b>Me.
<br> Preceeding child.
<br> Child.
<br>preceeding Descendant.
<br> Descendant.
<br> Following Descendant.
<br> following child.
<br> </b>
<H2>Descendant Axis</H2>
<b>Preceeding child.
<br> Child.
<br>preceeding Descendant.
<br> Descendant.
<br> Following Descendant.
<br> following child.
<br> </b>
<H2>Self Axis</H2>
<b>Me.
<br> </b>
<H2>Child Axis</H2>
<b>Preceeding child.
<br> Child.
<br>following child.
<br> </b>
<H2>Following Axis</H2>
<p>
<b>Following Sibling.
<br> Following Parent.
<br> following Ancestor.
<br> </b>
<br>
<i>Note the lack of ancestors here?
<br>Learned anything about document order yet?</i> </p>
<H2>Following Sibling Axis</H2>
<b> Following Sibling.
<br> </b>
<H2>Attribute Axis</H2>
<b>id001</b>
<H2>Parent Axis</H2>
<b>Parent.
<br> </b>
<H2>Ancestor or Self Axis</H2>
<b>Ancestor.
<br>Parent.
<br>Me.
<br> </b>
<H2>Ancestor Axis</H2>
<b>Ancestor.
<br>Parent.
<br> </b>
<H2>Preceding Sibling Axis</H2>
<b>Preceeding sibling.
<br> </b>
<H2>Preceeding Axis</H2>
<b>
<i>Not Implemented in XT 22 09 99</i></b>
<H2>Namespace Axis</H2>
<b>
<i>Not Implemented in XT 22 09 99</i></b>
</body>
</html>
</BODY>
</HTML>
XSL stylesheet 1
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' >
<xsl:template match="/">
<!-- Lesson. Note how the initial context node
is reduced by the apply templates; this stops the 'leaking' of content when all I want is

a subset of the whole in the result tree -->
<xsl:apply-templates select="//me"/>
</xsl:template>
<xsl:template match="br">
<br />
</xsl:template>
<xsl:template match="me" priority="10">
<html>
<head>
<title> <xsl:text> Document</xsl:text> </title>
</head>
<body>
<H2>Following Axis</H2>
<b><xsl:apply-templates select="following::*/p"/></b>

<H2>Descendant or Self Axis</H2>
<b><xsl:apply-templates select="descendant-or-self::*/p"/></b>

<H2>Descendant Axis</H2>
<b><xsl:apply-templates select="descendant::*/p"/></b>

<H2>Self Axis</H2>
<b><xsl:apply-templates select="self::*/p"/></b>

<H2>Child Axis</H2>
<b><xsl:apply-templates select="child::*/p"/></b>

<H2>Following Axis</H2>
<p><b><xsl:apply-templates select="following::*/p"/></b>
<br /><i>Note the lack of ancestors here? <br />Learned anything
about document order yet?</i></p>

<H2>Following Sibling Axis</H2>
<b><xsl:apply-templates select="following-sibling::*"/></b>

<H2>Attribute Axis</H2>
<b>
<H2>Parent Axis</H2>
<b><xsl:apply-templates select="parent::*/p"/></b>

<H2>Ancestor or Self Axis</H2>
<b><xsl:apply-templates select="ancestor-or-self::*/p"/></b>

<H2>Ancestor Axis</H2>
<b><xsl:apply-templates select="ancestor::*/p"/></b>

<H2>Preceding Sibling Axis</H2>
<b><xsl:apply-templates select="preceding-sibling::*/p"/></b>

<H2>Preceeding Axis</H2>
<b><i>Not Implemented in XT 22 09 99</i></b>

<H2>Namespace Axis</H2>
<b><i>Not Implemented in XT 22 09 99</i></b>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

The child axis:: can be be omitted from the location step as it is a default axis. The Axis attribute:: can be abbreviatet to an @. // is a short for the /descendant-or-self::, . is the short for self:: and .. is the short for parent::.



Be the first one to comment on this page.




  XSL Tutorial eBooks

No eBooks on XSL could be found as of now.

 
 XSL Tutorial FAQs
More Links » »
 
 XSL Tutorial Interview Questions
More Links » »
 
 XSL Tutorial Articles

No XSL Articles could be found as of now.

 
 XSL Tutorial News

No News on XSL could be found as of now.

 
 XSL Tutorial Jobs

No XSL Articles could be found as of now.


Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • del.icio.us
  • De.lirio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

Previoushome Next

Keywords xsl templates, xsl include, xsl html, xsl id, xsl parent, xsl date, xsl child, xsl copy, xsl output, xsl fop, xsl dom, xsl fo, docbook xsl, c# xsl, xsl number, xsl transformation, xsl tree, svg xsl, xsl current, xalan xsl, msxml xsl, xsl empty, string xsl, xsl tag, value xsl, display xsl, xsl set, xsl using, xsl generate, convert xsl, xsl multiple, xsl call, multiple axes, xml axis, xslt axis, xsl axis,

HTML Quizzes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
CSS 1.0 Quiz
CSS 2.0 Quiz
HLML Quiz
XML Quizzes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizzes
JavaScript Quiz
VBScript Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizzes
ASP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
CVS Quiz
Python Quiz
Apple Script Quiz
PL/SQL Quiz
SQL Server Quiz
PHP Quiz
.NET (dotnet) Quizzes
Microsoft.Net Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
VC++ Quiz
Multimedia Quizzes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Photoshop Quiz
Gimp Quiz
Matlab Quiz
Gnuplot Programming Quiz
GIF Animation Quiz
Scientific Visualization Quiz
Graphics Quiz
Web Building Quizzes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Weblogic Quiz
SEO Quiz
Web Site Hosting Quiz
Domain Name Quiz
Java Quizzes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Eclipse Quiz
J2ME Quiz
JBOSS Quiz
Programming Langauges Quizzes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Cobol Quiz
Assembly Language Quiz
Mainframe Quiz
Forth Programming Quiz
Lisp Programming Quiz
Pascal Quiz
Delphi Quiz
Fortran Quiz
OOPs Quiz
Data Warehousing Quiz
CGI Programming Quiz
Emacs Quiz
Gnome Quiz
ILU Quiz
Soft Skills Quizzes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz
Database Quizzes
Oracle Quiz
MySQL Quiz
Operating System Quizzes
BSD Quiz
Symbian Quiz
Unix Quiz
Internet Quiz
IP-Masquerading Quiz
IPC Quiz
MIDI Quiz
Software Testing Quizzes
Testing Quiz
Firewalls Quiz
SAP Module Quizzes
ERP Quiz
ABAP Quiz
Business Warehousing Quiz
SAP Basis Quiz
Material Management Quiz
Sales & Distribution Quiz
Human Resource Quiz
Netweaver Quiz
Customer Relationship Management Quiz
Production and Planning Quiz
Networking Programming Quizzes
Corba Quiz
Networking Quiz
Microsoft Office Quizzes
Microsoft Word Quiz
Microsoft Outlook Quiz
Microsoft PowerPoint Quiz
Microsoft Publisher Quiz
Microsoft Excel Quiz
Microsoft Front Page Quiz
Microsoft InfoPath Quiz
Microsoft Access Quiz
Accounting Quizzes
Financial Accounting Quiz
Managerial Accounting Quiz
Testimonials | Contact Us | Link to Us | Site Map
Copyright ? 2008. Academic Tutorials.com. All rights reserved Privacy Policies | About Us
Our Portals : Academic Tutorials | Best eBooksworld | Beyond Stats | City Details | Interview Questions | Discussions World | Excellent Mobiles | Free Bangalore | Give Me The Code | Gog Logo | Indian Free Ads | Jobs Assist | New Interview Questions | One Stop FAQs | One Stop GATE | One Stop GRE | One Stop IAS | One Stop MBA | One Stop SAP | One Stop Testing | Webhosting in India | Dedicated Server in India | Sirf Dosti | Source Codes World | Tasty Food | Tech Archive | Testing Interview Questions | Tests World | The Galz | Top Masala | Vyom | Vyom eBooks | Vyom International | Vyom Links | Vyoms | Vyom World | Important Websites
Copyright ? 2003-2024 Vyom Technosoft Pvt. Ltd., All Rights Reserved.