XSLT (XSL Transformations) Interview Questions and Answers

XSLT Questions and Answers:

1 :: How to use filtering function in XSLT?

We can filter the XNL output by using filter operators.Some Legal filter operators are given below:
1.=(equal to)
2.!=(not equal to)
3.<(less than)
4.>(greater than)
I have given you a example. In this I have uses '=' equal to filer operation.

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>Book Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Author</th
0/5 Rating (0 vote)
Is This Answer Correct?    0 Yes 0 No
Place Your Answer

2 :: How we compare XSLT and XPath?

Some comparison b/w XSLT and XPath and given below:<br>1.XSLT is depends upon W3C XPath language.Which is use to identify subset of source document tree. XPath is also used to provide the function range.<br>2.Both XSLT and XPath published at same time than we can say that XSLT2.0 trusts on XPath2.0 and XSLT1.0 trusts on XPath1.0.
0/5 Rating (0 vote)
Is This Answer Correct?    0 Yes 0 No
Place Your Answer

3 :: How to transform an XML document into another XML document?

Here,I given you a exampl which show you how to transform an XML document into another XML document.
Example:
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/persons">
<root> <xsl:apply-templates select="person"/> </root>
</xsl:template>
<xsl:template match="person">
<name username="{@username}">
<xsl:value-of select="name" />
</name>
</xsl:template>
</xsl:stylesheet>
We can tranform above XML document into another document like that,
<?xml version="1.0" encoding="UTF-8"?>
<root>
<name username="jhoh">jhon</name>
<name username="smith">smith</name>
</root>
0/5 Rating (0 vote)
Is This Answer Correct?    0 Yes 0 No
Place Your Answer

4 :: How to transform an XML into XHTML?

Below, I write an example which show you how transform an XML into XHTML.
Example:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml">
<xsl:output method="html"/>
<xsl:template match="/persons">
<html>
<head>
<title>Test an XML Example</title>
</head>
<body>
<h1>Persons</h1>
<ul>
<xsl:apply-templates select="person">
<xsl:sort select="family-name" />
</xsl:apply-templates>
</ul>
</body>
</html>
</xsl:template>
<xsl:template match="person">
<li>
<xsl:value-of select="family-name"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="name"/>
</li>
</xsl:template>
</xsl:stylesheet>
To get output on the XHTML we write like that,

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head> <title>Test an XML Example</title> </head>
<body>
<h1>Persons</h1>
<ul>
<li>gupta, Abhi</li>
<li>jain, sudi</li>
</ul>
</body>
</html>
0/5 Rating (0 vote)
Is This Answer Correct?    1 Yes 0 No
Place Your Answer

5 :: How you define template in XSLT?

When XSL style sheet has one or more set of rules are told as templates.
We used <xsl:template> element to create templates.
We can attach a template with an XML document by using match attribute.The match attribute value is an XPath exprssion.Like: match="/" use to define whole document.
Example:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2> Book Collection </h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Author</th>
</tr>
<tr>
<td>.</td>
<td>.</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
0/5 Rating (0 vote)
Is This Answer Correct?    0 Yes 0 No
Place Your Answer

Rate This Category:
0/5 Rating (0 vote)
Place Your Question



Top: XSLT (XSL Transformations) Interview Questions and Answers
XSLT (XSL Transformations) Interview Questions and Answers

Top Frequently Asked XSLT Question
Frequently Asked XSLT Job Interview Question


Top Frequently opened Computer Programming Job Interview categories
Most popular Computer Programming Job Interview categories

Comments About XSLT (XSL Transformations) Interview Questions and Answers

Share your valuable opinions, ideas and suggestions about XSLT (XSL Transformations) Interview Questions and Answers
While placing your comment your email address is required but won't be published any where else; Personal information will be kept confidential; we do not sell or release our respective visitors private information.
  1. Webmaster 23rd of May 2012

    Webmaster Said

    Tell us what you feel about XSLT (XSL Transformations) Interview Questions and Answers
    All comments will be published after review. No login or registration is required to post a comment on XSLT (XSL Transformations) Interview Questions and Answers We offer and invite you to submit your valuable comment now; Please be respectful of others when commenting. Insulting others, self-promotional comments, website promotional comments, marketing stuff, SEO Techniques, SMS-style content and off-topic comments will not be approved at this information portal.
    So start sharing your thoughts regarding XSLT (XSL Transformations) Interview Questions and Answers
    Thank you.

Leave a Comment

Leave a Comment
  1.  Enter This Verification Code  Regenerate Verification Code  



Your reply will be added to the comment above (Below any other replies to this comment) -

Top Comments About: XSLT (XSL Transformations) Interview Questions and Answers
Comments on XSLT (XSL Transformations) Interview Questions and Answers

 
Top of Link batk to XSLT (XSL Transformations) Interview Questions and Answers
Link batk to XSLT (XSL Transformations) Interview Questions and Answers