473,775 Members | 2,610 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1790
* 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
3616
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 was very nice when Netscape ruled the World Wide Web, and http://valet.htmlhelp.com/page/why.html which is very suggestive but does not really give any factual example. Is there something to be _shown_ to people who ask "why validate?"? A page...
18
2474
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, it'll want to find the </A> tag. However, when I write a document containing, say, <a name="foo" /> it validates in XHTML 1.0. I'm obviously missing something here, as this confuses me somewhat. Does the magical / make the empty a element valid?...
10
2341
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 sophisticated just to add navigation bars in each article on my site, and generate the home page with hyperlinks to each article. I figured all it took is a script that ... 1. takes each raw HTML article that the user has generated with the
12
45339
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 HTML 4.01 Strict. Liam Quinn said "You can't mix HTML and XHTML. You need to choose one or the other syntax."
2
1386
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 thoughts? Thanks, Mike
8
1956
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 and CSS, and powered by ASP.NET. My first problem, which I'm near to solving, was that ASP.NET doesn't produce valid XHTML output. We don't want to spend money on third-party components, and we can't wait for ASP.NET 2.0, so we needed to find a
9
1609
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 item<br /> includes a line break</li> </ul>
4
1605
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 less-than and ampersand perfectly valid in user input. So I've disabled request validation by adding the following to my web.config file.
1
2476
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 the product id should be entered..If that product id is valid,other 3 text boxes should be generated dynamically in order to do transaction.is it possible to generate forms without a button click?...The order of the forms should be as follows: ...
0
9622
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10268
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10107
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
10048
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
9916
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
7464
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
5360
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...
3
2853
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.