[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xhtml via xslt failure

Subject: Re: xhtml via xslt failure
From: e-letter <inpost@xxxxxxxxx>
Date: Mon, 16 Dec 2013 20:38:24 +0000
 Re: xhtml via xslt failure
On 15/12/2013, e-letter <inpost@xxxxxxxxx> wrote:
>
>     An xml stylesheet was created:
>

This was edited to:

<!--
<xsl:template match="/bookstore">
	<html lang="en" xml:lang="en">
		<head>
			<meta name="note" content="xhtml document created by xml transformation" />
			<title>Test output web page</title>
		</head>
		<body>
			<xsl:apply-templates select="book/author"/>
		</body>
	</html>
</xsl:template>
<xsl:template match="author">
	<p><xsl:value-of select="./text()"/></p>
</xsl:template>-->
<xsl:stylesheet
	version="2.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	>
	<xsl:import href="xqueryexampledata.xml"/>
	<xsl:output
		method="xml"
		doctype-public="-//W3C//DTD XHTML Basic 1.1//EN"
		doctype-system="http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd"
		encoding="utf-8"
		indent="no"
		omit-xml-declaration="yes"
		media-type="text/xml"
		standalone="yes"
		version="1.1"
		/>
	<xsl:template
		match='/'
		>
		<html xmlns='http://www.w3.org/1999/xhtml' lang='en' xml:lang='en'>
			<head>
				<meta
					name='notice' content='xhtml document created by xml transformation' />
				<title>Test output web page</title>
			</head>
			<body>
				<xsl:apply-templates
					select='/*'
					/>
			</body>
		</html>
	</xsl:template>
	<xsl:template
		match="/bookstore/book"
		>
			<p xmlns='http://www.w3.org/1999/xhtml'>
				<xsl:apply-templates
					select='./author'
					/>
				<!--<xsl:value-of select="./author"/>-->
			</p>
	</xsl:template>
</xsl:stylesheet>

The resultant xhtml file:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN"
"http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en"><head><meta content="xhtml document created by xml
transformation" name="notice" /><title>Test output web
page</title></head><body>
	<p>Giada De Laurentiis</p>
	<p>J K. Rowling</p>
	<p>James McGovernPer BothnerKurt CagleJames LinnVaidyanathan Nagarajan</p>
	<p>Erik T. Ray</p>
</body></html>

According to the specification the above transformation can be
achieved using either element 'apply-templates' or element 'value-of'.

Why is it that when the element 'value-of' in the stylesheet above is
substituted for the element 'apply-templates', the result is a
truncation of the third line in the xhtml file, i.e. to:

...
<p>James McGovern</p>
...

Also, it it possible to add whitespace  and punctuation to the xhtml output, eg.

...
<p>James McGovern, Per Bothner, Kurt Cagle, James Linn, Vaidyanathan
Nagarajan</p>
...

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.