473,378 Members | 1,106 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,378 software developers and data experts.

Question on the ID attribute of a Tag

Hello:

I saw the following the other day in the id attribute of a div tag
and was wondering if it had any special meaning. Here is the example:

<div id=tag200\top\level_1\level_2>Blah...</div>

Basically I am trying to understand if the slash character influences
the resulting DOM in some way. I can see where *maybe* the slashes
might create a hierarchy of some sort. It could also just be a naming
convention. Any help would be appreciated.

TIA

Brian
Jul 23 '05 #1
3 3827
br******@hotmail.com (Brian) wrote:
<div id=tag200\top\level_1\level_2>Blah...</div>

Basically I am trying to understand if the slash character influences
the resulting DOM in some way.
There is no slash character in the <div> tag. The character "\" is
reverse solidus, commonly called backslash.

The markup is invalid. The id attribute's value must, by HTML syntax
expressed in the DTD, be an ID value, which means that must begin with a
letter ([A-Za-z]) and may be followed by any number of letters, digits
([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods
("."); no other characters are allowed. (Moreover, _if_ the attribute
value were permitted, general rules would require that it be written
inside quotation marks, due to the presence of "\".)
I can see where *maybe* the slashes
might create a hierarchy of some sort.
ID attributes have no internal hierarchic structure in HTML. They are
just strings. Whether those strings will be somehow parsed outside HTML,
e.g. in JavaScript code, is, well, outside HTML.
It could also just be a naming convention.


It's a naming convention, and a wrong one.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 23 '05 #2
Thanks for the response...you are correct in that the posting utlized
a backslash. I intended to use a slash. The example is actually:

<div id='tag200/top/level_1/level_2'>blash...</div>

In general it sounds like a naming convention.

Brian

"Jukka K. Korpela" <jk******@cs.tut.fi> wrote in message news:<Xn*****************************@193.229.0.31 >...
br******@hotmail.com (Brian) wrote:
<div id=tag200\top\level_1\level_2>Blah...</div>

Basically I am trying to understand if the slash character influences
the resulting DOM in some way.


There is no slash character in the <div> tag. The character "\" is
reverse solidus, commonly called backslash.

The markup is invalid. The id attribute's value must, by HTML syntax
expressed in the DTD, be an ID value, which means that must begin with a
letter ([A-Za-z]) and may be followed by any number of letters, digits
([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods
("."); no other characters are allowed. (Moreover, _if_ the attribute
value were permitted, general rules would require that it be written
inside quotation marks, due to the presence of "\".)
I can see where *maybe* the slashes
might create a hierarchy of some sort.


ID attributes have no internal hierarchic structure in HTML. They are
just strings. Whether those strings will be somehow parsed outside HTML,
e.g. in JavaScript code, is, well, outside HTML.
It could also just be a naming convention.


It's a naming convention, and a wrong one.

Jul 23 '05 #3
br******@hotmail.com (Brian) wrote:
The example is actually:

<div id='tag200/top/level_1/level_2'>blash...</div>


It's still invalid, since a solidus (slash) is not permitted in id
attribute values, as I explained.

P.S. Hint on how to quote in Usenet messages:
http://www.xs4all.nl/%7ewijnands/nnq/nquote.html

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 23 '05 #4

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

Similar topics

5
by: Victor Fees | last post by:
I have an XML string in a database that I would like to display using XSLT. All of that works like a champ, but I can't figure out how to embed the XML inside an ASPX page. For example, I have...
3
by: Brian Schroeder | last post by:
Hello Group, I'm quite new to xml, xpath and xslt so I hope I've not overlooked a resource where the answer to my question is. I'll try to give a short example, but in XML everything gets...
10
by: Lars | last post by:
Hi, I need a way to read a numeric field and then increment it by one in such a way that even if two users did this at the exact same time, they would still each get their own unique value. I...
2
by: Pat Richey | last post by:
i'm writing some events that need to be NonSerialized and to get it to work i ended up doing something like: public event OnEventHandler myEvent; because public event OnEventHandler...
11
by: Random | last post by:
I'm confused about the proper use and usefulness of namespaces. I beleive I understand the purpose is so the developer can put classes within namespaces to essentially organize your code. And I...
6
by: dave | last post by:
I really have 2 questions regarding the following xml snippet. The xml is a directory representation. <?xml version="1.0" standalone="yes"?> <FileSystem> <Row> <ID>1</ID> <Name>Root</Name>...
3
by: Tony Johansson | last post by:
Hello! I have two questions about attribute. If you want to associate an attribute with a class you put the attribute just before the class definition. Like this public class myClass
12
by: nyathancha | last post by:
Hi, I have a question regarding best practices in database design. In a relational database, is it wise/necessary to sometimes create tables that are not related to other tables through a...
40
by: brad | last post by:
Will len(a_string) become a_string.len()? I was just reading http://docs.python.org/dev/3.0/whatsnew/3.0.html One of the criticisms of Python compared to other OO languages is that it isn't OO...
4
by: RobG | last post by:
I have always accessed attributes such as disabled using the DOM element property, however I was wondering about implementing a more generic function to get the values of attributes - which of...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.