cottyengland
asked on
Title: CFMX 7 converting XML input stream to query object
How can I convert this into a query object?
<ActiveContracts Contract="SP010000D0347" DeliveryOrder="0126" CLIN="0034AA" Qty="144" UnitOfIssue="PR" NSN="8405010760772" DeliveryDate="" ProjectCode="" Requisition=" " RequisitionSuffix="" ShipToDoDAAC="UY3246" DistrCode="" PriorityCode="" AwardDate="01/01/2003" FastPayCode="N" AdminOffice="S0701A" UnitPrice="12.00000" QtyVarianceAllowed=".00000 " InspectionPoint="S" AcceptancePoint="S" FOBPoint="D" DiscountCode="0000" PayOffice="SC0100" GFMUnitPrice=".00000" BailmentCode="" BuyerName="" BuyerPhone="" BuyerEmail="" CaseLotQty="12"/>
Thank You
<ActiveContracts Contract="SP010000D0347" DeliveryOrder="0126" CLIN="0034AA" Qty="144" UnitOfIssue="PR" NSN="8405010760772" DeliveryDate="" ProjectCode="" Requisition=" " RequisitionSuffix="" ShipToDoDAAC="UY3246" DistrCode="" PriorityCode="" AwardDate="01/01/2003" FastPayCode="N" AdminOffice="S0701A" UnitPrice="12.00000" QtyVarianceAllowed=".00000
Thank You
ASKER
YEs it is but how do I parse more than 1 record.. for example
<ActiveContracts Contract="SP010000D0347" DeliveryOrder="0126" CLIN="0034AA" Qty="144" UnitOfIssue="PR" NSN="8405010760772" DeliveryDate="" ProjectCode="" Requisition=" " RequisitionSuffix="" ShipToDoDAAC="UY3246" DistrCode="" PriorityCode="" AwardDate="01/01/2003" FastPayCode="N" AdminOffice="S0701A" UnitPrice="12.00000" QtyVarianceAllowed=".00000 " InspectionPoint="S" AcceptancePoint="S" FOBPoint="D" DiscountCode="0000" PayOffice="SC0100" GFMUnitPrice=".00000" BailmentCode="" BuyerName="" BuyerPhone="" BuyerEmail="" CaseLotQty="12"/>
ActiveContracts Contract="SP010000D0347" DeliveryOrder="0126" CLIN="0034AA" Qty="144" UnitOfIssue="PR" NSN="8405010760772" DeliveryDate="" ProjectCode="" Requisition=" " RequisitionSuffix="" ShipToDoDAAC="UY3246" DistrCode="" PriorityCode="" AwardDate="01/01/2003" FastPayCode="N" AdminOffice="S0701A" UnitPrice="12.00000" QtyVarianceAllowed=".00000 " InspectionPoint="S" AcceptancePoint="S" FOBPoint="D" DiscountCode="0000" PayOffice="SC0100" GFMUnitPrice=".00000" BailmentCode="" BuyerName="" BuyerPhone="" BuyerEmail="" CaseLotQty="12"/>
I see the cfloop collecting the data elements.... where or how would you use cfloop to loop through "ActiveContracts". I could have as many as 100 seperate "ActiveContracts" in an XML.
Thanks
<ActiveContracts Contract="SP010000D0347" DeliveryOrder="0126" CLIN="0034AA" Qty="144" UnitOfIssue="PR" NSN="8405010760772" DeliveryDate="" ProjectCode="" Requisition=" " RequisitionSuffix="" ShipToDoDAAC="UY3246" DistrCode="" PriorityCode="" AwardDate="01/01/2003" FastPayCode="N" AdminOffice="S0701A" UnitPrice="12.00000" QtyVarianceAllowed=".00000
ActiveContracts Contract="SP010000D0347" DeliveryOrder="0126" CLIN="0034AA" Qty="144" UnitOfIssue="PR" NSN="8405010760772" DeliveryDate="" ProjectCode="" Requisition=" " RequisitionSuffix="" ShipToDoDAAC="UY3246" DistrCode="" PriorityCode="" AwardDate="01/01/2003" FastPayCode="N" AdminOffice="S0701A" UnitPrice="12.00000" QtyVarianceAllowed=".00000
I see the cfloop collecting the data elements.... where or how would you use cfloop to loop through "ActiveContracts". I could have as many as 100 seperate "ActiveContracts" in an XML.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
You are very good. Thank You
<cfset xmlString = '<ActiveContracts Contract="SP010000D0347" DeliveryOrder="0126" CLIN="0034AA" Qty="144" UnitOfIssue="PR" NSN="8405010760772" DeliveryDate="" ProjectCode="" Requisition=" " RequisitionSuffix="" ShipToDoDAAC="UY3246" DistrCode="" PriorityCode="" AwardDate="01/01/2003" FastPayCode="N" AdminOffice="S0701A" UnitPrice="12.00000" QtyVarianceAllowed=".00000
<cfset myXmlAttributes = xmlParse(xmlString).xmlRoo
<cfset myQueryObject = QueryNew(StructKeyList(myX
<cfset QueryAddRow(myQueryObject)
<cfloop collection="#myXmlAttribut
<cfset QuerySetCell(myQueryObject
</cfloop>