Any luck arperry?
If you understand the difference between a WDDX packet and your own XML format, its obvious why we can't expect Cold Fusion to understand whats contained within your file.
WDDX is accessed with CFWDDX. This tag can output a WDDX packet from a Cold Fusion array or structure, or it can read in a WDDX packet and output an array or structure object. If you can explain whats inside the XML file, and how its data is organized I should be able to tell you how much work is involved to get your XML tags converted into something CFWDDX can understand.
-
In XML the names of the tags used to delimit the data are specific to the standard being used. In WDDX standard, the tag <var></var> surrounds any object or key of an object. Further down the page, in the WDDX packet example the first object we have is an ARRAY called 'lakes'. It has 4 dimensions (or keys). This array has 4 variables now.
lakes[1]
lakes[2]
lakes[3]
lakes[4]
Each of these variables is a structure. They are STRUCTURES of ARRAYS. Structures are objects. Each structure contains keys, which are referenced by text not numbers and are stored in no particular order. Lakes[1] contains 3 keys, as does Lakes[2], Lakes[3], and Lakes[4].
lakes[1]['LAKEID'] = 2
lakes[1]['NAME'] = Whiskey Lake
lakes[1]['FISHLIST'] = Rainbow trout,Northern sucker fish,Halibut
lakes[2]['LAKEID'] = 3
lakes[2]['NAME'] = Lake Mead
lakes[2]['FISHLIST'] = Carp,Albino carp,Dead carp
... etc ...
WDDX packet example:
<var name='LAKES'>
<array length='4'>
<struct>
<var name='LAKEID'><number>2</number></var>
<var name='NAME'><string>Whiskey Lake</string></var>
<var name='FISHLIST'><string>Rainbow trout,Northern sucker fish,Halibut</string></var>
</struct>
<struct>
<var name='LAKEID'><number>3</number></var>
<var name='NAME'><string>Lake Mead</string></var>
<var name='FISHLIST'><string>Carp,Albino carp,Dead carp</string></var>
</struct>
<struct>
<var name='LAKEID'><number>4</number></var>
<var name='NAME'><string>Lake Michigan</string></var>
<var name='FISHLIST'><string>Coke bottle,plastic ring for cans,biological waste</string></var>
</struct>
<struct>
<var name='LAKEID'><number>5</number></var>
<var name='NAME'><string>New Lake</string></var>
<var name='FISHLIST'><string>fishA,fishb,fishc</string></var>
</struct>
</array>
</var>
-
1. CREATE a packet
If you had the following CFSCRIPT:
<CFSCRIPT>
tempStruct = structnew();
tempStruct['COLOR'] = 'Red';
tempStruct['SIZE'] = 'Large';
tempStruct['SEX'] = 'M';
order = structnew();
order = structcopy(tempstruct);
</CFSCRIPT>
You would have a structure object with 3 keys describing one customer's order.
You'd convert it into a WDDX packet, and write the file.
<CFWDDX action="CFML2WDDX" input="#order#" output="content">
<CFFILE ACTION="write"
FILE="temp.txt"
OUTPUT=
'#content#'>
2. READ a packet
If you had the following packet:
<CFSET input =
'
<wddxPacket version='1.0'><header></header>
<data>
<struct>
<var name='COLOR'><string>Red</string></var>
<var name='SIZE'><string>Large</string></var>
<var name='SEX'><string>M</string></var>
</struct>
</data>
</wddxPacket>
'>
<CFWDDX action="WDDX2CFML" input="#input#" output="order">
<CFOUTPUT>#order.color#,#order.size#,#order.sex#</CFOUTPUT>
Would show: Red,Large,M
hope this makes a distinction easier. lets see your XML file and tags and any description you can provide