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 August 10th, 2006, 02:24 PM
Registered User
Join Date: Aug 2006
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.


Old August 11th, 2006, 01:40 AM
joefawcett's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts

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

Joe (Microsoft MVP - XML)
Old August 13th, 2006, 06:18 PM
mhkay's Avatar
Wrox Author
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts

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
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Old August 14th, 2006, 09:03 AM
Registered User
Join Date: Aug 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts

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.).


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

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