Hi can anyone see why Check is always false isXmlAttribute in this case?
<cfset isNullCurrencyValue = true>
<cfset CurrencyValue = "">
<cfif isXmlAttribute(structFromParsedXML[d].XmlAttributes["CurrencyValue"]) >
<cfset isNullCurrencyValue = false>
<cfset CurrencyValue = structFromParsedXML[d].XmlAttributes["CurrencyValue"]>
</cfif>
cool, things like this always work in my cfm page
<cfqueryparam value="#structFromParsedXML[d].XmlAttributes["LineDiscountValue"]#" cfsqltype="cf_sql_varchar">
but this is always being set as null:
<cfqueryparam value="#CurrencyValue#" cfsqltype="cf_sql_varchar" null="#isNullCurrencyValue#">
but the xml with CurrencyValue sometimes does not have the attribute compare these:
<NewOrders SupplyMargin="1" SalesMargin="2" LineDiscountName="" LineDiscountValue="0"/>
with
<NewOrders SupplyMargin="1" SalesMargin="2" LineDiscountName="" LineDiscountValue="0" CurrencyValue = 200/>
oh and the struct is beign set like this:
<cfset structFromParsedXML = GetDataFromFeed(parsedXML)>
| <cfscript> | |||
| function GetDataFromFeed(xmlFeed) | |||
| { | |||
| var final = arrayNew(1); | |||
| var i = 1; | |||
| var j = 1; | |||
| var children = arrayNew(1); | |||
| allOrders = XmlSearch(xmlFeed, "ROOT/NewOrders"); | |||
| return allOrders; | |||
| } | |||
| </cfscript> |
nikos101 wrote:
<cfset structFromParsedXML = GetDataFromFeed(parsedXML)>
Then it is actually an array. Hence:
<cfset arrayFromParsedXML = GetDataFromFeed(parsedXML)>
"ROOT/NewOrders"
Remember that the search is case-sensitive. Therefore, use the exact case of the elements root and newOrders.
Look... we need to see:
a) sample XML
b) the code that creates structFromParsedXML
Not an extract of the XML. Not a description of how you get it. The actual XML.
And, similarly, the actual code that creates the variable.
I expect to be able to copy and paste the XML and code you provide, and run it myself here.
--
Adam
North America
Europe, Middle East and Africa
Asia Pacific