Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A name was started with an invalid character

Status
Not open for further replies.

anyideas

Programmer
May 2, 2002
127
GB
hi all.

I keep getting the above error when I try using vbscript or javascript.

Has anyone come across this before and is there a solution?

Cheers

Mark
 
Do you know which line in the script this is pointing to? Maybe with a short snippet of your code we could help.

~Deeba~
 
The error refers to an XML element name. They all have to start with a valid character, other that whitespace and other characters specified in the XML SPEC from W3C. You'll get such an error on:
< Element> </ Element>

Actually, you can use only letters or : and _ to begin element names, other way than with a letter. So
<:element> and <_element> is valid, but <!element> is not! [red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro
 
Hi.. I'm getting this same error in my DTD when I have an Attribute value = &quot;11&quot; .. It's type ID.. and I am pretty sure taht you can start an attribute value with a number.. here is my DTD Code..

<!DOCTYPE catalog [
<!ELEMENT catalog (cat+)>
<!ELEMENT cat (product,category,options)>
<!ATTLIST cat id ID #IMPLIED &quot;&quot;>
<!ELEMENT product (productheader,producttitle,img+,product_description,price)>
<!ELEMENT productheader (#PCDATA)>
<!ELEMENT producttitle (#PCDATA)>
<!ELEMENT img EMPTY>
<!ATTLIST img src CDATA #REQUIRED>
<!ELEMENT product_description (#PCDATA)>
<!ELEMENT price (#PCDATA)>
<!ELEMENT category (name,img+)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT img2 EMPTY>
<!ATTLIST img2 src CDATA #REQUIRED>
<!ELEMENT options EMPTY>

Any ideas??? Thanks.. Joss
 
You can't start the name of things (elements, attributes, etc) with a number. It must be a letter, or one of the W3C acceptable characters (colon :, underscore _ ), like Nosferatu said.

Chip H.
 
Okay... I knew that you had to start element tags with w3c aceptable chars... but whats the point of an ID type atrribute.. if you cant use numbers... why not just use a tag name... seems really dumb..

Joss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top