473,554 Members | 3,048 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

safe range of characters in a <A name="">

Using <A name="x_y-z"></A>, I even get nervous about the _ and -.
w3-recs/RECS/html4/struct/links.html seems to say all of ascii is cool
and beyond. Anyway, just what is the safe range for characters in a
name="" ? I don't plan to go beyond usual Unix filename chars.
Jul 20 '05 #1
4 2228
On Fri, Jul 25, Dan Jacobson inscribed on the eternal scroll:
Using <A name="x_y-z"></A>, I even get nervous about the _ and -.
w3-recs/RECS/html4/struct/links.html seems to say all of ascii is cool
and beyond.
Well, in the HTML4.01 spec, name is declared as CDATA, whereas id is
declared as something else (see below).

But it then says of "name":

Note that this attribute shares the same name space as the id
attribute.

Strange that they share the same space but are formed according to
very different syntax rules, what?

By the way, don't confuse the attributes called "name" and "id" with
the declared types "name" and "id". The attribute called "name" is,
as I said, declared as "cdata", whereas the attribute called "id" is
declared as "name".... erm... Hangonabit, the SGML tutorial at
http://www.w3.org/TR/html401/intro/s...html#h-3.3.3.4 says that
the id attribute is declared of type id, and so does the actual DTD,
but the text of the specification asserts at
http://www.w3.org/TR/html401/struct/global.html#adef-id that it's
declared as type "name". I hadn't noticed that discrepancy before.

Is there an SGML doctor in the house?
Anyway, just what is the safe range for characters in a
name="" ? I don't plan to go beyond usual Unix filename chars.


Ultimate safety would be to stick to the SGML name token rules which
were incorporated into RFC1866/HTML2.0:

3.2.3. Names

A name consists of a letter followed by letters, digits, periods, or
hyphens.

So on that basis, scrub the underscores.

This has not been a formal requirement since HTML3.2, but it seems to
do no harm to stick to it if you feel that you can. However, you'll
see underscores used e.g in an example in the HTML4.01 specification,
and HTML4.01 also includes colons as eligible characters; so... it's
up to you.
Jul 20 '05 #2
In article <Xn************ *************** **@193.229.0.31 >,
Jukka K. Korpela <jk******@cs.tu t.fi> wrote:
[...] but when, oh when, will the World Wide Web Consortium invent the
idea that on the Web, unlike in print media, you can actually change a
document behind a URL and everyone who accesses it, modulo cache
issues, will get the updated document? Do they really expect people to
dig through the Errata, perhaps every one of us editing our local
copies of the specifications according to them? Or are the errors
recorded just to please some unknown deity?


To avoid the W3C's Recommendations becoming a "moving target",
documents in TR space are frozen. The Errata documents are collections
of known erratum -- acknowledged issues -- that the relevant WG MUST
address and MAY choose to address by publishing a revised
Recommendation. HTML 4.01 was one such. I'm hoping for a HTML 4.02...

Did you not know that or did I not understand your complaint? :-)

--
T.E.R.J.E. - Technician Engineered for Repair and Justified Exploration
B.L.E.S.S. - Biomechanical Lifeform Engineered for Scientific Sabotage
Jul 20 '05 #3
In article <Pi************ *************** ****@lxplus001. cern.ch>,
Alan J. Flavell <fl*****@mail.c ern.ch> wrote:
Strange that they share the same space but are formed according to
very different syntax rules, what?
BTW, according to ISO-8879:1986, they actually cannot have the same
definition as

[[[
Within a document type definition, the same /attribute name/
should be used for all attributes having a /declared value/
of "ID".
]]]

thus @name and @id cannot both be of type "ID".

Ultimate safety would be to stick to the SGML name token rules which
were incorporated into RFC1866/HTML2.0:

3.2.3. Names

A name consists of a letter followed by letters, digits, periods, or
hyphens.

So on that basis, scrub the underscores.

This has not been a formal requirement since HTML3.2, but it seems to
do no harm to stick to it if you feel that you can. However, you'll
see underscores used e.g in an example in the HTML4.01 specification,
and HTML4.01 also includes colons as eligible characters; so... it's
up to you.


Actually, the SGML Declaration governs this by specifying the LCNMSTRT,
UCNMSTRT, LCNMCHAR, and UCNMCHAR. In HTML 4.01, the former two are
specified as "" (the empty set) and the latter two as ".-_:".

The Reference Concrete Syntax and SGML together defines a "name
character" as a "name start character" followed by "Digits" and
[LC|UC]NMCHAR. A "name start character" is "LC Letter", "UC Letter", or
any char assigned to the roles LCNMSTRT and UCNMSTRT.

In sum, the legal characters are: a-z A-Z 0-9 . - _ :

[ Source: Goldfarb's "The SGML Handbook". ]
That doesn't quite jive with my existing assumptions (or yours,
apparently), but it's the only conclusion I can draw from the source
material. Can anyone shed some light on the discrepancy?

--
T.E.R.J.E. - Technician Engineered for Repair and Justified Exploration
B.L.E.S.S. - Biomechanical Lifeform Engineered for Scientific Sabotage
Jul 20 '05 #4
On Fri, Jul 25, Jukka K. Korpela inscribed on the eternal scroll:
"Alan J. Flavell" <fl*****@mail.c ern.ch> wrote:
But then we'd have to put a date and time stamp on any reference to
the authoritative document, and someone would need to maintain an
archive of the changes,
I thought such things were in the basic ideas of the Web.


That's ideal for tutorials, FAQs etc, but not for authoritative
specifications. I interpret a published specification as in effect a
contract: once it's out there and people are relying on it, it would
be fraud to quietly change its content. Updates should be issued only
in a controlled fashion and with an accompanying version reference,
IMHO (but I fear I'm just repeating myself...)
If records of changes are needed, they should be created as well.
Yes, indeed. Now we're saying much the same thing as each other, I
reckon.
Your argument is at least plausible for simple typos, but IMHO a
document which asserts itself to be the authoritative definition of
something cannot be quietly amended as if nothing had happened.


We surely agree on that.


Good...
Neither should such a document, when published on the Web, contain
errors that have been reported and acknowledged as errors
The problem with CSS2 is that the working group seem to have decided
"well, we said precisely A, but we _really_ meant B, so we'll change A
to B and pretend that's what had been meant all along". Foul!
There are other ways of handling that, as I'm sure you know.


No, I don't. I don't know how to publish a version of HTML 4.01 with
errata fixed incorporated, in a manner that raises no copyright issues


Fair comment. But I wasn't meaning "other ways" which could be
applied by third parties, I was meaning "other ways" which might be
considered by the W3C.
but the TR was formally approved by the
W3C (whatever that might really mean), whereas the so-called
"Errata" seem to be a somewhat wooly product from a working group.


So we don't really know what the content of the specification is, do
we? The specification makes a reference to the Errata.


That was inserted into the cover page post facto. That doesn't make
it part of the 1998 CSS2 TR.
Is it a normative reference or not?
The specification itself says that it is not! But I'm sure the
working group saw that differently!! They evidently conceive of what
is effectively a "CSS2 du jour" - defined by applying the Errata to
the original TR.
But surely just in the sense of fixing errors, i.e. correcting errors
in the documentation of what was meant at the time of writing the
specification, not introducing any "on second though, it should..."
ideas.


It seems to me that it's not unfair to say that the working group
evidently lacked the self-restraint implied by that plan.

cheers
Jul 20 '05 #5

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

Similar topics

6
2580
by: lecichy | last post by:
Hello. Well, I found this piece of code on php.net. Thats fine but where can i find explanation for all these ("|\')?(*)("|\')?.*>(*)' syntax so that I can construct my own rules for all kind of eregi preg and oter match functions ?
2
8759
by: Charles Nadeau | last post by:
Hello, I am trying to craft a regular expression to filter an URL from a <a href=""></a> tag and the one I have doesn't seen right. I use the regular expression from this snippet of code: foreach my $message (@messages) { my @match=($message->decoded=~/\bhref="(http.*)">.*/gi);
1
6811
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
6
77496
by: Tony Marston | last post by:
The code <a href="..." target="_blank">...</a> will not validate as XHTML STRICT because of the 'target' tag, so how do I achieve the same result by moving it to a CSS file? I cannot find anything which allows me to specify 'target=' on an anchor tag. -- Tony Marston http://www.tonymarston.net
2
6830
by: andrew007 | last post by:
I do xml / xslt transformation using asp.net but I found any value (w/xml format) in xml node html-encoded to &lt and &gt format if it's > or < tag. Since I have sub xml data in a parent xml node as a value. Check out the following problem. I want to convert the value in <WpDatesXml> node to have a valid "<" and ">" instead of &lt or &gt...
3
2159
by: Steven.Xu | last post by:
hi everybody, i am useing some classes which in System.Xml to deal with xml document. what can i do if the document include "<" or ">"? Thanks.
2
2249
by: alxasa | last post by:
Hello, I am hoping someone can help me with this. I need a javascript function, which sits inside a <input type="text" name="firstname"> line of code. Now, if someone starts typing fine, but when it goes 1 character past 15 characters (15 characters only allowed), in this case I would like the contents of the input to be cleared out...
18
10719
by: zoilus | last post by:
Can not determine how "<?=PHP_SELF?>" is supposed to work. The below is the line of code. <!-- <form name="search" method="post" action="<?=$PHP_SELF?>"--> When the above statement is run the following is the result. You don't have permission to access /dev/forms/forms_testing/< on this server.
1
4299
by: ismailc | last post by:
Hi, I need help please. Update system to to new version & moved on to .Net2 But now my code that worked in my .Net1 xslt does not work. .Net1 fine: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:asp="remove" xmlns:igchart="remove" xmlns:igsch="remove"> &lt;td class='rowDet' id="td_<xsl:value-of...
0
7584
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...
0
7512
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...
0
7783
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. ...
0
7879
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...
0
6129
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...
1
5426
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...
0
3536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2009
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
828
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...

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.