473,327 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Trying to output an xml file with xsl

I'm having trouble producing an xml output from another xml file using
xsl. The proper values are output to the browser as text with no
formating or xml tags (<rowset> and <row>).

Any ideas?
(The xml source is available below)

Here is my xsl:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="ProductInfo">
<rowset>
<xsl:for-each select="Details">
<row>
<ProductName>
<xsl:value-of select="ProductName"/>
</ProductName>
<Asin>
<xsl:value-of select="Asin"/>
</Asin>
<Catalog>
<xsl:value-of select="Catalog"/>
</Catalog>
<ReleaseDate>
<xsl:value-of select="ReleaseDate"/>
</ReleaseDate>
<ImageUrlSmall>
<xsl:value-of select="ImageUrlSmall"/>
</ImageUrlSmall>
<ListPrice>
<xsl:value-of select="ListPrice"/>
</ListPrice>
</row>
</xsl:for-each>
</rowset>
</xsl:template>
</xsl:stylesheet>
(Here is my source xml)

<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="amazon.xsl"?>
<ProductInfo>
<Details
url="http://www.amazon.com/exec/obidos/ASIN/0380977427/webservices-20?dev-t=D3EE7PA4A5L11O%26camp=2025%26link_code=xm2">
<Asin>0380977427</Asin>
<ProductName>Quicksilver (The Baroque Cycle, Vol. 1)</ProductName>
<Catalog>Book</Catalog>
<Authors>
<Author>Neal Stephenson</Author>
</Authors>
<ReleaseDate>23 September, 2003</ReleaseDate>
<Manufacturer>William Morrow</Manufacturer>

<ImageUrlSmall>http://images.amazon.com/images/P/0380977427.01.THUMBZZZ.jpg</ImageUrlSmall>

<ImageUrlMedium>http://images.amazon.com/images/P/0380977427.01.MZZZZZZZ.jpg</ImageUrlMedium>

<ImageUrlLarge>http://images.amazon.com/images/P/0380977427.01.LZZZZZZZ.jpg</ImageUrlLarge>
<Availability>Usually ships within 24 hours</Availability>
<ListPrice>$27.95</ListPrice>
<OurPrice>$19.01</OurPrice>
<UsedPrice>$16.92</UsedPrice>
</Details>
<Details
url="http://www.amazon.com/exec/obidos/ASIN/0060523875/webservices-20?dev-t=D3EE7PA4A5L11O%26camp=2025%26link_code=xm2">
<Asin>0060523875</Asin>
<ProductName>The System of the World : Volume Three of The
Baroque Cycle</ProductName>
<Catalog>Book</Catalog>
<Authors>
<Author>Neal Stephenson</Author>
</Authors>
<ReleaseDate>21 September, 2004</ReleaseDate>
<Manufacturer>William Morrow</Manufacturer>

<ImageUrlSmall>http://images.amazon.com/images/P/0060523875.01.THUMBZZZ.jpg</ImageUrlSmall>

<ImageUrlMedium>http://images.amazon.com/images/P/0060523875.01.MZZZZZZZ.jpg</ImageUrlMedium>

<ImageUrlLarge>http://images.amazon.com/images/P/0060523875.01.LZZZZZZZ.jpg</ImageUrlLarge>
<Availability>Not yet published</Availability>
<ListPrice>$27.95</ListPrice>
<OurPrice>$19.56</OurPrice>
</Details>
<Details
url="http://www.amazon.com/exec/obidos/ASIN/0553380958/webservices-20?dev-t=D3EE7PA4A5L11O%26camp=2025%26link_code=xm2">
<Asin>0553380958</Asin>
<ProductName>Snow Crash</ProductName>
<Catalog>Book</Catalog>
<Authors>
<Author>NEAL STEPHENSON</Author>
</Authors>
<ReleaseDate>02 May, 2000</ReleaseDate>
<Manufacturer>Bantam </Manufacturer>

<ImageUrlSmall>http://images.amazon.com/images/P/0553380958.01.THUMBZZZ.jpg</ImageUrlSmall>

<ImageUrlMedium>http://images.amazon.com/images/P/0553380958.01.MZZZZZZZ.jpg</ImageUrlMedium>

<ImageUrlLarge>http://images.amazon.com/images/P/0553380958.01.LZZZZZZZ.jpg</ImageUrlLarge>
<Availability>Usually ships within 24 hours</Availability>
<ListPrice>$14.00</ListPrice>
<OurPrice>$11.20</OurPrice>
<UsedPrice>$4.99</UsedPrice>
</Details>
<Details
url="http://www.amazon.com/exec/obidos/ASIN/0060512806/webservices-20?dev-t=D3EE7PA4A5L11O%26camp=2025%26link_code=xm2">
<Asin>0060512806</Asin>
<ProductName>Cryptonomicon</ProductName>
<Catalog>Book</Catalog>
<Authors>
<Author>Neal Stephenson</Author>
</Authors>
<ReleaseDate>05 November, 2002</ReleaseDate>
<Manufacturer>Avon</Manufacturer>

<ImageUrlSmall>http://images.amazon.com/images/P/0060512806.01.THUMBZZZ.jpg</ImageUrlSmall>

<ImageUrlMedium>http://images.amazon.com/images/P/0060512806.01.MZZZZZZZ.jpg</ImageUrlMedium>

<ImageUrlLarge>http://images.amazon.com/images/P/0060512806.01.LZZZZZZZ.jpg</ImageUrlLarge>
<Availability>Usually ships within 24 hours</Availability>
<ListPrice>$7.99</ListPrice>
<OurPrice>$7.99</OurPrice>
<UsedPrice>$3.95</UsedPrice>
</Details>
<Details
url="http://www.amazon.com/exec/obidos/ASIN/0060599340/webservices-20?dev-t=D3EE7PA4A5L11O%26camp=2025%26link_code=xm2">
<Asin>0060599340</Asin>
<ProductName>The Confusion LTD</ProductName>
<Catalog>Book</Catalog>
<Authors>
<Author>Neal Stephenson</Author>
</Authors>
<ReleaseDate>01 October, 2004</ReleaseDate>
<Manufacturer>William Morrow</Manufacturer>

<ImageUrlSmall>http://images.amazon.com/images/P/0060599340.01.THUMBZZZ.jpg</ImageUrlSmall>

<ImageUrlMedium>http://images.amazon.com/images/P/0060599340.01.MZZZZZZZ.jpg</ImageUrlMedium>

<ImageUrlLarge>http://images.amazon.com/images/P/0060599340.01.LZZZZZZZ.jpg</ImageUrlLarge>
<Availability>Not yet released.</Availability>
<ListPrice>$200.00</ListPrice>
<OurPrice>$136.00</OurPrice>
</Details>
<Details
url="http://www.amazon.com/exec/obidos/ASIN/0553380966/webservices-20?dev-t=D3EE7PA4A5L11O%26camp=2025%26link_code=xm2">
<Asin>0553380966</Asin>
<ProductName>The Diamond Age : Or, a Young Lady's Illustrated
Primer</ProductName>
<Catalog>Book</Catalog>
<Authors>
<Author>Neal Stephenson</Author>
</Authors>
<ReleaseDate>02 May, 2000</ReleaseDate>
<Manufacturer>Bantam </Manufacturer>

<ImageUrlSmall>http://images.amazon.com/images/P/0553380966.01.THUMBZZZ.jpg</ImageUrlSmall>

<ImageUrlMedium>http://images.amazon.com/images/P/0553380966.01.MZZZZZZZ.jpg</ImageUrlMedium>

<ImageUrlLarge>http://images.amazon.com/images/P/0553380966.01.LZZZZZZZ.jpg</ImageUrlLarge>
<Availability>Usually ships within 24 hours</Availability>
<ListPrice>$13.95</ListPrice>
<OurPrice>$11.16</OurPrice>
<UsedPrice>$6.45</UsedPrice>
</Details>
<Details
url="http://www.amazon.com/exec/obidos/ASIN/0380815931/webservices-20?dev-t=D3EE7PA4A5L11O%26camp=2025%26link_code=xm2">
<Asin>0380815931</Asin>
<ProductName>In the Beginning...was the Command Line</ProductName>
<Catalog>Book</Catalog>
<Authors>
<Author>Neal Stephenson</Author>
</Authors>
<ReleaseDate>09 November, 1999</ReleaseDate>
<Manufacturer>Avon</Manufacturer>

<ImageUrlSmall>http://images.amazon.com/images/P/0380815931.01.THUMBZZZ.jpg</ImageUrlSmall>

<ImageUrlMedium>http://images.amazon.com/images/P/0380815931.01.MZZZZZZZ.jpg</ImageUrlMedium>

<ImageUrlLarge>http://images.amazon.com/images/P/0380815931.01.LZZZZZZZ.jpg</ImageUrlLarge>
<Availability>Usually ships within 24 hours</Availability>
<ListPrice>$10.00</ListPrice>
<OurPrice>$8.00</OurPrice>
<UsedPrice>$3.50</UsedPrice>
</Details>
<Details
url="http://www.amazon.com/exec/obidos/ASIN/1576752402/webservices-20?dev-t=D3EE7PA4A5L11O%26camp=2025%26link_code=xm2">
<Asin>1576752402</Asin>
<ProductName>The Referral of a Lifetime: The Networking System
that Produces Bottom-Line Results . . . Every Day!</ProductName>
<Catalog>Book</Catalog>
<Authors>
<Author>Timothy L. Templeton</Author>
<Author>Lynda Rutledge Stephenson</Author>
<Author>Tim Templeton</Author>
<Author>Kenneth H. Blanchard</Author>
</Authors>
<ReleaseDate>May, 2003</ReleaseDate>
<Manufacturer>Berrett-Koehler Pub</Manufacturer>

<ImageUrlSmall>http://images.amazon.com/images/P/1576752402.01.THUMBZZZ.jpg</ImageUrlSmall>

<ImageUrlMedium>http://images.amazon.com/images/P/1576752402.01.MZZZZZZZ.jpg</ImageUrlMedium>

<ImageUrlLarge>http://images.amazon.com/images/P/1576752402.01.LZZZZZZZ.jpg</ImageUrlLarge>
<Availability>THIS TITLE IS CURRENTLY NOT AVAILABLE. If you would
like to purchase this title, we recommend that you occasionally check
this page to see if it has become available.</Availability>
<ListPrice>$19.95</ListPrice>
<OurPrice>$13.97</OurPrice>
<UsedPrice>$14.64</UsedPrice>
</Details>
<Details
url="http://www.amazon.com/exec/obidos/ASIN/0553573861/webservices-20?dev-t=D3EE7PA4A5L11O%26camp=2025%26link_code=xm2">
<Asin>0553573861</Asin>
<ProductName>Zodiac</ProductName>
<Catalog>Book</Catalog>
<Authors>
<Author>Neal Stephenson</Author>
</Authors>
<ReleaseDate>01 June, 1995</ReleaseDate>
<Manufacturer>Bantam </Manufacturer>

<ImageUrlSmall>http://images.amazon.com/images/P/0553573861.01.THUMBZZZ.jpg</ImageUrlSmall>

<ImageUrlMedium>http://images.amazon.com/images/P/0553573861.01.MZZZZZZZ.jpg</ImageUrlMedium>

<ImageUrlLarge>http://images.amazon.com/images/P/0553573861.01.LZZZZZZZ.jpg</ImageUrlLarge>
<Availability>Usually ships within 24 hours</Availability>
<ListPrice>$7.50</ListPrice>
<OurPrice>$7.50</OurPrice>
<UsedPrice>$3.95</UsedPrice>
</Details>
</ProductInfo>
Jul 20 '05 #1
2 1845
DonMiche wrote:
I'm having trouble producing an xml output from another xml file using
xsl. The proper values are output to the browser as text with no
formating or xml tags (<rowset> and <row>).


Well, what do you expect a browser to do, it is XML that you produce and
if you do not associate a CSS stylesheet with the XML the browser won't
do more than rendering the content of text nodes

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #2
DonMiche <m_*@bigfoot.com> wrote in message news:<Uj********************@weber.videotron.net>. ..
I'm having trouble producing an xml output from another xml file using
xsl. The proper values are output to the browser as text with no
formating or xml tags (<rowset> and <row>).


Works for me. However if you do this in a raw browser (I suspect
you're doing the transform client-side, using that
<?xml-stylesheet type="text/xsl" href="amazon.xsl"?>
at the top) then you're not generating any HTML. The browser will
ignore the tags it doesn't recognise and just give you the text
content -- which is what it is doing, and about all you can expect of
it.

What are you trying to do here ? Make HTML for a browser, or make XML
for something else that knows how to handle it ? (in which case, a
browser is the wrong diagnostic tool - try doing transforms on the
server)
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Lans | last post by:
I have a string that I need to tokenize but I need to use a string token see example i am trying the following but strtok only uses characters as delimiters and I need to seperate bu a certain...
0
by: Scotter | last post by:
Hi - I posted this message in the microsoft.public.inetserver.iis group, as well. I hope someone can help. My client is frantic. Platform: Windows 2003 Server Enterprise Edition, latest MDAC...
8
by: Rich Grise | last post by:
I think I've finally found a tutorial that can get me started: http://www.zib.de/Visual/people/mueller/Course/Tutorial/tutorial.html and I've been lurking for awhile as well. What happened is,...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
1
by: Will Parsons | last post by:
I am trying to get started with using Docbook/xml using free tools and am stymied in generating printable documentation from even the simplest source. I have attempted to generate a PDF using...
1
by: jonathan184 | last post by:
Hi I am trying to login a JMS admin tool and execute JMS commands and using perl windows to do this. This is the e.g of connection string they said to use when trying to connec to jms ****connect ...
3
by: Fantus | last post by:
Hello I am doing a small research and I found this: http://www.freedom-to-tinker.com/tinyp2p.html I tried to get it to work. So far I managed to run it as a server using a command:
3
by: Robert Dunlop | last post by:
I am using Microsoft Visual Studio 2005 for development of an ASP.NET site, and I have a problem that greatly effects my workflow at times. It seems that after I upload new files anywhere within...
5
by: sayeo87 | last post by:
Hi, I am quite new to JSP so please forgive me if I ask really simple things... I am trying to run system commands on the server and display the output on a webpage. This is what I've got: <%@...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.