Categories | Question details Back To List | ||
Xml query giving the error when the dhtml grid is loaded string strPlaceCode = string.Empty; string strXMLPlace = HttpContext.Current.Server.MapPath("~/XML/Monuments.xml"); string strNavNamePlace = "data"; XQueryNavigatorCollection navcolPlaces = new XQueryNavigatorCollection(); XmlDocument xDocPlace = new XmlDocument(); xDocPlace.Load(strXMLPlace); navcolPlaces.AddNavigator(xDocPlace.CreateNavigator(), strNavNamePlace); string strXQuery = "<root>{FOR $searchPlace in document('data')/data/entrances where $searchPlace/placeName='" + pstrPlaceName.Trim() + "' RETURN $searchPlace/placeId }</root>"; XQueryExpression xexpr = new XQueryExpression(strXQuery); string resultXML = xexpr.Execute(navcolPlaces).ToXml(); DataSet ds = new DataSet(); ds.ReadXml(new StringReader(resultXML)); Error Is ::::---- '(' expected. Maybe you are using a known function name like last, data, text etc as an identifier. For this release , this is not allowed. :::::--- my xml Format is <data> <!-- Table entrances --> <entrances> <id>1</id> <placeId>391</placeId> <placeName>Agra</placeName> <no_of_pax>1</no_of_pax> <monument_name>Taj Mahal</monument_name> <rates_in>BOTH (USD/INR)</rates_in> <closed_on>Friday</closed_on> <usd_entrance>15</usd_entrance> <inr_entrance>20</inr_entrance> <remarks>Rates for foriener details = 15$ for adult and 10$ for child. Night view allowed between 2030 to 0030hrs. maximam 8 batch of 50 pax allowed for the evening duration 30 minute.</remarks> <timing>sunrise to 19:00hrs</timing> <updated_by>amarjeet</updated_by> <updated_at>2005-03-25</updated_at> </entrances> </data> Answer posted by Support on Nov 13, 2008 05:06 The problem is not related to component. >>Maybe you are using a known function name like last, data, >><data> >><entrances> |