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 April 7th, 2010, 02:07 PM
Authorized User
 
Join Date: Mar 2010
Posts: 28
Thanks: 3
Thanked 0 Times in 0 Posts
Default Replace xsl:eval

Respected sir,

Is there any other function or method to replace xsl:eval.
Because i got an error "Keyword xsl:eval may not be used in namespace http://www.w3.org/1999/XSL/Transform".

How to solve this error.

Please give me a suggestion.

Thanks,
Dhrumil
 
Old April 7th, 2010, 03:14 PM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

A quick google found this: http://www.stylusstudio.com/xmldev/2...post51290.html

Other than that you'd really have to say what you are trying to do for us to be able to help you.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
 
Old April 7th, 2010, 03:59 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I'm trying hard to remember what xsl:eval was, but WD-xsl was an awfully long time ago. I may be wrong, but I think it did something roughly similar to xsl:value-of.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old April 8th, 2010, 02:12 AM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 291
Thanks: 9
Thanked 29 Times in 29 Posts
Thumbs up

Please post your xml, xslt code and the required output. Someone here can help you.
__________________
Rummy
 
Old April 8th, 2010, 09:00 AM
Registered User
 
Join Date: Apr 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to dynamically generate xml data on browser using XSL

Quote:
Originally Posted by mrame View Post
Please post your xml, xslt code and the required output. Someone here can help you.
Hi every 1,
This is my XML file below:
<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-stylesheet type="text/xsl" href="EmpXSL.xsl"?>
<Employees>
<Employee id="001">
<First-Name>Vinay</First-Name>
<Last-Name>Kumar</Last-Name>
<Designation>Trainee</Designation>
<DOB>17/02/82</DOB>
<Team>Ovid</Team>
<BloodGrp>O+ve</BloodGrp>
<Address>Pune1</Address>
</Employee>
<Employee id="002">
<First-Name>Deepak</First-Name>
<Last-Name>Singh</Last-Name>
<Designation>Trainee</Designation>
<DOB>17/02/82</DOB>
<Team>Ovid</Team>
<BloodGrp>O+ve</BloodGrp>
<Address>Pune</Address>
</Employee>
</Employees>

and i have used code is:

<xsl:output method="html" indent="yes"/>

<xsl:template match="/*">
<table border="1">
<thead>
<tr>
<xsl:apply-templates select="*[1]" mode="th"/>
</tr>
</thead>
<tbody>
<xsl:apply-templates select="*"/>
</tbody>
</table>
</xsl:template>

<xsl:template match="/*/*/*" mode="th">
<th>
<xsl:value-of select="name()"/>
</th>
</xsl:template>

<xsl:template match="/*/*">
<tr>
<xsl:apply-templates select="*"/>
</tr>
</xsl:template>

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

</xsl:stylesheet>

I am getting output ok but the thing is how to get ID attribute to b place before First-Name.Both name n value using same code for xsl.
Also I need to understand how the flow is working.....
If any 1 may help me out...


Thanks n Regards.
 
Old April 8th, 2010, 09:11 AM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 291
Thanks: 9
Thanked 29 Times in 29 Posts
Thumbs up

Try the below:
Code:
<xsl:template match="/*">
<table border="1">
<thead>
<tr>
<th>id</th>
<xsl:apply-templates select="*[1]" mode="th"/>
</tr>
</thead>
<tbody>
<xsl:apply-templates select="*"/>
</tbody>
</table>
</xsl:template>
<xsl:template match="/*/*/*" mode="th">
<th>
<xsl:value-of select="name()"/> 
</th> 
</xsl:template>
<xsl:template match="/*/*">
<tr>
<td><xsl:value-of select="@id"/></td>
<xsl:apply-templates select="*"/>
</tr>
</xsl:template>
<xsl:template match="/*/*/*">
<td>
<xsl:value-of select="@* | text()"/>
</td>
</xsl:template>
If the above does not give the needed output, then please post the needed output.
__________________
Rummy





Similar Threads
Thread Thread Starter Forum Replies Last Post
xsl replace preoblems alapati.sasi XSLT 1 July 16th, 2007 05:53 AM
Name "Eval" is not declared. thuyvncr BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 December 21st, 2006 03:48 AM
XSL to replace text in XML file neetukk XSLT 1 November 29th, 2006 05:20 AM
EVAL becomes failed, with IIF and Replace Function AbrarNazeer ASP.NET 2.0 Professional 0 July 6th, 2006 06:53 AM
Eval??? tsimsha Classic ASP Basics 2 January 17th, 2005 10:02 PM





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