Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 10th, 2008, 08:24 AM
Friend of Wrox
 
Join Date: Jan 2007
Location: durban, Africa, South Africa.
Posts: 115
Thanks: 2
Thanked 0 Times in 0 Posts
Default .Net2 xslt does not like the &lt; "<" - &gt; ">"

Hi, I need help please.

Update system to to new version & moved on to .Net2
But now my code that worked in my .Net1 xslt does not work.

.Net1 fine:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:asp="remove" xmlns:igchart="remove" xmlns:igsch="remove">
&lt;td class='rowDet' id="td_<xsl:value-of select='@name' />"&gt;
.Net2 don't work:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:asp="remove" xmlns:igchart="remove" xmlns:igsch="remove" xmlns:igtxt="remove">
&lt;td class='rowDet' id="td_<xsl:value-of select='@name' />"&gt;

I had to change it back to: <td class='rowDet'>

Is there a new code for the "<" ">"?

Please Assist!

Regards




Reply With Quote
  #2 (permalink)  
Old October 10th, 2008, 08:39 AM
Friend of Wrox
Points: 6,540, Level: 34
Points: 6,540, Level: 34 Points: 6,540, Level: 34 Points: 6,540, Level: 34
Activity: 20%
Activity: 20% Activity: 20% Activity: 20%
 
Join Date: Nov 2007
Location: Germany
Posts: 1,222
Thanks: 0
Thanked 238 Times in 237 Posts
Default

What exactly do you want to achieve?
It is not clear where exactly you have those entity references like &lt; and why you think you need them.
It is also not clear what error message exactly you get. Please tell us exactly what you have tried and which error message exactly you get.

--
  Martin Honnen
  Microsoft MVP - XML
Reply With Quote
  #3 (permalink)  
Old October 10th, 2008, 08:40 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,133
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Creating elements in the output XML (or tat least trying to) using &lt; and &gt; is generally a 'bad thing' due to the way different processor handle things.

Try doing this instead:

Code:
<td class="rowDet">
    <xsl:attribute name="id">td_<xsl:value-of select="@name"/></xsl:attribute>
</td>
/- Sam Judson : Wrox Technical Editor -/
Reply With Quote
  #4 (permalink)  
Old October 10th, 2008, 10:03 AM
mhkay's Avatar
Wrox Author
Points: 18,335, Level: 58
Points: 18,335, Level: 58 Points: 18,335, Level: 58 Points: 18,335, Level: 58
Activity: 40%
Activity: 40% Activity: 40% Activity: 40%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,940
Thanks: 0
Thanked 286 Times in 281 Posts
Default

Neither text nodes (&lt;) nor instructions like xsl:value-of are allowed as direct children of xsl:stylesheet, so neither of these should work. But perhaps you left out some levels of structure. But I would need to see those levels to see whether your your code is valid XSLT or not.

Whether valid or not, it's not good coding style. You want to be using attribute value templates:

<td class="rowdet" id="td_{@name}">

Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference
Reply With Quote
  #5 (permalink)  
Old October 11th, 2008, 04:40 AM
Friend of Wrox
 
Join Date: Jan 2007
Location: durban, Africa, South Africa.
Posts: 115
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Hi All, Thank You very much.

I don't know xml at all, all I did to the xslt file before the upgrade was to††edit/add some code.
I needed to get the id††of the description so that on mouseover my object i want to change the background color of the TD.
This worked:<xsl:when test="Attributes[ @name='visible'] != 'False'">
        <td width='15%' align='right' class='rowDet'> <xsl:attribute name="id">td_<xsl:value-of select='@name' /></xsl:attribute>

Thank You all for your kindness & knowledge!

Regards
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 8: <asp:image> inside <a> & ext.CSS (pg. 274) epc BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 July 12th, 2008 04:37 AM
Need "&" and "<!-- -->" in the output sunrain XSLT 2 January 19th, 2007 04:29 PM
<style> tags in a <body> vs. <div> bcat BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 March 27th, 2005 07:50 AM
<marquee><b>About CHAT App. in PHP4</b></marquee> Ramkrishna PHP How-To 1 September 11th, 2004 07:01 AM
XML from a DB recordset (removal of &lt;&gt;) Thodoris XML 3 July 13th, 2004 12:28 AM



All times are GMT -4. The time now is 08:12 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.