Using XML and stylesheets

The style sheets for XML are called the XSL. An XSL is used to display the xml data in a format that is defined by the user in the xsl file.


XSL uses Xpath to navigate through the xml document. In an xsl document, the <xsl:stylesheet> or the <xsl:transform> element is used as the root element. You can use either of these tags as the root element since both of them are the same.

In this tag you have to include the version attribute and the XSLT namespace in this element. For example a complete tag will look like,

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

The next step is to create an xsl:template element within which you will using other xsl elements like xsl:for-each and xsl:value-of to loop through the elements of the xml file and display the content of the nodes.

You can embed the style sheet in the xml file itself so that when a user opens the xml file the content is displayed according to the formatting information found in the xsl file.



SetApp - 100 Apps for everything you ever wanted to do on Mac

FREE Subscription

Subscribe to our mailing list and receive new articles
through email. Keep yourself updated with latest
developments in the industry.

Name:
Email:

Note : We never rent, trade, or sell my email lists to
anyone. We assure that your privacy is respected
and protected.

_______________________________________





 

 

FREE Subscription

Stay Current With the Latest Technology Developments Realted to XML. Signup for Our Newsletter and Receive New Articles Through Email.

Name:

Email:

Note : We never rent, trade, or sell our email lists to anyone. We assure that your privacy is respected and protected.

 

 

Add to My Yahoo!

Visit XML Training Material Guide Homepage

 

 

“Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.”

Copyright - © 2004 - 2019 - All Rights Reserved.