Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XML
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML 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
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 27th, 2004, 11:02 AM
Authorized User
Join Date: Jun 2003
Location: London, , United Kingdom.
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSLT incorrectly closing my div tag

Hi there,

I've got a strange problem where when I perform a transformation on my XML to an XHTML document using an XSL file certain tags are closed incorrectly.

for example I've got this line in my XSL
<xsl:template match="/">
  <xsl:text disable-output-escaping="yes">
    <div id="topBar">
    <xsl:apply-templates />
   When I run the transformation in my code I instead of getting
<div id="topBar">
I get
<div id="topBar"/>
I've noticed that this also happens with textareas, has anyone else noticed this, and or found a work around?

Any advice or guidance would be much appreciated.


Reply With Quote
  #2 (permalink)  
Old May 28th, 2004, 04:25 PM
Friend of Wrox
Points: 470, Level: 7
Points: 470, Level: 7 Points: 470, Level: 7 Points: 470, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: May 2004
Location: Plano, TX, USA.
Posts: 109
Thanks: 18
Thanked 0 Times in 0 Posts

OK, I'm new top the forum.. So I'll ask..

Why do you need the <element attr="val"></element> form over the <element attr="val"/> form?

Maybe 'why' isn't important. The two forms are both correctly identifying the element in the node tree.

GnuPG Key fingerprint = 1AD4 726D E359 A31D 05BF&nbsp;&nbsp;ACE5 CA93 7AD5 D8E3 A876

Michael Hare
Reply With Quote
  #3 (permalink)  
Old June 2nd, 2004, 07:56 AM
Authorized User
Join Date: Nov 2003
Location: Hollywood, Fl, USA.
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sonicDace Send a message via MSN to sonicDace Send a message via Yahoo to sonicDace

Hey, Blaise

To answer your question, your tags aren't being closed incorrectly, the truth is:

<div></div> = <div />

<div /> is just a short way of putting it. As soon as you assigne text to it, it will become:


You need not worry about it.

Reply With Quote

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
avoid self closing tag in xml vinodcprm XSLT 2 July 29th, 2008 04:20 AM
how to loop through a div tag? Byock Classic ASP Basics 0 December 19th, 2006 02:52 AM
div tag as link Stagmo Dreamweaver (all versions) 0 April 14th, 2006 12:35 AM
DIV TAG marclena ASP.NET 1.0 and 1.1 Professional 2 May 24th, 2005 11:14 AM

All times are GMT -4. The time now is 03:43 PM.

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