473,320 Members | 2,041 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Generate valid XHTML

Hi all.
I have probably a rather stupid question.
If there is an HTML document, XML-formed using JTidy,
is there any tool to convert it to valid XHTML?
I.e. so that all the tags and attribute values will be XHTML compliant.
For example, if the original document has following snippet:
<p><div>text</div></p> (which is not valid XHTML), the output
would be something like <p><span>text</span></p> (which is valid XHTML).

Thank you very much for help.

Anna
Jul 20 '05 #1
1 1753
* Anna wrote in comp.text.xml:
If there is an HTML document, XML-formed using JTidy,
is there any tool to convert it to valid XHTML?
I.e. so that all the tags and attribute values will be XHTML compliant.
For example, if the original document has following snippet:
<p><div>text</div></p> (which is not valid XHTML), the output
would be something like <p><span>text</span></p> (which is valid XHTML).


Well, I am not that familiar with JTidy, but Tidy attempts to do that to
some extend. Current Tidy would turn that fragment into

<div>text</div>
<br />
<br />

which is bad but valid. If you specify the --drop-proprietary-attributes
config option, it would even drop all non-W3C attributes from all
elements, Tidy even tries to convert some known proprietary elements to
other elements, CSS, characters, ... whatever might fit. In fact, if the
result with --drop-proprietary-attributes enabled is not valid, it is
probably a bug and should be reported (this does not apply to invalid
attribute values for valid attributes, Tidy fixes some, but quite a
number cannot be fixed, just dropped, but there is currently no config
option to do that.)
Jul 20 '05 #2

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

Similar topics

38
by: Jukka K. Korpela | last post by:
As well all know, valid markup is important... but when trying to find a convincing modern argument in favor of this, I found pages like http://www.htmlhelp.com/tools/validator/reasons.html which...
18
by: Neal | last post by:
According to the specs (http://www.w3.org/TR/html401/struct/links.html#h-12.2), the <a> element requires an end tag. And so, when we use <A NAME="foo"> in HTML 2.0 to 4.01, it won't validate,...
10
by: Fred | last post by:
Hello, After looking at various CMS tools, either server- (Drupal, Pivot, etc.) or desktop-based (CityDesk, Cute Site Builder), it occured to me that I really didn't need something that...
12
by: thomas_jedenfelt_1 | last post by:
Hi everyone, Is the W3C HTML Validator in error when it returns <br /> as valid for HTML 4.01 Strict doctype? In March 2004 , the Validator returned <br />, <hr /> and <img /> as invalid for...
2
by: Michael G | last post by:
Hi, I am really struggling with using form control names such as "gs". This will not valid but is tremendously useful in terms of the way that it is handled by php on the server. Any...
8
by: Anthony Williams | last post by:
Morning all, I'm having a wee problem with a project I'm working on at the moment. I'm leading my company into producing a website, based upon Web Standards, which will be created using XHTML...
9
by: Brian Lowe | last post by:
I'm using Visual Studio to build ASP.Net pages and I'm trying to be standards compliant by using XHTML. In my page I create valid XHTML such as: <ul> <li>first list item</li> <li>second list...
4
by: Lee Chapman | last post by:
Hi, I am having difficulty getting the ASP.NET framework to generate valid XHTML. My immediate problem surrounds user input in, for example, textbox controls. I consider characters such as...
1
by: divyac | last post by:
I am doing an inventory project using PHP in which there is a text box.The customer id should be entered in that text box.If that customer id is valid,another text box should be generated in which...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.