1. The reason is that CSS is much easier to use and learn, which makes it easier to maintain. CSS does have some
limitation which is why its sensible to use CSS when you can but use XSL when you need it.
2.They both work and are legitament syntax, so therefore it doesnt matter which one you chose.
Longer Question
1. The following is used to display pieces of data from the xml document:
//policies/policy/policyholder/
/policies/policy/@type
/policies/policy/claims/claim/year
/policies/policy/claims/claimdetail
Below are the more simple ways of doing it:
//policy-holder
//@type
//year
//details
Lecture Reflection-WEEK 17 – Function Elements of XSL
This is an extension of the past week where insights to the functional elements of XSL were looked at.
Here is a list of the functional elements of XSL that was discussed in class during week 17: -
1 <xsl:value-of> element can be used to extract the value of an XML element and add it to the output stream of the transformation.
2 <xsl:for-each> element can be used to select every XML element of a specified node-set.
3 <xsl:sort> element is used to sort the output.
4 <xsl:if> element is used to put a conditional test against the content of the XML file.
5 <xsl:choose> element is used in conjunction with <xsl:when> and <xsl:otherwise> to express multiple conditional tests.
The following code snippet example is from my coursework for this module which required XSL: -
<xsl:choose>
<xsl:when test="@malady = 'chest affections'">
<td bgcolor="#ff00ff">
<xsl:value-of select="@malady"/></td>
<xsl:otherwise>
<td>"no catagory"</td>
www.ronnysmarket.com
www.ronnysmarket.com/catalog/main
http://www.ronnysmarket.com
http://www.ronnysmarket.com/catalog/main
No comments:
Post a Comment