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 October 19th, 2004, 04:04 AM
Registered User
 
Join Date: Oct 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Thebravehearth
Default newbie ask u

hi all...
i have file XML like this


  <?xml version="1.0" ?>
- <root>
  <report nama_field="cash" isi_field="12345" />
  <report nama_field="bond" isi_field="45678" />
  <report nama_field="loans" isi_field="654321" />
  <report nama_field="otherAsset" isi_field="654987" />
  <report nama_field="Trading" isi_field="963822" />
  <report nama_field="placement" isi_field="741852" />
  <report nama_field="sbi" isi_field="741258" />
  </root>


and i want format that file with XSL, this is the xsl file.


<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match= '*'>
        <xsl:apply-template />
    </xsl:template>
    <xsl:template match= 'report'>
        <tr>
        <td><xsl:value-of select = '@nama_field'/> </td>
        <td><xsl:value-of select = '@isi_field'/> </td>
        </tr>
    </xsl:template>
    <xsl:template match= '/'>
    <html>
    <head>
    </head>
    <body>
    <table>
    <tr><th colspan='2'>Asset Gue</th></tr>
    <tr><th> name assets</th><th>volume</th></tr>
    <xsl:apply-template select = 'root'/>
    </table>
    </body>
    </html>
    </xsl:template>
</xsl:stylesheet>


so why i get error message

Error during XSLT transformation: XSLT transformation failed.

well... i realy happy with ur command and response.

thx


~TAT TWAM ASI~
 
Old October 19th, 2004, 04:50 AM
Registered User
 
Join Date: Oct 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Thebravehearth
Default

well... i have a new idea .. i create this XSL..

<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" lang="en">
<head>
<title>Assets Gue</title>
<link rel="stylesheet" type="text/css" href="ows.css"></link>
</head>
<body>
<table class="tabFieldACTIVE" border="1">
<tbody>
    <tr><th colspan='2'>Assets Gue</th></tr>
    <tr><th>nama assets</th><th>volume</th></tr>
         <xsl:for-each select="root/report">
            <tr>
                <td><xsl:value-of select="@nama_field"/></td>
                <td><xsl:value-of select="@isi_field"/></td>
            </tr>
        </xsl:for-each>
</tbody>
</table>
</body>
</html>


and this work !? what do you things ?

so .... i need ur advice or respone...

thx


~TAT TWAM ASI~
 
Old October 19th, 2004, 04:57 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

its "xsl:apply-templates" NOT xsl:apply-template
 
Old October 19th, 2004, 05:28 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

There is no instruction

<xsl:apply-template />

it is spelt

<xsl:apply-templates />

But if you aren't seing a proper error message for this, then you haven't got your environment set up correctly. Perhaps you are just trying to run transformations in the browser? That's about the worst possible debugging environment there is, though even there, if you set the right options you can get better error messages than this.

Michael Kay


Michael Kay
http://www.saxonica.com/
 
Old October 19th, 2004, 06:20 AM
Registered User
 
Join Date: Oct 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Thebravehearth
Default

thx pal...

u r right, now i didnt get any error msg...
but the value of select didn't raise, just the tag HTML can loaded...


well .. i just try transformation ..

btw have u know how to make CHART with XML data in the Browser... ??


thx anyway





~TAT TWAM ASI~





Similar Threads
Thread Thread Starter Forum Replies Last Post
Please help the newbie!! shelly.aix Visual Basic 2008 Essentials 2 December 16th, 2008 07:35 AM
Newbie help... mkruger XSLT 7 October 24th, 2007 02:33 AM
Newbie here jmac731976 HTML Code Clinic 13 August 29th, 2007 03:54 PM
Newbie please help indyanguy XSLT 1 September 2nd, 2005 09:18 AM
Newbie Help! TheShadow Javascript 1 March 21st, 2005 03:42 AM





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