Academic Tutorials



English | French | Portugese | German | Italian
Google

Home Source Codes E-Books Downloads Contact Us About Us

XSLT Tutorial
XSLT Introduction
XSLT Browsers
XSLT Transform
XSLT Template
XSLT Value of
XSLT For Each
XSLT Sort
XSLT If
XSLT Choose
XSLT Apply
XSLT on Client
XSLT on Server
XSLT Edit XML
XSLT Editors
XSLT Summary

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
AJAX Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PHP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
.NET (dotnet)
Microsoft.Net
XML Web Services
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills


XSLT Value of

Next Next



XSLT <xsl:value-of> Element

The xsl:value-of element can be used to compute generated text,within a template. for example by inserting the value of a variable or by extracting text from the source tree. The xsl:value-of element does this with an Expression that is specified as the value of the select attribute. Expressions also be used inside attribute values of literal result elements by enclosing the expression in curly braces ({}).




Generating Text: xsl:value-of

< value-of
select= string-expression
disable-output-escaping= >
<-- Content: -->
< /value-of>


The xsl:value-of tag is instantiated to create a text node in the result tree. The select attribute is an Expression; this expression is evaluated and the resulting object is converted to a string as if by a call to the string function.The string specifies the string-value of the created text node.No text node will be created, if the string is empty. The created text node will be merged with any adjacent text nodes.

without converting it to a string the xsl:copy-of element can be used to copy a node-set over to the result tree.

The following example creates an HTML paragraph from a person element with given-name and family-name attributes.The paragraph will contain the value of family-name attribute of the current node and the given-name attribute of the current node followed by a space.


<xsl:template match="person">
<p>
<xsl:value-of select="@given-name"/>
<xsl:text> </xsl:text>
<xsl:value-of select="@family-name"/>
</p>
</xsl:template>


The following example creates an HTML paragraph from a person element with given-name and family-name children elements. The paragraph will contain the string-value of the first given-name child element of the current node followed by a space and the string-value of the first family-name child element of the current node.


<xsl:template match="person">
<p>
<xsl:value-of select="given-name"/>
<xsl:text> </xsl:text>
<xsl:value-of select="family-name"/>
</p>
</xsl:template>




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>
Book Collection
<table border="1">
<tr bgcolor="#9acd32">
<th>Book</th>
<th>Price</th>
</tr>
<tr>
<td><xsl:value-of select="catalog/store/Book"/></td>
<td><xsl:value-of select="catalog/store/price"/></td>
</tr>
</table>
</body>
</html>
</xsl:template></xsl:stylesheet>

Output

Book Collection
Book Price
XSLT 543

Notice that only one line of data was copied from the XML document to the output.




Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • del.icio.us
  • De.lirio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

Next Next

Keywords xslt-value-of, xsl value of, xslt for each, xslt value of, asp net xslt, xslt value of attribute, xsl value of select, xslt value of select, xpath value of, xsl value of attribute, asp net value.


HTML Quizes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
XML Quizes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizes
JavaScript Quiz
VBScript Quiz
AJAX Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizes
ASP Quiz
PHP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
.NET (dotnet) Quizes
Microsoft.Net Quiz
XML Web Services Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
Multimedia Quizes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Web Building  Quizes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Java Quizes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Programming Langauges Quizes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Soft Skills Quizes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz

Privacy Policy
Copyright © 2003-2008 Vyom Technosoft Pvt. Ltd., All Rights Reserved.