473,789 Members | 2,931 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

2 Questions about validations


posted to: alt.html and comp.infosystem s.www.authoring.html
followup-to: comp.infosystem s.www.authoring.html

Hello all,

I have 2 questions about validations.

1- What's basically the difference between
- validation, validity
- well-formedness
- conformant document

Basically, what I believe is that a well-formed document might not be
valid but a valid document must be well-formed. A valid document might
not be a conformant one but a conformant document must be a valid one.
At least, this is what I think. Am I wrong here? Do you know of a
document that untangles, distinguish well these 3 concepts?

2- When creating inputs or select or checkbox, one must nest these into
a <form> element. Now, if the form is not going to send any data to a
server, then I just assign the action attribute to an empty string like
this:

<form action="">

Now, the W3C considers this as valid markup code in strict HTML 4.01.
But HTML Tidy warns that this is wrong or possibly wrong. What would be
the best thing to do when a form is not going to send any data to any
server? How then should I specify the action attribute in order to
comply with validation requirements?

Thank you for your assistance,

Gérard
--
remove blah to email me

posted to: alt.html and comp.infosystem s.www.authoring.html
followup-to: comp.infosystem s.www.authoring.html
Sep 10 '05 #1
19 2027
In article <3o************ @uni-berlin.de>,
Gérard Talbot <ne***********@ gtalbot.org> wrote:
posted to: alt.html and comp.infosystem s.www.authoring.html
followup-to: comp.infosystem s.www.authoring.html <form action="">

Now, the W3C considers this as valid markup code in strict HTML 4.01.
But HTML Tidy warns that this is wrong or possibly wrong. What would be
the best thing to do when a form is not going to send any data to any
server? How then should I specify the action attribute in order to
comply with validation requirements?


But why would you create a form that doesn't require an action? What
would be the use?

leo

--
<http://web0.greatbasin.net/~leo/
Sep 10 '05 #2
Gérard Talbot wrote:
1- What's basically the difference between
- validation, validity
In SGML and XML, validity means that a document conforms to the Document
Type Definition (DTD) it declares to be using. Validation is a process
of checking validity.

Validity is sometimes described as syntactic correctness. However, it's
not that simple. There are often rules that are clearly syntactic in
nature but cannot be expressed in a DTD, or just have not been expressed
in a DTD. For example, in HTML, an attribute like accesskey="Hell o!" (in
an element that may have an accesskey attribute) is valid but
syntactically incorrect. The syntax says that the value must be a single
character, but this limitations is not (and could not be) expressed in a
DTD.

However, people and organizations, even including the W3C, have confused
things by using "validity" a loose word, basically meaning nothing but
"good" (by someone's taste), except that the use of "validity" makes a
false claim on objectivity and exactness. Moreover, in some areas other
than HTML, but pragmatically related to HTML, "validity" or "validation "
is a technical term, with a meaning that is sufficiently similar to SGML
or XML validity to confuse people. For example, the W3C has coined the
term "valid" for style sheets.

It was probably one of the many unfortunate incidents in the design of
SGML to assign such a technical meaning to the word "valid". But at that
time, it was common to pick up normal English words and to assign a
very, very specifically restricted technical meaning to it - or
sometimes to assign a completely arbitrary meaning to it, quite
independently of any prior normal use of the word. Luckily such things
don't happen any more in this brave new world. :-)
- well-formedness
This is a foolish pseudo-concept in XML &Co. "Well-formed XML document"
means exactly the same as "XML document". It was meant to distinguish
the basic, low-level syntactic requirements of XML from the various
validity requirements that may be imposed using a DTD. Perhaps also to
allow loose speech about "XML document" about almost-wannabe XML, i.e.
from documents that were meant to be XML but aren't.
- conformant document
That's a document that conforms to some standard or specification. A
well-written standard or specification contains a section on conformance
and specifies exactly what is needed for conformance. Note that this
might not imply that the document obeys all recommendations presented in
a specification; the spec may choose to present even strong
recommendations , yet leave them out from conformance requirements. For
example, for XHTML documents, by XHTML specifications, an XML
declaration (<?xml ...>) is strongly recommended, but not required for
conformance.
Basically, what I believe is that a well-formed document might not be
valid but a valid document must be well-formed.
Yes. This of course relates to XML. An XML document might not even have
a DTD. The statement "a valid document must be well-formed" really means
nothing but the fact that only an XML document can be an XML document
that satisfies some special rules. On the practical side, the statement
is not quite that pointless: when verifying validity, we cannot presume
that the document is in fact an XML (or SGML) document, even though
validity is defined for XML and SGML documents only. Validation involves
parsing, and it must be performed so that violations of basic XML (or
SGML) syntax are detected and reported.
A valid document might
not be a conformant one but a conformant document must be a valid one.
That depends on conformance requirements. It would be odd for an SGML
based language specification not to require validity. For XML, it's
quite different. You could define an XML based language with some
elements and attributes, yet leave it open-ended so that everyone and
his dog can add new tags as desired. After all, that's what XHTML (or
XML) has often been advertized to be! :-)
2- When creating inputs or select or checkbox, one must nest these into
a <form> element.
For some values of "must". There is no such requirement in HTML
specifications, either in a DTD or in the prose part. In fact, the DTDs
rather imply the contrary: they could have been written to allow those
elements inside a <form> element only, but they weren't.
Now, if the form is not going to send any data to a
server, then I just assign the action attribute to an empty string like
this:

<form action="">

Now, the W3C considers this as valid markup code in strict HTML 4.01.
It is valid, since the action attribute is declated with CDATA value,
which means that anything goes, even an empty string.
But HTML Tidy warns that this is wrong or possibly wrong.
This depends on your interpretation of the URL specifications (whether
an empty string is a URL) and the HTML specifications (which is the URL
specification to be applied - the one that was the proposed standard
when the HTML spec was issued, or the current Internet-standard on
URLs). So it's rather thin ice. But if action="" _means_ anything, it is
equivalent to an action attribute with the document's base address as
its value. Loosely speaking, the page would submit the form to itself.
This may work just fine if the page address actually invokes a
server-side script (e.g., it is a PHP page).
What would be
the best thing to do when a form is not going to send any data to any
server?
To specify an action attribute that refers to a server-side script that
sends back a suitable error code and error message page, explaining the
problem somewhat - even if you don't expect the problem to occur.
How then should I specify the action attribute in order to
comply with validation requirements?


I described the safe approach. To comply with validation requirements,
it would suffice to write action="", though in practice it would be more
useful to write action="oh, this is never supposed to be used!".
(It's valid and syntactically incorrect.)
Sep 10 '05 #3
Gérard Talbot <ne***********@ gtalbot.org> wrote:
1- What's basically the difference between
- validation, validity
- well-formedness
- conformant document
Validity: when a document conforms to the requirements of the applicable
DTD.

Well formdness: a requirement for documents that are parsed as XML, if
not well formed an XML parser would choke on the code since unlike an
HTML renderer it cannot handle non well formed code. Well formdness is
also required for XHTML served as text/html, this time it's only of
relevance to a validator, it's of no relevance to other parsers such as
browsers.

Conformant document: the HTML spec contains quite a few requirements
that cannot be expressed in a DTD, these requirements are listed in the
spec's prose. Nowadays there are so called Relax NG HTML checkers that
don't just check for validity against the DTD, they also (attempt to)
check for the other requirements listed in the spec's prose. One such an
Relax NG HTML checker is http://badame.vse.cz/validator/
2- When creating inputs or select or checkbox, one must nest these into
a <form> element. Now, if the form is not going to send any data to a
server, then I just assign the action attribute to an empty string like
this:

<form action="">

Now, the W3C considers this as valid markup code in strict HTML 4.01.
But HTML Tidy warns that this is wrong or possibly wrong. What would be
the best thing to do when a form is not going to send any data to any
server? How then should I specify the action attribute in order to
comply with validation requirements?


You could have added an item to your list of three: "correct HTML".
Unlike the other three this is not a defined term, and cannot be checked
by a bot because it cannot be defined unambiguously, and it's open to
debate and opinion.

HTML Tidy is a tool that at best can check for well formdness, it
doesn't validate (check against the DTD), or check for the additional
requirements expressed in a spec's prose. Tidy attempts to check for the
aforementioned "correct HTML". As previously noted it isn't possible to
check for this with a bot. What Tidy does is it uses a number of checks
that have been drawn up by it's programmers, these checks can be
helpful, but because they attempt to do the impossible Tidy's checks are
contentious, and sometimes plain wrong.

Assessing HTML for "correctnes s" requires an intelligent human being.
The "correctnes s" factor gives rise and purpose to platforms such as
this (c.i.a.w.h), where we debate this illusive issue.

--
Spartanicus
Sep 10 '05 #4
In article <df**********@p hys-news1.kolumbus. fi>,
"Jukka K. Korpela" <jk******@cs.tu t.fi> wrote:
Gérard Talbot wrote:
1- What's basically the difference between
- validation, validity


In SGML and XML, validity means that a document conforms to the Document
Type Definition (DTD) it declares to be using. Validation is a process
of checking validity.


I think it is worth stressing that SGML and XML are sufficiently
different so that performing SGML DTD validation on a document is not
the same thing performing XML DTD validation. The W3C Validator and the
WDG Validator perform SGML DTD validation even on documents that purport
to be XML. This yields wrong results.

http://validator.w3.org/check?uri=ht....fi%2Ftest%2Fi
ll-formed-but-sgml-valid%2Fno-space-between-attributes.xhtm l

http://www.htmlhelp.com/cgi-bin/vali...%2Fhsivonen.ik
i.fi%2Ftest%2Fi ll-formed-but-sgml-valid%2Fno-space-between-attributes.xht
ml&warnings=ye s

AFAIK, the only free online service for actually performing XML DTD
validation is PageValet.

http://valet.webthing.com/view=Asis/...3A%2F%2Fhsivon
en.iki.fi%2Ftes t%2Fill-formed-but-sgml-valid%2Fno-space-between-attribute
s.xhtml&parser= Any&resultsMode =traditional&pa rseMode=web

I know you don't like the use of the word "valid" in connection to
non-DTD XML schema languages. However, to give a more comprehensive
answer to the OP, I think other meanings on valid and validity should be
mentioned.

There are non-DTD schema languages (including but not limited to RELAX
NG, Schematron and W3C XML Schema) and in the context of these languages
document D is valid according to schema S iff D is an XML document
(well-formed) and D conforms to constraints expressed in S.

DTD validation takes one input--the XML or SGML document, which includes
the DTD itself (possibly by reference). Therefore, DTD validity is an
internal property of the document. RELAX NG, Schematron and (in the
absence of schemaLocation) W3C XML Schema validation processes take two
inputs: D and S, so validity is not an internal property of D.

Related online services:
http://hsivonen.iki.fi/validator/
http://badame.vse.cz/validator/
http://schneegans.de/sv/
Basically, what I believe is that a well-formed document might not be
valid but a valid document must be well-formed.


Yes. This of course relates to XML.


Right. However, the W3C and WDG validators can proclaim a document valid
even if it is not well-formed (because they use an SGML parser--not an
XML parser).

--
Henri Sivonen
hs******@iki.fi
http://hsivonen.iki.fi/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
Sep 10 '05 #5
Gérard Talbot wrote:
1- What's basically the difference between
- validation, validity
- well-formedness
- conformant document

Basically, what I believe is that a well-formed document might not be
valid but a valid document must be well-formed. A valid document might
not be a conformant one but a conformant document must be a valid one.


That's more or less it.

Well-formedness means it obeys the general rules of XML: all elements have
closing tags, no incorrectly nested elements (<a><b></a></b>), all
ampersands and other special characters escaped, etc. This concept only
really applies to XML.

Validitiy means that it *also* obeys the rules of a particular DTD.

A conformant document obeys the rules of some specification somewhere.
In SGML/HTML/XML terms, one of these rules will generally be that the
document must validate against a particular DTD. It may also include other
rules though, which might be impossible to express in the DTD.

For example, I might create "XHTML 1.9" which is the same as XHTML 1.1
with the additional requirement that "id" attributes must not be types of
fishes.

The following fragement, as part of a larger valid document:

<div id="Haddock">
<p id="Cod">Hello </p>
</div>

is well-formed and valid, but does not conform to the XHTML 1.9
specification that I laid out above.

In real HTML, there are several areas where documents can be valid but not
conformant. For example, using the style attribute without specifying the
default style sheet language.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Sep 10 '05 #6
On Sat, 10 Sep 2005 11:19:55 +0300, Henri Sivonen <hs******@iki.f i>
wrote:

[...]
DTD validation takes one input--the XML or SGML document, which includes
the DTD itself (possibly by reference)...
The standard SGML validation process takes one input which can contain
any number of entities, that when concatenated yields a resulting entity
witch contains (in specified order)...

1) a fully valid SGML declaration
2) a fully valid declaration of all sub entities
3) a fully valid declaration of all markup syntax
4) the (possibly fully valid) marked up document instance
Therefore, DTD validity is an internal property of the document.
The expression "DTD validity" is a misnomer.

[...]
...the W3C and WDG validators can proclaim a document valid
even if it is not well-formed (because they use an SGML
parser--not an XML parser).


That depends on the SGML declaration in use, not on the validating
parser as such.

Since (W3C)XML does not have a 'valid' SGML declaration to define its
basic internal characteristics , a discussion on 'validity' (in SGML
terms) is moot for that family of (proprietary?) markup.

--
Rex
Sep 10 '05 #7
In article <m0************ *************** *****@4ax.com>,
Jan Roland Eriksson <jr****@newsguy .com> wrote:
On Sat, 10 Sep 2005 11:19:55 +0300, Henri Sivonen <hs******@iki.f i>
wrote:
...the W3C and WDG validators can proclaim a document valid
even if it is not well-formed (because they use an SGML
parser--not an XML parser).


That depends on the SGML declaration in use, not on the validating
parser as such.


Actually, it does depend on the parser being an SGML parser. I don't
have the Handbook here, but I checked it on Wednesday and, IIRC, the
omission of white space between a delimiter (ie. ' or ") and the start
of the name of the next attribute is always allowed regardless of the
SGML declaration. (But XML 1.0 always requires one or more white space
characters there.)

Curiously, the space before the attribute name is defined as *s in the
formal productions and only the spec prose effectively changes it to +s
in cases where the lack of space would cause two tokens to merge into
one.
Since (W3C)XML does not have a 'valid' SGML declaration to define its
basic internal characteristics , a discussion on 'validity' (in SGML
terms) is moot for that family of (proprietary?) markup.


Right. So it is inappropriate to try to decide validity in the sense
meant in XML 1.0 by using a tool that decides validity in the sense
meant in SGML. And if an SGML tool is used nonetheless, it won't say
anything conclusive about well-formedness as defined in XML 1.0.

--
Henri Sivonen
hs******@iki.fi
http://hsivonen.iki.fi/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
Sep 10 '05 #8
Toby Inkster a écrit :
Gérard Talbot wrote:

1- What's basically the difference between
- validation, validity
- well-formedness
- conformant document

Basically, what I believe is that a well-formed document might not be
valid but a valid document must be well-formed. A valid document might
not be a conformant one but a conformant document must be a valid one.

That's more or less it.

Well-formedness means it obeys the general rules of XML: all elements have
closing tags, no incorrectly nested elements (<a><b></a></b>), all
ampersands and other special characters escaped, etc. This concept only
really applies to XML.


I always assumed and thought that well-formedness only referred to
correct nesting of element situations and to nothing else.
So this is news to me. A valid document may not be well-formed after all.

<p><font size="8">Fruits </font>
<ul>
<li><font size="">Orange</font>
<li>Apple
</ul>

in a transitional DTD, HTML 4.01 would be valid according to W3C HTML
validator but not well-formed. hmm...
Validitiy means that it *also* obeys the rules of a particular DTD.

A conformant document obeys the rules of some specification somewhere.
In SGML/HTML/XML terms, one of these rules will generally be that the
document must validate against a particular DTD. It may also include other
rules though, which might be impossible to express in the DTD.

For example, I might create "XHTML 1.9" which is the same as XHTML 1.1
with the additional requirement that "id" attributes must not be types of
fishes.

The following fragement, as part of a larger valid document:

<div id="Haddock">
<p id="Cod">Hello </p>
</div>

is well-formed and valid, but does not conform to the XHTML 1.9
specification that I laid out above.

In real HTML, there are several areas where documents can be valid but not
conformant. For example, using the style attribute without specifying the
default style sheet language.


I recently stumbled across a document where it is written something like:

<p><font size="8">some text</font></p>

I created a document in transitional DTD, HTML 4.01 and W3C HTML
validator considered the document to be valid. Even

<p><font size="">some text</font></p>

in a document with transitional DTD, HTML 4.01 is considered valid by
the W3C validator.

So, conformance is really what we should be aiming at.

Thanks for your feedback,

Gérard
--
remove blah to email me
Sep 10 '05 #9
<ne***********@ gtalbot.org> wrote:
A valid document may not be well-formed after all.
Incorrect. A document can't be valid without being well-formed.
<p><font size="8">Fruits </font>
<ul>
<li><font size="">Orange</font>
<li>Apple
</ul>

in a transitional DTD, HTML 4.01 would be valid according to W3C
HTML validator but not well-formed. hmm...


Well-formedness applies to XML only.

--
David Håsäther
Sep 10 '05 #10

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

Similar topics

1
6394
by: Naresh Agarwal | last post by:
Hi I'm using SAX Parser of Xerces Java v2.4.0 for XML Parsing. I want to perform schema validations on the xml. The problem is that root element of XML document does not have "xsi:schemaLocation" attribute, which is used to specify the .xsd file. Is there any other way for specifying the name of .xsd file?
0
1003
by: babash | last post by:
I designed a site with asp.net all pages are working properly on my local computer but when I upload the sit on the server on those pages that I have field validation, Buttons doesn’t work. When I delete field validations all the buttons are working properly. Funny part is that all these pages are working properly when I use Netscape But in internet explorer I faced with this weird problem. Please tell me what I should do.
0
1728
by: Rajesh Jain | last post by:
I Have 2 separate schemas. --------------Schema 1 is defined as below----------- <xs:schema targetNamespace="http://Schemas/1" xmlns="http://Schemas/1" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="Loan"> <xs:complexType> <xs:sequence> <xs:element name="Borrower" maxOccurs="unbounded"> <xs:complexType> <xs:attribute name="BorrID" use="required">
1
1150
by: DotNetJunkies User | last post by:
I successfully implemented this poup calendar control in C#. But the problem I am having is that the button click is posting back and the validator is getting fired which is asking all the required fields on the page to be first entered in with some data. Once all the validations are satisfied for other fields then the popup calendar pops up. But I would like the user to be able to fill in the date before he wants to fill in other fields. How is...
1
1559
by: Murat YILMAZ | last post by:
Hi all, I have develop a web page and there are 4 textbox on it. I have put 4 validation for these. Issue is that If I have request this page and submit form validations are not working. But I have put other computer then try again. It is working... I have look source from "view source" selection. And I see what On the my computer was not load some thing to button on click. But other computer was load.
1
751
by: anil kumar via .NET 247 | last post by:
(Type your message here) hi, i am using save & cancel webform buttons in my webpage to withsome validations , when i am trying to save my content it issaved that time i need a popup msg like ur 'data is saved' , andwhen i am trying to click on cancel the page should terminatewith out effecting of validations . and how to open a modal dialog page through vbscript -------------------------------- From: anil kumar -----------------------...
1
5873
by: Anup | last post by:
In my form I and doing validations using 'Javascript' as I m using ASP1.1 and there is very less support for Validators there. //Code Behind private void Page_Load(object sender, System.EventArgs e) { Button1.Attributes.Add("OnClick","fun()"); } Problem in using "Button1.Attributes.Add " for client side script for
2
1587
by: prakashsurya | last post by:
Hello I am going through the validations in a form I would like to know the validations to be considered in writing javascript for email id so would u plz help me in writing the necessary functions thanq This is the code for that: <html>
2
3017
by: swethak | last post by:
hi , i write the code in .htm file. It is in cgi-bin/searches/one.htm.In that i write a form submitting and validations.But validations are not worked in that .htm file. I used the same code in my local system that validations work.plz tell that whats the problem in that. Here is my code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html...
0
9666
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
9511
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
10200
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...
0
9984
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...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5418
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
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2909
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.