473,320 Members | 2,092 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,320 software developers and data experts.

System.Xml.XPath.XPathException: 'xxxxx' has an invalid token

I have created XML files using BCP in SQL with FOR XML AUTO, ELEMENTS option.

When I try to databind for XML file to a GridView in ASP.NET, I get an error " 'd/Commodity Description' has an invalid token".

All I did was drag a GridView and selected the datasource as XML file. The XPath expression was selected automatically as "d/Commodity Description".

I am not sure if this is an XML question or ASP.NET. I would appreciate if any XML pro can tell me if I the XML file needs to be created with a different option or if it needs to be modified. Any help is appreciated.

I am not sure if its normal for the XML file to have Numeric values for special characters for column names. If you open the XML file below, you will notice that the space, (, %, ) characters are converted to _x0020_, _x0028_, _x0025_, _x0029_.

The XML file can be viewed at this link

The error can be viewed at this link
Aug 31 '07 #1
1 16178
jkmyoung
2,057 Expert 2GB
The invalid token is definitely the space in the name 'Commodity Description'.
Is it possible for you to change it to 'Commodity_x0020_Description' ?

Also, thanks! I always wondered which program those _x0020_ names came from.
Aug 31 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: mike p. | last post by:
I have a docbook xml file, and am using standard docbook 1.61.3 xsl stylesheets to do xhtml transform. Transform works fine when using MSXML. When I try to do the following using asp.net 1.1: ...
1
by: Hollywood | last post by:
I have the following XSD created in VS.NET 2003: <?xml version="1.0" encoding="utf-8" ?> <xs:schema id="ReferralSchama" targetNamespace="http://test.org/Referral"...
5
by: laks | last post by:
Hi I have the following xsl stmt. <xsl:for-each select="JOB_POSTINGS/JOB_POSTING \"> <xsl:sort select="JOB_TITLE" order="ascending"/> This works fine when I use it. But when using multiple...
4
by: David Thielen | last post by:
I have the following xml: <root> <name>abc "123" xyz</name> </root> When I get an XPathNavigator to root and then call navigator.Evaluate("name = \"abc \\\"123\\\" xyz"), I get an...
3
by: orit | last post by:
I have the following xml: <?xml version="1.0" ?> <course> <globalProperties> <externalMetadata> <source>ADL</source> <model>ADL SCORM 1.0</model> </externalMetadata> </globalProperties>
2
by: =?Utf-8?B?RGlmZmlkZW50?= | last post by:
Hello All, I am trying to construct an XPath query against an XML document, for a requirement that I have. Below is the XML fragment: <SUBMISSIONS> <SUBMISSION YEAR="2004"> <MONTH...
1
by: alien_attack | last post by:
I have the a repeater which is databound to an XmlDatasource. Inside the repeater is a Label as follows: <asp:Label ID="lbl" runat="server" Text='<%# XPath("Asset_Metadata/@Value")%>' /> ...
2
by: arunairs | last post by:
Hi, Is there a way of validating and XPath? In this case , I am accepting an XPath from the user and I need to validate the XPath syntax. Is there a regular expression available that anyone can...
2
by: Lan Mind | last post by:
Hello again everybody, My page: http://www.dockhawk.com/ I'm trying to implement some "session security" PHP script mentioned in the "Cross-site request forgery" section of this tutorials...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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...

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.