You are here: Re: Help me with a regular expression for PHP « PHP Programming Language « IT news, forums, messages
Re: Help me with a regular expression for PHP

Posted by John Dunlop on 10/30/06 09:21

BKDotCom:

> Pedro Graca wrote:
>
> > The following line is perfectly valid HTML (I think in any version)
> >
> > <input type="text" name="x><y" id="xy">

Yes, yes it is. In any version.

> I would have to disagree

Run it through a validator. You'll find it's valid.

The 'name' attribute is defined as CDATA, so pretty much anything goes
if the attribute value is quoted, including literal less-than and
greater-than signs.

> <input type="text" name="x> is invalid: no closing quote around
> name value

Yes, as a start-tag _in itself_. That wasn't Pedro's example though;
his example was the whole

| <input type="text" name="x><y" id="xy">

> <y" id="xy"> is invalid. y" isn't a valid cname

As a tag in itself, it is invalid HTML, yes. It isn't invalid as part
of the example above.

> (only alphanumeric?)

Generic identifiers (aka, element type names) must begin with upper- or
lowercase letters.

> if you want 'x><y' as a value you'd need to use name="x&gt;&lt;y"

No. You only need to replace '<' and '>' with references where they
would be understood as something other than character data.

--
Jock

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация