Results 1 to 20 of 20

Thread: A name was started with an invalid character

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2005
    Posts
    840

    Resolved A name was started with an invalid character

    first line of the code below cause some error "A name was started with an invalid character".............what is the error??

    Code:
    <% Response.ContentType = "application/xml" %>
    
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml:stylesheet type = "text/xsl" href ="NBAGuideTransform.xsl"?>
    
    <TVSchedule>
    	<TVGuide>
    <%
    
    Dim adoConnect
    Dim adoRecordset
    
    Set adoConnect = Server.CreateObject("ADODB.Connection")
    
    adoConnect.open = "Provider=Microsoft.Jet.OLEDB.4.0;" & "DataSource=C:\NBATVGuide.mdb"
    
    Set adoRecordset = adoConnect.Execute("Select ProgramTitle, ProStartTime from tblNBASchedule order by ProStartTime")
    
    Do While Not adoRecordset.EOF
    	Response.Write "<ProgramTime>" + adoRecordset("ProStartTime") + "</ProgramTime>"
    	Response.Write "<ProgramTitle>" + adoRecordset("ProgramTitle") + "</ProgramTitle>"
    	adoRecordset.MoveNext
    Loop
    
    adoRecordset.Close
    
    set adoRecordset = Nothing
    
    %>
    	</TVGuide>
    </TVschedule>
    Last edited by kenny_oh; Dec 9th, 2005 at 08:59 AM.

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: A name was started with an invalid character

    Do you mean this line?

    <% Response.ContentType = "application/xml" %>
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2005
    Posts
    840

    Re: A name was started with an invalid character

    yes!! what is the mistake?

  4. #4
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: A name was started with an invalid character

    There is no mistake. If you are using Notepad to edit the file, make sutre that you save it in ANSI and not Unicode.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2005
    Posts
    840

    Re: A name was started with an invalid character

    ya...i'm save in ANSI.....but still cannot...

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2005
    Posts
    840

    Re: A name was started with an invalid character

    "A name was started with an invalid character"

    this line error is it mean i'm using some invalid character?

  7. #7
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: A name was started with an invalid character

    What is giving you the error? ASP or the XML viewer you are using. I think you may have to remove all white space before the first tag, like this:
    Code:
    <% Response.ContentType = "application/xml" %><?xml version="1.0" encoding="UTF-8"?>
    <?xml:stylesheet type = "text/xsl" href ="NBAGuideTransform.xsl"?>
    
    <TVSchedule>
    	<TVGuide>
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2005
    Posts
    840

    Re: A name was started with an invalid character

    i'm using Internet Explorer to view.............i remove the white space but still have the same error!

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2005
    Posts
    840

    Re: A name was started with an invalid character

    error message:

    Code:
    The XML page cannot be displayed 
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. 
    
    
    --------------------------------------------------------------------------------
    
    A name was started with an invalid character. Error processing resource 'http://localhost/ASP_Sample.aspx'. Line 1, Positi...
    
    <% Response.ContentType = "application/xml" %>
    -^

  10. #10
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: A name was started with an invalid character

    Well you have ASP code in the XML file, you need to have that executed by a webserver first. Internet Explorer doesn't execute ASP code. You need to upload it to a web server with ASP and view in the browser from there.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2005
    Posts
    840

    Re: A name was started with an invalid character

    how about using Apache web server?

  12. #12
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: A name was started with an invalid character

    No, only IIS.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  13. #13

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2005
    Posts
    840

    Re: A name was started with an invalid character

    put the asp file in the wwwroot and then how to view the file?

    i dont know how to use iis server?

  14. #14
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: A name was started with an invalid character

    Make sure it has been started and go to http://localhost/file_name.xml
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  15. #15

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2005
    Posts
    840

    Re: A name was started with an invalid character

    what u mean "has been started"??

  16. #16
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: A name was started with an invalid character

    Goto Internet Information Services under computer management and check that the IIS web service has been started.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  17. #17

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2005
    Posts
    840

    Re: A name was started with an invalid character

    service and application there got IIS, is it mean started?

  18. #18

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2005
    Posts
    840

    Re: A name was started with an invalid character

    i have change the IIS port to 8585 and the IIS have started.......and then i put the ASP_Sample.aspx file in the wwwroot...............

    in the web browser there i type "http://localhost:8585/ASP_Sample.aspx

    but display error message "the page cannot displayed"

    what is the problem?

  19. #19
    New Member
    Join Date
    Jun 2008
    Location
    http://www.GlobalGuideLine.com
    Posts
    1

    Smile Getting same error "a name was started with an invalid character"

    Hi i am also getting the same error but when i access my pages using localhost its opened successfully but while accessing with IP address its giving error have you any idea why i am getting this error.
    Ali.

  20. #20
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: A name was started with an invalid character

    You'll only get that error if you're running the page against a server that doesn't have ASP installed or has ASP 'locked down'. Look under the web services extension in IIS.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width