Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Gtting error while reading XML

Gtting error while reading XML

Scheduled Pinned Locked Moved ASP.NET
helpcsharpasp-netdotnetdesign
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nithin Krishna
    wrote on last edited by
    #1

    All, I am getting follwing error while reading my XML file directly returned from web service. This occurs normally when XML have some misplaced node, but my XML is returned from webservice with few chances to have node errors. Can any one help me regarding this problem. My error page is: Server Error in '/portal' Application.-------------------------------------------------------------------------------- This is an unexpected token. The expected token is 'NAME'. Line 778, position 626. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Xml.XmlException: This is an unexpected token. The expected token is 'NAME'. Line 778, position 626. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. And my stack trace is: [XmlException: This is an unexpected token. The expected token is 'NAME'. Line 778, position 626.] System.Xml.XmlTextReader.SetAttributeValues() +323 System.Xml.XmlTextReader.ParseElement() +138 System.Xml.XmlTextReader.Read() +94 System.Xml.XmlValidatingReader.ReadNoCollectTextToken() +38 System.Xml.XmlValidatingReader.Read() +14 System.Xml.XmlLoader.LoadCurrentNode() +612 System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) +49 System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) +102 System.Xml.XmlDocument.Load(XmlReader reader) +72 System.Xml.XmlDocument.LoadXml(String xml) +163 AI.Portal.Web.UI.RailBooking.ProcessGet() AI.Portal.Web.UI.BaseDialog.ProcessRequest() AI.Portal.Web.UI.HttpHandler.ProcessRequest(HttpContext context) System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87 I am using Microsoft .NET Framework Version:1.1.4322.2407; ASP.NET Version:1.1.4322.2407 Thanks in advance for any help. Anand

    C V N 3 Replies Last reply
    0
    • N Nithin Krishna

      All, I am getting follwing error while reading my XML file directly returned from web service. This occurs normally when XML have some misplaced node, but my XML is returned from webservice with few chances to have node errors. Can any one help me regarding this problem. My error page is: Server Error in '/portal' Application.-------------------------------------------------------------------------------- This is an unexpected token. The expected token is 'NAME'. Line 778, position 626. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Xml.XmlException: This is an unexpected token. The expected token is 'NAME'. Line 778, position 626. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. And my stack trace is: [XmlException: This is an unexpected token. The expected token is 'NAME'. Line 778, position 626.] System.Xml.XmlTextReader.SetAttributeValues() +323 System.Xml.XmlTextReader.ParseElement() +138 System.Xml.XmlTextReader.Read() +94 System.Xml.XmlValidatingReader.ReadNoCollectTextToken() +38 System.Xml.XmlValidatingReader.Read() +14 System.Xml.XmlLoader.LoadCurrentNode() +612 System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) +49 System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) +102 System.Xml.XmlDocument.Load(XmlReader reader) +72 System.Xml.XmlDocument.LoadXml(String xml) +163 AI.Portal.Web.UI.RailBooking.ProcessGet() AI.Portal.Web.UI.BaseDialog.ProcessRequest() AI.Portal.Web.UI.HttpHandler.ProcessRequest(HttpContext context) System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87 I am using Microsoft .NET Framework Version:1.1.4322.2407; ASP.NET Version:1.1.4322.2407 Thanks in advance for any help. Anand

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I'd say there is an unexpected token, which is 'NAME'. I'm not sure what else you'd like us to tell you. You haven't posted code or anything, so you can't want to know how to fix the error ? Have you looked at the XML that causes this error ?

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      1 Reply Last reply
      0
      • N Nithin Krishna

        All, I am getting follwing error while reading my XML file directly returned from web service. This occurs normally when XML have some misplaced node, but my XML is returned from webservice with few chances to have node errors. Can any one help me regarding this problem. My error page is: Server Error in '/portal' Application.-------------------------------------------------------------------------------- This is an unexpected token. The expected token is 'NAME'. Line 778, position 626. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Xml.XmlException: This is an unexpected token. The expected token is 'NAME'. Line 778, position 626. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. And my stack trace is: [XmlException: This is an unexpected token. The expected token is 'NAME'. Line 778, position 626.] System.Xml.XmlTextReader.SetAttributeValues() +323 System.Xml.XmlTextReader.ParseElement() +138 System.Xml.XmlTextReader.Read() +94 System.Xml.XmlValidatingReader.ReadNoCollectTextToken() +38 System.Xml.XmlValidatingReader.Read() +14 System.Xml.XmlLoader.LoadCurrentNode() +612 System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) +49 System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) +102 System.Xml.XmlDocument.Load(XmlReader reader) +72 System.Xml.XmlDocument.LoadXml(String xml) +163 AI.Portal.Web.UI.RailBooking.ProcessGet() AI.Portal.Web.UI.BaseDialog.ProcessRequest() AI.Portal.Web.UI.HttpHandler.ProcessRequest(HttpContext context) System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87 I am using Microsoft .NET Framework Version:1.1.4322.2407; ASP.NET Version:1.1.4322.2407 Thanks in advance for any help. Anand

        V Offline
        V Offline
        vkrajeesh
        wrote on last edited by
        #3

        Hi Anand, the line numbers mentioned in the error message might not be exact, but check if there are elements in the xml file having multiple attributes but without space between each attribute & value pair i.e. some spacing error.

        N 1 Reply Last reply
        0
        • V vkrajeesh

          Hi Anand, the line numbers mentioned in the error message might not be exact, but check if there are elements in the xml file having multiple attributes but without space between each attribute & value pair i.e. some spacing error.

          N Offline
          N Offline
          Nithin Krishna
          wrote on last edited by
          #4

          Thanks Christian & Rajeesh, Thanks for answering. Part of my xml is like this: <termsAndConditions>Can not be sold to or used by residents of Europe, the Russian Federation and Turkey. Travel on the national rail networks of 20 European countries (Austria, Belgium, Croatia, Denmark, Finland, France, Germany, Greece, Hungary, Italy, Luxembourg, the Netherlands, Norway, Portugal, Republic of Ireland, Romania, Slovenia, Spain, Sweden and Switzerland). VALIDITIES Eurail Global Pass available for 15 days, 21 days, 1 month, 2 months or 3 months of consecutive travel. Flexipass available for 10 or 15 daysof travel in a 2 month period. AGE / SAVER DISCOUNT Saver pass available for 2 or more passengers travelling together. Youth discount: for passengers under 26 (available in 2nd Class only) Children 4-11: half-adult fare Children under 4: free (except ifa reservation for a separate seat/bed is required). OTHER RULES 7:00 p.m. rule applies Free map and timetable must be delivered to customer with purchase Pass must be validated within 6 months of issue. REFUND POLICY A 15% cancellation penalty appliesto completely unused and unvalidated passes returned within 1 year of issue date. Partially used, lost or stolen passes are non-refundable except as covered by the Rail Protection Plan (for North America only). Please refer to general conditions of use for more information</termsAndConditions> <countriesCovered> <country> <name>AUSTRIA</name> <code>AT</code> </country> <country> <name>SPAIN</name> <code>ES</code> </country> <country> <name>SWEDEN</name> <code>SE</code> </country> <country> <name>SWITZERLAND</name> <code>CH</code> </country> <country> <name>BELGIUM</name> <code>BE</code> </country> <country> <name>LUXEMBOURG</name> <code>LU</code> </country> <country> <name>NETHERLANDS</name> <code>NL</code> </country> <country> <name>REPUBLIC OF IRELAND</name> </country> <country> <name>ROMANIA</name> <code>RO</code> </country> <country> <name>DENMARK</name> <code>DK</code> </country> <country> <name>FINLAND</name> <code>FI</code> </country> <coun

          1 Reply Last reply
          0
          • N Nithin Krishna

            All, I am getting follwing error while reading my XML file directly returned from web service. This occurs normally when XML have some misplaced node, but my XML is returned from webservice with few chances to have node errors. Can any one help me regarding this problem. My error page is: Server Error in '/portal' Application.-------------------------------------------------------------------------------- This is an unexpected token. The expected token is 'NAME'. Line 778, position 626. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Xml.XmlException: This is an unexpected token. The expected token is 'NAME'. Line 778, position 626. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. And my stack trace is: [XmlException: This is an unexpected token. The expected token is 'NAME'. Line 778, position 626.] System.Xml.XmlTextReader.SetAttributeValues() +323 System.Xml.XmlTextReader.ParseElement() +138 System.Xml.XmlTextReader.Read() +94 System.Xml.XmlValidatingReader.ReadNoCollectTextToken() +38 System.Xml.XmlValidatingReader.Read() +14 System.Xml.XmlLoader.LoadCurrentNode() +612 System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) +49 System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) +102 System.Xml.XmlDocument.Load(XmlReader reader) +72 System.Xml.XmlDocument.LoadXml(String xml) +163 AI.Portal.Web.UI.RailBooking.ProcessGet() AI.Portal.Web.UI.BaseDialog.ProcessRequest() AI.Portal.Web.UI.HttpHandler.ProcessRequest(HttpContext context) System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87 I am using Microsoft .NET Framework Version:1.1.4322.2407; ASP.NET Version:1.1.4322.2407 Thanks in advance for any help. Anand

            N Offline
            N Offline
            Nithin Krishna
            wrote on last edited by
            #5

            To, Christian, Rajeesh and all, Regarding to the current thread, I am currently working on this problem and found 1 intresting point. The point is I am getting this error only when my code is uploaded on the server. The same code, I have uploaded, is working smoothly on my local IIS. I think this is related to seme XML version problem?????? please help me. Thanks. Anand

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups