Ask a Question related to Coldfusion - Getting Started, Design and Development.
-
Kiriran #1
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
-
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,... -
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... -
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... -
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... -
telltarget doesnt work
Hello, I made a button in flash MX and did the following actionscript on it: on (rollover) { tellTarget ("MC") { gotoAndPlay(2); } } -
Adam Cameron #2
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
-
Adam Cameron #3
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



Reply With Quote

