XMLSearch. doesnt work

Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default XMLSearch. doesnt work

    hi
    i'm trying to use xmlsearch function but for some strange reasons it returns
    only an empty array
    here the xml file

    <?xml version="1.0" encoding="iso-8859-1" ?>
    - <TournList
    xmlns="http://www.swissgolfnetwork.ch/xmlschemas/XMLTournList.xsd">
    - <Version>
    <DokumentName>XMLTournList.xml</DokumentName>
    <DokumentVersion>1.0</DokumentVersion>
    <DokumentSender>SGN</DokumentSender>
    <DokumentDestination>Unknown</DokumentDestination>
    <DokumentDateCreate>23.05.2005 16:27</DokumentDateCreate>
    <ClubID>410053</ClubID>
    </Version>
    + <TOURNAMENT>
    - <TOURNAMENT>
    <TOURNAMENT_NBR>1273</TOURNAMENT_NBR>
    <STARTDATE>19.03.2005</STARTDATE>
    <ENDDATE>19.03.2005</ENDDATE>
    <TITLE>Coupe du Restaurant</TITLE>
    <TYPE>Einzel - Stableford; 18 L?cher</TYPE>
    <REGSTARTDATE>01.01.2001</REGSTARTDATE>
    <REGENDDATE>19.03.2005 11:00:00</REGENDDATE>
    <NBRONLINEREGSLEFT>0</NBRONLINEREGSLEFT>
    <WWWLINK>Das Turnier wurde abgesagt.</WWWLINK>
    <NBRHOLES>18</NBRHOLES>
    <MAXHDCP>36</MAXHDCP>
    <NBRPLAYERSPERTEAM>1</NBRPLAYERSPERTEAM>
    <PRIZECLASS1>Brutto</PRIZECLASS1>
    <PrizeClass2>Netto HCP 0.0 bis 18.5</PrizeClass2>
    <PrizeClass3>Netto HCP 18.6 bis 36.0</PrizeClass3>
    </TOURNAMENT>
    - <TOURNAMENT>
    <TOURNAMENT_NBR>1272</TOURNAMENT_NBR>
    <STARTDATE>22.03.2005</STARTDATE>
    <ENDDATE>22.03.2005</ENDDATE>
    <TITLE>Ladies Er?ffnungsturnier</TITLE>
    <TYPE>2er Scramble - Stableford; 18 L?cher</TYPE>
    <REGSTARTDATE>22.03.2004 11:00:00</REGSTARTDATE>
    <REGENDDATE>22.03.2005 11:00:00</REGENDDATE>
    <STARTLIST>Y</STARTLIST>
    <RESULTLIST>Y</RESULTLIST>
    <NBRONLINEREGSLEFT>0</NBRONLINEREGSLEFT>
    <NBRHOLES>18</NBRHOLES>
    <MAXHDCP>PR</MAXHDCP>
    <NBRPLAYERSPERTEAM>1</NBRPLAYERSPERTEAM>
    <PRIZECLASS1>Netto</PRIZECLASS1>
    </TOURNAMENT>
    - <TOURNAMENT>
    <TOURNAMENT_NBR>1275</TOURNAMENT_NBR>
    <STARTDATE>28.03.2005</STARTDATE>
    <ENDDATE>28.03.2005</ENDDATE>
    <TITLE>Osterturnier</TITLE>
    <TYPE>Einzel - Stableford; 18 L?cher, bis 1. Runde</TYPE>
    <REGSTARTDATE>28.03.2004 11:00:00</REGSTARTDATE>
    <REGENDDATE>28.03.2005 11:00:00</REGENDDATE>
    <STARTLIST>Y</STARTLIST>
    <RESULTLIST>Y</RESULTLIST>
    <NBRONLINEREGSLEFT>0</NBRONLINEREGSLEFT>
    <WWWLINK>Der Platz ist von 8.00 bis 13.30 Uhr gesperrt.</WWWLINK>
    <NBRHOLES>18</NBRHOLES>
    <MAXHDCP>30</MAXHDCP>
    <NBRPLAYERSPERTEAM>1</NBRPLAYERSPERTEAM>
    <PRIZECLASS1>Brutto</PRIZECLASS1>
    <PrizeClass2>Netto HCP Pro bis 15.0</PrizeClass2>
    <PrizeClass3>Netto HCP 15.1 bis --</PrizeClass3>
    </TOURNAMENT>
    </TournList>


    so what i'm trying to do is search for the nodes in <TOURNAMENT>
    my script looks like this

    <cfset xmlDoc = XmlParse(CFHTTP.FileContent) />
    <cfset finder = xmlsearch(xmlDoc, "/TournList/TOURNAMENT/TOURNAMENT_NBR") />
    <cfdump var="#finder#">

    all i get is a empty array
    or isnt it possible to search in this xml file?

    thanks
    k

    Kiriran Guest

  2. Similar Questions and Discussions

    1. Help my flashplayer doesnt work
      Hey there, i desperately need help, no websites that have flash programmes will work on my internet as it says i need the latest flash player,...
    2. flash app doesnt work
      hi - i want to try out the new game kdice on http://kdice.com but as i go to this adress, the flash application doesnt come up. i tried it...
    3. Flash Doesnt Work
      I had Macromedia Flash 7 before which worked perfectly fine. Then some websites stopped working and told me to get Macromedia Flash 7(which I...
    4. CDONTS doesnt work always
      I am using CDONTS to send mail to the user from my ASP application. However, the code doenst works all the time. I am able to get mails but nothing...
    5. telltarget doesnt work
      Hello, I made a button in flash MX and did the following actionscript on it: on (rollover) { tellTarget ("MC") { gotoAndPlay(2); } }
  3. #2

    Default Re: XMLSearch. doesnt work

    Take the xmlns attribute out of your root node and it works. This might
    not be possible for you, depending on circumstance, but that seems to be
    what's stuffing xmlSearch().
    --

    Adam
    Adam Cameron Guest

  4. #3

    Default Re: XMLSearch. doesnt work

    Further to this, if you specify a prefix, thus:
    <TournList
    xmlns:x="http://www.swissgolfnetwork.ch/xmlschemas/XMLTournList.xsd">

    It seems to work OK too.

    Abbreviated test rig:
    <cfxml variable="x">
    <TournList
    xmlns:x="http://www.swissgolfnetwork.ch/xmlschemas/XMLTournList.xsd">
    <TOURNAMENT>
    <TOURNAMENT_NBR>1273</TOURNAMENT_NBR>
    </TOURNAMENT>
    <TOURNAMENT>
    <TOURNAMENT_NBR>1272</TOURNAMENT_NBR>
    </TOURNAMENT>
    <TOURNAMENT>
    <TOURNAMENT_NBR>1275</TOURNAMENT_NBR>
    </TOURNAMENT>
    </TournList>
    </cfxml>

    <cfset finder = xmlsearch(x, "/TournList/TOURNAMENT/TOURNAMENT_NBR")>
    <cfdump var="#finder#">

    --

    Adam
    Adam Cameron Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139