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

RE: xsl template for simple data-base to transform int

Subject: RE: xsl template for simple data-base to transform into htm l displayable table
From: Pieter Reint Siegers Kort <pieter.siegers@xxxxxxxxxxx>
Date: Thu, 2 Sep 2004 16:49:36 -0500
purchase order template
Hi Stephen,

First of all, your XML was not well-formed, it missed one '>' in the
document node. Guess it must have been a typo.

Then, you must mean a xsl stylesheet as a template I suppose? Then this
might help you:

<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xsl:output indent="yes"/>

<xsl:template match="/Purchase-Orders">
  <table border="1">
    <xsl:apply-templates select="Purchase-Order"/>
  </table>
</xsl:template>

<xsl:template match="Purchase-Order">
  <th>
    <xsl:value-of select="name" />
  </th>
  <tr>
     <xsl:apply-templates select="@*|node()"/>
  </tr>
</xsl:template>

<xsl:template match="@*|node()">
  <td>
    <xsl:value-of select="." />
  </td>
</xsl:template>

<xsl:template match="name"/>

</xsl:stylesheet> 

Cheers,
</prs>

-----Original Message-----
From: Bovy, Stephen J [mailto:STEPHEN.Bovy@xxxxxx] 
Sent: Thursday, September 02, 2004 4:19 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  xsl template for simple data-base to transform into html
displayable table 

I would like to find a simple xml template to convert something like this:

<Purchase-Orders 

<Purchase-Order>                             
  <name>Steve Bovy</name>                    
  <address>9301 Pali Ave</address>           
  <phone-number>818-352-9917</phone-number>  
  <part-number> 1234</part-number>           
  <quantity>-1</quantity>                    
  <price>-15.41</price>                      
  <total>-45.32</total>                      
</Purchase-Order>                            

<Purchase-Order>                             
  <name>John Doe</name>                      
  <address>Never Land</address>              
  <phone-number>818-999-9999</phone-number>  
  <part-number> 3241</part-number>           
  <quantity> 20</quantity>                   
  <price> 15.41</price>                      
  <total> 45.32</total>                      
</Purchase-Order>                            
                                             
</Purchase-Orders>                           


Into a Displayable HTML "table" 

Has anyone written somehting like this, or can point me to such a template
????

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.