Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
mullerina #1
xmlParse(cfhttp.filecontent)
I am using coldfusion to read rss feed. I was wondering why
xmlParse(cfhttp.filecontent) works in one file residing in test server and
fails to return valid xml document object when i put the same code in another
server file. Can any one suggest if i need to check with server set up to use
xmlParse() function. ( <cfdump cfhttp> returned the xml tree with no
problem, it just fails at the point where i try to get the xml document object
, which turns out to be null),
Your prompt help would be highly appreciated as this is an urgent matter for
my project .
moeller
mullerina Guest
-
XMLParse and XMLSearch
I have the following code: a variable "x" that contains an XML string; if I do an XMLParse on this variable, it works (cfdump shows me the xml... -
XMLParse Error works in 6.1 but not 7
I have a chunk of code that works on my 6.1 server, but not on my MX 7 server.... wtf? HELP! Thanks, Dave :+) -
XmlParse Problems
Hello, I have searched everywhere and tried everything and cannot fix the problem. I continually get the following error when trying to use the... -
FILECONTENT error
I have the following code that works in CF 5 but I'm getting an error when trying to run the same thing in MX. The error is... -
XmlParse Delay capabilities in 7
I am trying to set a delay with the XMLParse function available only in 7.0. I set the XMLParse function as follows: <cfset xmlQuery =... -
rogben #2
Re: xmlParse(cfhttp.filecontent)
You'll need to supply the URL of both feeds. It's probably a matter of differing server configs, but I'll need to be able to access them both to know for sure.
rogben Guest
-
mullerina #3
Re: xmlParse(cfhttp.filecontent)
here is an excerpt of my code:
<cfset urlAddress="http://www.uc.edu/p/public/news/med-rss.xml">
<cfhttp url="#urlAddress#" method="GET" throwonerror="yes" resolveurl="yes"/>
<!---validation flag --->
<cfset XMLVALIDATION = true>
<cftry>
<cfset fileCont= trim(cfhttp.FileContent)>
<!---create the xml document object--->
<cfset xmlDoc = xmlParse(fileCont, false)>
----
why does this works in one file, say fil1.cmf and does not when i put
same code in onother file, index.cmf ?
Than you for your help and time.
mullerina Guest
-
Adam Cameron #4
Re: xmlParse(cfhttp.filecontent)
> <cfset xmlDoc = xmlParse(fileCont, false)>
Is the content returned from requesting index.cmf valid XML?> ----
> why does this works in one file, say fil1.cmf and does not when i put
> same code in onother file, index.cmf ?
--
Adam
Adam Cameron Guest
-
mullerina #5
Re: xmlParse(cfhttp.filecontent)
As a matter of fact, it is the same feed. i am using the same url in both, and xml is valid.
Thank you,
mullerina Guest
-
Adam Cameron #6
Re: xmlParse(cfhttp.filecontent)
OK.
What's the actual error msg?
--
Adam
Adam Cameron Guest
-
mullerina #7
Re: xmlParse(cfhttp.filecontent)
Erro i get if i ignore the try...catch exception is ...... Element XMLROOT is
undefined in XMLDOC. Also, <cfdump var="#xmlDoc#"> is null. But this same
code saved in other cf project works fine.
here is some more excrept of my code ....
<cfset XMLVALIDATION = true>
<cftry>
<cfset fileCont= trim(cfhttp.FileContent)>
<!---create the xml document object--->
<cfset xmlDoc = xmlParse(fileCont, false)>
<cfcatch type="any">
<!---if the doc retrieved in cfhttp is not valid setvalidation flag to false
--->
<cfset XMLVALIDATION = true>
</cfcatch>
</cftry>
<cfif XMLVALIDATION>
<cfset XMLRoot=xmlDoc.xmlRoot>
<!--- looping through the items collection --->
<cfset numItems=arrayLen(XMLRoot.item)>
<cfloop index="i" from="1" to = "#numItems#">
mullerina Guest
-
Adam Cameron #8
Re: xmlParse(cfhttp.filecontent)
> Erro i get if i ignore the try...catch exception is ...... Element XMLROOT is
OK, that's being caused by this line:> undefined in XMLDOC.
<cfset XMLRoot=xmlDoc.xmlRoot>
Get rid of the try/catch stuff. What error - if any - is being thrown by
the xmlParse() call.
Yet in the same failing code you can see a valid XML doc if you <cfdump> Also, <cfdump var="#xmlDoc#"> is null. But this same
> code saved in other cf project works fine.
>
> <cfset fileCont= trim(cfhttp.FileContent)>
> <cfset xmlDoc = xmlParse(fileCont, false)>
var="#fileCont#">?
It shouldn't matter, but what are the version and build numbers of the CF
servers?
--
Adam
Adam Cameron Guest



Reply With Quote

