Understanding stylesheets and XMLWhen we say style sheets for the xml file we are mentioning about the xsl files. The xsl files have data that are used for formatting the xml data and display them in other forms like html along with the styles. XSL is for XML and CSS is for the HTML. You can include a style sheet file in the xml file itself. If you do this, the xml file will be displayed with the styles incorporated in it. If you want to include an xsl file in the xml file, then you can use the following syntax, <?xml-stylesheet type="text/xsl" href="xsl_file.xsl"?> The above code will include the xsl file for that xml and the data will be displayed according to the formatting instructions given in the xsl_file.xsl. A style sheet file will have the root tag as <xsl:stylesheet> or <xsl:transform>. This tag will include the namespace of the XSLT. The version number is also included as an attribute. Hence the root element in the xsl file will look like, <xsl:stylesheet version="1.0" By using the different elements of the xsl file like, xsl:template, xsl:for-each, and xsl:value-of, you can navigate through the elements and format the ways in which they have to be displayed.
|
|
||
|
|||
“Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.”
Copyright - © 2004 - 2019 - All Rights Reserved.