468,734 Members | 2,352 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,734 developers. It's quick & easy.

I follow the following steps to converting from HTML to XHTML


I follow the following steps to converting from HTML to XHTML

My parser is http://htmlparser.sourceforge.net/
Xhtml version is 1.0 from http://nds.nokia.com/uaprof/N6600r100.xml

but nokia mobile browser cannot identify the converted file(XHTML1.0).
Is there something wrong with my procedure.

Or the web http://webpageworkshop.co.uk/main/xhtml_converting is
something weak.

Any positive suggestion is welcome.
thank you
May goodness be with you all
Jul 23 '05 #1
2 2559
mike wrote:
I follow the following steps to converting from HTML to XHTML
Why are you converting from HTML to XHTML?
After reading this document, it was clearly written by someone that
doesn't really understand all the issues and I wouldn't trust it for
everything. For example, these are just some of the mistakes I
encounted as I skimmed through it, and there are probably more that I

Step 2: Incorrectly refers to the XML declaration (<?xml ... ?>) as the
"XML tag". [1]

Step 4:
| (The documentation states that you should use <br/>, but for some
| reason this doesn't always work, so the extra space in the element is
| suggested).

The reason it is advisable to insert the space is to comply with the
backwards compatibility suggestions in Appendix C of the XHTML 1.0
recommendation. This only applies to XHTML documents served as
text/html because they will be treated as tag-soup by the browser. It
is not necessary, though still valid, when the document is correctly
served as application/xhtml+xml (or other XML MIME type).

Step 5:
| XHTML states that all the attribute values must be surrounded by
| quotes, so for example <table width=100%> is no longer considered
| "well formed", whereas <table width="100%"> is.

While the statement about the requirement for all attributes in XHTML to
be quoted is correct, the implication that width=100% being valid in
HTML is not. Validating a document with that attribute results in this

# Line 10, column 18: an attribute value must be a literal unless it
# contains only name characters

If his example had not contained "%", then it would have been correct,
but it has always be advisable to quote all attributes in HTML anyway.

Step 7:
The implication that the alt attribute was not always required in HTML
is incorrect, it is required equally for both HTML and XHTML documents.
His assertion that there is no longer a choice for XHTML documents is
somewhat misleading. It's absense will not result in an error from a
non-validating parser, and a validator will report the same error
regardless of whether the document is HTML or XHTML.
Step 8:
| In the past it has been acceptable to "overlap" your elements, for
| example <b><i>text</b></i>.

That is simply not true. A validator will report an error for that in
HTML as well, it's just that common tag-soup parsers silently ignore the
error and attempt to produce a structured DOM out of it anyway, though
each browser will produce a different result. [2]

However, in XHTML, the difference is that XML parsers are required to
give a well-formedness error, but that will only occur when the document
is served as XML.

Step 9:
The type attribute is required for HTML documents too. The implication
that it is not, is incorrect.

The document also omitted a lot of very important detail about MIME
types, differences with the way scripts and stylesheets will be handled,
and many more things. [3]
Xhtml version is 1.0 from http://nds.nokia.com/uaprof/N6600r100.xml
That document is not XHTML, it is a plain text document that looks like
RDF (though it's not being served as XML), but I'm not sure what it is
supposed to be exactly. Please explain what you meant more clearly.
but nokia mobile browser cannot identify the converted file(XHTML1.0).

There could be many problems, though without a URI for the document and
without knowing the exact error being given by your nokia phone, it is
impossible to diagnose.

[1] http://lachy.id.au/log/2004/12/html-tags
[2] http://ln.hixie.ch/?start=1037910467&count=1
[3] http://www.hixie.ch/advocacy/xhtml

Lachlan Hunt
http://GetFirefox.com/ Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox
Jul 23 '05 #2
It was somewhere outside Barstow when s9*****@mail.yzu.edu.tw (mike)
but nokia mobile browser cannot identify the converted file(XHTML1.0).
Is there something wrong with my procedure.

You haven't shown us a URL for the converted file (or the original)

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by lquast | last post: by
17 posts views Thread by mickjames | last post: by
1 post views Thread by Paul | last post: by
5 posts views Thread by k.vanderstarren | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
2 posts views Thread by xarzu | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.