Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
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 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 May 27th, 2004, 11:02 AM
Authorized User
 
Join Date: Jun 2003
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
Code:
<xsl:template match="/">
  <xsl:text disable-output-escaping="yes">
    <div id="topBar">
    </div>
    <xsl:apply-templates />
  </xsl:template>
   When I run the transformation in my code I instead of getting
Code:
<div id="topBar">
Code:
</div>
I get
Code:
<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.

Cheers,

Blaise
 
Old May 28th, 2004, 04:25 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 109
Thanks: 18
Thanked 0 Times in 0 Posts
Default

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
 
Old June 2nd, 2004, 07:56 AM
Authorized User
 
Join Date: Nov 2003
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
Default

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:

<div>text</div>

You need not worry about it.

thanks





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





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