Understand xml and XSLT through an exampleUnderstanding the basics of XML and XSLT is very easy if you get a good tutorial where you can work on it and learn it side by side. You have to work on it to understand how it works. Consider the following XML file, <?xml version="1.0" encoding="ISO-8859-1"?> The above file has data related to the stocks of the books available. The title and the author of the book is store in the elements <book> of the XML file. The elements <title> and <author> hold the text data of the title and the author. Now we have to create an XSL file that will format the data available in the XML file. It is better to use tools like XMLSpy to create an XSL file since you can learn it easily and see the transformation done on the same window. The XSL file created is something like, <?xml version="1.0" encoding="ISO-8859-1"?> Go through the XSL file and you would find that the XSL tags are used in between the html tags and you can understand how the data is formatted. A 'xsl:for-each' loop is used to loop through all the <book> tags and retrieve the values of <title> and <author>. For this purpose the 'xsl:value-of' tag is used. Lots of similar examples are available in the internet. You can use a good tutorial to understand the concepts and the tags used in XSL.
|
|
|||
|
||||
“Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.”
Copyright - © 2004 - 2019 - All Rights Reserved.