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

XSL

Subject: XSL
From: Jim Nelson <jnelson@xxxxxxxxxxx> (by way of Mulberry TechnologiesList Owner)
Date: Thu, 8 Mar 2001 15:40:35 -0500
books.xsl

I have listed below 2 different scenarios with the associated .xsl. I have listed the .xml once, since it is used in both cases.

Objective: Produce output that looks like this;
 Price	Location
						$3.99    	     USA
						$5.30	     CAN
						$4.55	     MEX
						$6.55	     CHN

In my first scenario I can produce : books2.xsl
						$3.99    	     USA
						$5.30	     CAN
						$4.55	     MEX
						$6.55	     CHN

...which you will notice does not have the header information. I tried to
insert some <xsl:text> tag's to show the header "Price  Location" and IE 5.5
gives me an error, indicating tags are in wrong location, which they are
not.

Scenario 1 header:  Books.xsl -  <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">  (which I understand is
the correct way)

Scenario 2 header: Books2.xsl -  <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/TR/WD-xsl">  (which is the old way from Micro
Soft)

In short, both the .xsl files are exactly the same, except for the  header
information. The old way ( Books2.xsl) produces better results, but I cannot
use <xsl:text> and I assume it is because of the old header information.
When I use the new header information I get a lot of other data, unexpected.


I hope I have given enough surrounding information. Now here are the code and .xml files. Thanks for your assistance.

BOOKS.XSL
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<html>
<xsl:apply-templates/>
</html>
</xsl:template>

<xsl:template match="books">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="book[author='Rodney Goldberg']">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="price">
<p>
<xsl:value-of select="."/>
<xsl:value-of select="@loc"/>
</p>
</xsl:template>

</xsl:stylesheet>


BOOKS2.XSL <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/TR/WD-xsl">

<xsl:template match="/">
<html>
<xsl:apply-templates/>
</html>
</xsl:template>

<xsl:template match="books">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="book[author='Rodney Goldberg']">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="price">
<p>
<xsl:value-of select="."/>
<xsl:value-of select="@loc"/>
</p>
</xsl:template>

</xsl:stylesheet>


BOOKS.XML <?xml:stylesheet type="text/xsl" href="books.xsl"?> <books> <book> <author>Joe Schmoe</author> <title>Winning XML</title> <price loc="USA">3.95</price> </book> <book> <ident> <isbn>333-333-2222</isbn> <libnum>RE122-33333-89</libnum> <stocknum>F222999900222</stocknum> </ident> <author>Ann Landers</author> <author>Debbie Doolittle</author> <title>Rules of Etiquette</title> <title>How to go through life without making an ass of yourself</title> <price loc="USA">8.99</price> <price loc="CAN">10.99</price> <price loc="MEX">9.99</price>

	</book>
	<book>
		<ident>
			<isbn>4-3333-11-11001-1</isbn>
			<libnum>XB222-00-3388</libnum>
			<stocknum>D4477889038383</stocknum>
		</ident>
		<author>Max Attacx</author>
		<title>Felix LaFlur</title>
		<price>14.80</price>
	</book>
	<book>
		<ident>
			<isbn>88-222-00-5</isbn>
			<libnum>VWQ122-33333-89</libnum>
			<stocknum>B22299007322</stocknum>
		</ident>
		<author>Rodney Goldberg</author>
		<title>Mental Tennis</title>
		<title>How to play championship tennis</title>
		<price loc="USA">3.99</price>
		<price loc="CAN">5.30</price>
		<price loc="MEX">4.55</price>
		<price loc="CHN">6.55</price>
	</book>
</books>


James Nelson Director Consulting Services Contivo, Inc.

Voice:  650-426-4156
Cell:     916-806-0272
Email: jnelson@xxxxxxxxxxx

XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • XSL
    • Jim Nelson - Thu, 8 Mar 2001 16:58:42 -0500 (EST) <=

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.