Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Tomcat and struts: expanding empty XML tags in XHTML

Reply
Thread Tools

Tomcat and struts: expanding empty XML tags in XHTML

 
 
yzzzzz
Guest
Posts: n/a
 
      01-01-2005
Hi,

I am using Tomcat 5.5 and struts 1.2.4, everything in XHTML.
Here is my problem:

If file.jspx contains
<script type="text/javascript" src="file.js"></script>
after it is parsed by Tomcat, the browser receives
<script type="text/javascript" src="file.js"/>

This is correct, and Firefox understands it, but it is not backwards
compatible with HTML, so MSIE doesn't. I just get a blank page with MSIE.

Is there any solution to this problem? (Maybe a filter that could change
<script/> back to <script></script> or something)

Thank you.

(PS. no I'm not going back to serving HTML4!)
 
Reply With Quote
 
 
 
 
Ryan Stewart
Guest
Posts: n/a
 
      01-01-2005
"yzzzzz" <(E-Mail Removed)> wrote in message
news:41d601a3$0$2569$(E-Mail Removed)...
> Hi,
>
> I am using Tomcat 5.5 and struts 1.2.4, everything in XHTML.
> Here is my problem:
>
> If file.jspx contains
> <script type="text/javascript" src="file.js"></script>
> after it is parsed by Tomcat, the browser receives
> <script type="text/javascript" src="file.js"/>
>

I haven't seen this one before. Are you *sure* it goes in Tomcat correctly
and comes out changed? Do you have any thoughts on what might be causing it?


 
Reply With Quote
 
 
 
 
yzzzzz
Guest
Posts: n/a
 
      01-01-2005
Ryan Stewart wrote:
> "yzzzzz" <(E-Mail Removed)> wrote in message
> news:41d601a3$0$2569$(E-Mail Removed)...
>
>>Hi,
>>
>>I am using Tomcat 5.5 and struts 1.2.4, everything in XHTML.
>>Here is my problem:
>>
>>If file.jspx contains
>><script type="text/javascript" src="file.js"></script>
>>after it is parsed by Tomcat, the browser receives
>><script type="text/javascript" src="file.js"/>
>>

> I haven't seen this one before. Are you *sure* it goes in Tomcat correctly
> and comes out changed? Do you have any thoughts on what might be causing it?


I don't know if this is normal, but all my jspx files are parsed and
come out on a single line (when I view source). I suppose the jspx is
parsed as XML (whitespace being ignored, as with any XML), and the
canonical form in the XML parser is then interpreted (doing stuff with
elements in the <html:> and <c:> namespaces) and then it regenerates the
output, so it is not surprising I loose the code's "layout", the HTML
comments, and empty elements are in their short form.

I can give you config details if you like.

BTW I have the same problem with empty <td>s becoming <td/> instead of
<td></td> (but this is less important, as </td> is not required in HTML4).
 
Reply With Quote
 
Wendy S
Guest
Posts: n/a
 
      01-28-2005
"yzzzzz" <(E-Mail Removed)> wrote:
> Is there any solution to this problem? (Maybe a filter that could change
> <script/> back to <script></script> or something)


What happens if you put something in between the script tags, a <!--
comment --> maybe?

--
Wendy S


 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XHTML Modularization: Creating XML schema for mixed custom tags andXHTML mk189@seznam.cz XML 0 05-09-2008 12:14 PM
xml -> xslt -> xhtml, browser-side not rendering, put in pre tags. bram.labarque@gmail.com XML 5 07-06-2006 07:15 AM
xml -> xslt -> xhtml, browser-side not rendering, put in pre tags. bram.labarque@gmail.com XML 0 07-05-2006 04:31 PM
Expanding / Collapse specific div tags Tim Javascript 2 05-30-2006 02:17 PM
Altova Mapforce - xml 2 xml map: empty elements output although input element is not empty Lukas XML 3 11-10-2005 02:25 PM



Advertisments