Hello:
I am having problems with the flow control of results obtained
when retrieving XML from a url.
<!---- Example ----->
<CF_XMLDatasource Name="getsome_xml"
Type="URL"
URL="http://www.somesite.com?variable1=data1&...etc..."
>
<CF_XMLQuery Datasource="getsome_xml" Name="qry_xml" Type="SQL">
SELECT *
FROM getsome_xml
</CF_XMLQuery>
Now, the columns of the XML datasource differ in each URL, as the
variables passed to the server change. In my <cfoutput> I must determine
whether certain columns exist or not.
Let's say the columns obtained can be either "Root_Author" or
"Root_Model". Here's the output:
<table>
<tr>
<cfoutput query="qry_xml">
<CFIF isDefined("Root_Author")>
<!--- I also tried constructing the above like:
<CFIF isDefined("qry_xml.Root_Author")> --->
<td>Author: #Root_Author#</td>
</CFIF>
<CFIF isDefined("Root_Model")>
<td>Model: #Root_Model#</td>
</CFIF>
... And so on. I have in my code up to 5 similar instances of
CFIF.
Some queries give me errors, and other don't and I cannot see
what's wrong. I seem to be getting random errors on caused
(mostly) by the last column to be processed by an CFIF tag.
The error output looks like below.
My comments are preceded by 2 fwd slashes //
-------------------------------------
Error Diagnostic Information
An error occurred while evaluating the expression:
valuetoput = replace(listgetat(attvaluelist,counter,'|'),'_nothing_','','one');
QuerySetCell(xmlq,i,valuetoput);
counter = counter + 1;
Error near line 1, column 94.
// This probably refers to the original XML as opposed to my CFM document ?
--------------------------------------------------------------------------------
The column name (Root_SomeVariable) that you have specified is invalid.
Either this query does not have a column with that name, or you have specified
one of the reserved column names, e.g., RecordCount
The error occurred while processing an element with a general identifier
of (CFSCRIPT), occupying document position (1:10415) to (1:10424).
----------------------
Any ideas what can be wrong? Thanks in advance.
--
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
-----------------------+
cf-xml mailing list
http://torchbox.com/xml/list.cfm