Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 6th, 2011, 05:44 AM
Registered User
 
Join Date: Jul 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to get the output in xslt in following case?

We have a xml as:
-----------------
<?xml version="1.0" encoding="US-ASCII"?>
<?xml-stylesheet type="text/xsl" href="ex2.xsl"?>
<article article-type="in-brief">
<sec>
<title>Differences in Admitting Hospital Characteristics for Black and White Medicare Beneficiaries With Acute Myocardial Infarction</title>
<p>Recent research has identified differential access to high-quality hospital care as an important, perhaps primary, factor associated with racial disparities in the treatment of acute myocardial infarction. See p <related-article related-article-type="in-this-issue" vol="123" page="2710" ext-link-type="pmc" id="zhc2710">2710</related-article>.</p>
</sec>
<sec>
<title>Relationship Between Supranormal Oxygen Tension and Outcome After Resuscitation From Cardiac Arrest</title>
<p>Historically, the administration of supplemental oxygen has been considered a cornerstone of cardiopulmonary resuscitation for victims of cardiac arrest. See p <related-article related-article-type="in-this-issue" vol="123" page="2717" ext-link-type="pmc" id="zhc2717">2717</related-article>.</p>
</sec></body>
</article>


xslt to display the data:
----------------------
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" version="4.0"/>
<xsl:template match="/">
<html>
<body onload="displayResult()">
<h2>My Article</h2>
<xsl:for-each select="article[@*]/body/sec">
<div class="chap-title"><xsl:value-of select="title"/></div>
<p><xsl:value-of select="p"/></p>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

---------------------------------------------
In case <sec> tag is replaced with <ce:section>, what changes should be made in the above xslt





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to produce this output in XSLT 1.0 UndeadHalfOrc XSLT 1 December 9th, 2010 04:34 AM
XSLT to get hyperlinks in output ashv XSLT 2 December 7th, 2008 06:14 AM
xsl:output with encoding and UPPER case entity ROCXY XSLT 1 April 19th, 2007 08:20 AM
XSLT output with tags trinkets XSLT 22 November 14th, 2006 11:22 AM
XSLT Looks right, but no output Alderian72 XSLT 1 June 9th, 2005 08:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.