Click here to Skip to main content
15,914,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am trying to run this query:
XML
for $p in //Player where $p/Pohlavi = ‘Muž’ order by $p/Tour_Points DESC return $p

Pohlavi is Gender in English and Muž is Man.

... but it throws this error: Stopped at line 1, column 39:
[XPST0003] Comparison is incomplete
.
Column 39 is somewhere here: where $p/Pohlavi = ‘Muž’



In asp.NET aplication it expects something diffrent somewhere.

Could any solve this error and write the correct query? I want to select all players, with Gender Man, ordered by Tour_Points DESC and return all attributes.

Here is an XML:
XML
<DataSet>
  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="NewDataSet">
    <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
      <xs:complexType>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element name="Player">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="Nickname" type="xs:string"/>
                <xs:element name="Jmeno" type="xs:string" minOccurs="0"/>
                <xs:element name="Prijmeni" type="xs:string" minOccurs="0"/>
                <xs:element name="Pohlavi" type="xs:string" minOccurs="0"/>
                <xs:element name="Play_by_Play_Name" type="xs:string" minOccurs="0"/>
                <xs:element name="Role" type="xs:string" minOccurs="0"/>
                <xs:element name="Datum_Registrace" type="xs:dateTime" minOccurs="0"/>
                <xs:element name="Tour_Points" type="xs:int" minOccurs="0"/>
                <xs:element name="Email" type="xs:string" minOccurs="0"/>

...

    <NewDataSet>
      <Player diffgr:id="Player1" msdata:rowOrder="0" diffgr:hasChanges="inserted">
        <Nickname>Dalo</Nickname>
        <Jmeno>Dalibor</Jmeno>
        <Prijmeni>Přibyla</Prijmeni>
        <Pohlavi>Muž</Pohlavi>
        <Play_by_Play_Name>Pribyla</Play_by_Play_Name>
        <Role>uživatel</Role>
        <Datum_Registrace>2012-10-24T20:07:24.247+02:00</Datum_Registrace>
        <Tour_Points>0</Tour_Points>
        <Email>dalibor.pribyla@atlas.cz</Email>
        <Aktivita>1</Aktivita>
      </Player>
      <Player diffgr:id="Player2" msdata:rowOrder="1" diffgr:hasChanges="inserted">
        <Nickname>Doktor</Nickname>
        <Jmeno>Aleš</Jmeno>
        <Prijmeni>Poncza</Prijmeni>
        <Pohlavi>Muž</Pohlavi>
        <Play_by_Play_Name>Poncza</Play_by_Play_Name>
        <Role>uživatel</Role>
        <Datum_Registrace>2012-10-24T20:07:24.25+02:00</Datum_Registrace>
        <Tour_Points>0</Tour_Points>
        <Email>ales.poncza@gmail.com</Email>
        <Aktivita>1</Aktivita>
      </Player>
Posted
Updated 16-Dec-12 1:38am
v2

1 solution

I have solved it, there have to be double quotes!
for $p in //Player where $p/Pohlavi = "Muž" order by $p/Tour_Points descending return $p
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900