473,698 Members | 2,942 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Xalan 2.7.0 output method="html" - empty HTML tags

Xh
Hi All,

I have problems with generating valid HTML output

there are few HTML elements that i don't what to output as <tagname/>
but as <tagname></tagnamebut Xalan keeps generating them as
<tagname/>

there are few really annoying situations where adding   to some
HTML elements is necessary:

<textarea class="textarea " name="{concat($ textarea/ancestor::form/@id,
@id)}">
 
</textarea>

otherwise FF produces very, very strange code when displaying:
<textarea .... />

but when I add   user sees this space in textarea field...

or in this situation:

<xsl:template name="generateH elp">
<xsl:param name="help"/>
<xsl:param name="formId"/>
<xsl:param name="fieldId"/>
<span id="{concat($fo rmId, '_', $fieldId,'_msg' )}" style="font-
weight: bold; color: red;">
</span>
<label for="{concat($f ormId, '_', $fieldId)}">
<xsl:value-of select="$help"/>
</label>
</xsl:template>

the <spanelement is generated as <span {attributes...} />

when i use JavaScript innerHTML for span id FireFox swallows
everything as innerHTML including
the <labelelement

any idea how to solve this?

or I should always use the   space entity?

best regards
Łukasz

Mar 18 '07 #1
7 3352
Xh wrote:
there are few HTML elements that i don't what to output as <tagname/>
but as <tagname></tagnamebut Xalan keeps generating them as
<tagname/>

there are few really annoying situations where adding   to some
HTML elements is necessary:

<textarea class="textarea " name="{concat($ textarea/ancestor::form/@id,
@id)}">
 
</textarea>

otherwise FF produces very, very strange code when displaying:
<textarea .... />

but when I add   user sees this space in textarea field...

or in this situation:

<xsl:template name="generateH elp">
<xsl:param name="help"/>
<xsl:param name="formId"/>
<xsl:param name="fieldId"/>
<span id="{concat($fo rmId, '_', $fieldId,'_msg' )}" style="font-
weight: bold; color: red;">
</span>
<label for="{concat($f ormId, '_', $fieldId)}">
<xsl:value-of select="$help"/>
</label>
</xsl:template>

the <spanelement is generated as <span {attributes...} />

when i use JavaScript innerHTML for span id FireFox swallows
everything as innerHTML including
the <labelelement

any idea how to solve this?

or I should always use the   space entity?

best regards
Łukasz

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Mar 19 '07 #2
Xh wrote:
>there are few HTML elements that i don't what to output as <tagname/>
but as <tagname></tagnamebut Xalan keeps generating them as
<tagname/>
Shouldn't be happening necessary if you're really specifying HTML output
mode, and if you're letting Xalan handle the serialization. (If you're
using a SAXResult rather than a StreamResult, maintaining this
distinction is your responsibility) .

Can you provide a minimal example that demonstrates the problem?

On the other, hand, apropos of your workaround:
but when I add   user sees this space in textarea field...
If you don't want the user to see a space, don't use a Required Blank
character as the content; if you use ordinary spaces/linebreaks HTML
will probably discard them.
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Mar 19 '07 #3
Joe Kesselman wrote:
If you don't want the user to see a space, don't use a Required Blank
character as the content; if you use ordinary spaces/linebreaks HTML
will probably discard them.
(BTW, to make sure that space is output to the HTML file rather than
being dropped, you'll probably want to wrap it in an <xsl:text>. Which
is generally a good practice for literal text even when it isn't
entirely necessary.)

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Mar 19 '07 #4
Xh
Hi Joe!

On Mar 19, 6:37 am, Joe Kesselman <keshlam-nos...@comcast. netwrote:
Joe Kesselman wrote:
If you don't want the user to see a space, don't use a Required Blank
character as the content; if you use ordinary spaces/linebreaks HTML
will probably discard them.

(BTW, to make sure that space is output to the HTML file rather than
being dropped, you'll probably want to wrap it in an <xsl:text>. Which
is generally a good practice for literal text even when it isn't
entirely necessary.)
I'd like to provide an example but it is a bit complicated because I
use it my XML + XSLT in JBossAS

but <xsl:text</xsl:textis doing great job and so far I overcame
all
inconveniences

best regards
Łukasz

Mar 19 '07 #5
in message <11************ **********@l75g 2000hse.googleg roups.com>, Xh
('l************ @komputery-internet.net') wrote:
Hi All,

I have problems with generating valid HTML output

there are few HTML elements that i don't what to output as <tagname/>
but as <tagname></tagnamebut Xalan keeps generating them as
<tagname/>
Tag minimisation. One of the real experts will be along in a moment to tell
you how to prevent this properly, but the following works:

<div class="othernew s">
<xsl:commentpre vent tag minimisation of DIV -
Internet Explorer barfs </xsl:comment>
<xsl:apply-templates select="feed"/>
</div>

If '<xsl:apply-templates select="feed"/>' in the above generates nothing
(e.g., if there are no 'feed' elements) the XML would naturally contain an
empty element which would be tag minimised on serialisation (printing to
thee and me). So you put in the xsl:comment essentially to force the tag
to have content, so that it can't be minimised. Don't think this solution
will work for text areas, though - you may have to generate some default
text.

--
si***@jasmine.o rg.uk (Simon Brooke) http://www.jasmine.org.uk/~simon/
;; Skill without imagination is craftsmanship and gives us
;; many useful objects such as wickerwork picnic baskets.
;; Imagination without skill gives us modern art.
;; Tom Stoppard, Artist Descending A Staircase
Mar 19 '07 #6
On 19 Mar, 01:00, Joe Kesselman <keshlam-nos...@comcast. netwrote:
Shouldn't be happening necessary if you're really specifying HTML output
mode,
I've been getting this recently too. Unchanged application code,
"maintenanc e" update of libraries and before I know it, I've got "/>"
in my HTML 8-(
Can you provide a minimal example that demonstrates the problem?
Nope. 8-( It's a vast pile of Ant (a Java-ish build tool) with the
<xslttask in it, grabbing the nearest available Trax processor. I
might get to sort it out some time around the next millenium.

Mar 19 '07 #7
Andy Dingley wrote:
>>Can you provide a minimal example that demonstrates the problem?
Nope. 8-(
Unfortunately, that limits the amount of volunteer debugging assistance
you're going to get.. If I think of anything I'll let you know.

I presume you've asked this on Xalan's own mailing list, since if there
really has been a behavioral change that's where you're most likely to
find the folks who know what it was.

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Mar 19 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
20921
by: Rui Pestana | last post by:
Hello all, I want to use the POST method to submit the form and then grab the parameters in the asp file with request.form("parm"). The problem is that I am using the _search target to open the asp page. When I use _blank target there is no problem, either I use GET or POST method. But when I use _search target, only GET method works.
7
2571
by: Ollej Reemt | last post by:
Hello, I would like to know if there is a difference in c++ between the following two method-declarations: void Method(); and void Method(void);
1
1373
by: Robert Oschler | last post by:
How can I get "parse" errors, not runtime errors, output to a log file of my choice (and preferably in a format I can choose)? I'm running PHP4. Thanks.
0
1859
by: Avinash Dhayagude | last post by:
Hi All, I have an XSL with the output method defined as <xsl:output method="html">. It works in most of the browsers but for few Browsers it is throwing an exception as the value of 'method' attribute may not be 'html' . Is it the problem with XSLT process version or Browser Verstion or there needs a change in Browser settings? If anyone knows do let me know.
1
3402
by: Jim Carlock | last post by:
Let's not argue about semantics. Let's talk about semasiology. Do specifications exist for using mixed case, upper case, lower case for the contents of the method employed? My own preferences lean towards the all lower-case model, simply because it reads a little easier when deployed with other XHTML semaphorings. --
5
2705
by: GenCode | last post by:
What is the best way to read a "readable" web directory... I know I can do this Client.DownloadFile("http://www.mydomain.com/readabledir/", c:\ \dir.txt"); But that gives me the html and all the other tags...all I want is a directory listing of all the *.gif in this dir and not all the html Now I know I can parse the html to get the gif file names...but I
25
2871
by: william.hooper | last post by:
here is my form: <html> <head></head> <body> <FORM ACTION="code.php" method="post"> <INPUT TYPE=SUBMIT NAME="arty.jpg" VALUE="Action"> </FORM>
12
18269
by: Jordi | last post by:
I'm getting the following error: Software error: Can't locate object method "new" via package "A::B" at /path/file.cgi line 5. My code is basically this: #!/usr/bin/perl -w use strict; use warnings; use A::B; my $test = new A::B;
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8904
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8876
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2341
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.