Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | 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 Search this Thread Display Modes
  #1 (permalink)  
Old August 10th, 2006, 02:24 PM
Registered User
 
Join Date: Aug 2006
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can I emit a tag using an incoming parameter?

If I pass in an xsl:param called "rowname" (for example, rowname="FOO") can I emit a tag <FOO>...</FOO>?

I know I must be missing something -- every aettempt to use naked < > characters barfs my editor, and any attempt to either wrap them in CDATA or xsl:text or else just use &lt; &gt; results in getting &lt;FOO&gt; foo in my output, which is not what I want.

Thanks!


Reply With Quote
  #2 (permalink)  
Old August 11th, 2006, 01:40 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Take a look at the xsl:element documentation:
Code:
<xsl:element name="{$rowname}"></xsl:element>
--

Joe (Microsoft MVP - XML)
Reply With Quote
  #3 (permalink)  
Old August 13th, 2006, 06:18 PM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Reading Joe's answer, I now understand your question. I'm afraid it had me completely baffled before, and the reason I was confused was the same as the reason you were confused - by talking about "tags" you had me thinking at the level of raw unparsed XML, whereas actually what you want to emit is an element node in the result tree. It's really important to get this straight. Incidentally, the construct <FOO>...</FOO> uses two tags to represent one element - a start tag and an end tag.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote
  #4 (permalink)  
Old August 14th, 2006, 09:03 AM
Registered User
 
Join Date: Aug 2006
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry Michael (and thanks, Joe!). I've hovered around XSL at my previous job, knowing the basics enough to put together a stylesheet but leaving the tricker bits to our resident pro. I've recently changed jobs and I'm it, so I'm having to learn all these things for myself. My apologies for not fully grokking the terminology yet. (As a programmer I tend to think in terms of the raw character stream, hence 'tag'. I was just trying to blast out the equivalent of angle bracket text angle bracket.).

D


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Unable to emit assembly garwood BOOK: ASP.NET Website Programming Problem-Design-Solution 1 June 26th, 2006 11:02 PM
Howtouse QueryString parameter in a <sql:query>tag chauhan_vin JSP Basics 0 May 3rd, 2005 01:01 AM
Incoming Email handling BaNSHee SQL Server ASP 0 April 6th, 2005 05:00 AM
Reflection, Emit, DescriptionAttribute JoeXOfDotNet VS.NET 2002/2003 0 November 5th, 2003 02:43 AM
How to Keep track of all incoming Documents reddynet Biztalk 0 July 17th, 2003 04:58 AM



All times are GMT -4. The time now is 05:31 AM.


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