|
Totel:15 Click:
1 2 3
xslt Interview Questions And Answers
Page 1
Questions 1 what is the XSLT?
Answer XSLT stands for Extensible Stylesheet Language Transformations(XSLT).This is developed by World Wide Web Consortium(W3C).This is written in XML.We use XSLT when we want to transform an XML document into the oter XML document.Generally we use XSLT when we want to make transformtion from a XML document into another XML document,Convert a XML document into the HTML or XHTML document, creating dynamic web pages, can convert an XML document into PDF document.
We saved the XSLT file by using .xsl or .xslt extension.Recent version of XSLT is XSLT2.0 launched at 23rd Jan 2007.It is a part of XSL.Editor od first version of XSLT are James Clark.
Questions 2 how we compare XSLT and XPath??
Answer Some comparision b/w XSLT and XPath and given below:
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.
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.
Questions 3 How we compare XSLT and XQuery?
Questions 4 How to transform an XML document into another XML document?
Answer 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="Abhi">Abhi</name>
<name username="Sudi">Sudi</name>
</root>
Questions 5 How to transform an XML into XHTML?
Answer Below, I write an example which show you how ransform 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>
Goto Page:
1 2 3
xslt Objective Questions And Answers
xslt Objective Questions And Answers
xslt Interview Questions And Answers
xslt Interview Questions And Answers
xslt Interview Questions And Answers
xslt Subjective Questions And Answers
R4R,xslt Objective, xslt Subjective, xslt Interview Questions And Answers,xslt,xslt Interview,xslt Questions ,xslt Answers
|