Team

any chance you can suggest a better way of handling XML Parsing in CF 5.0 server MX 
does it beautifully, now Im in the process of carrying over the routine to CF5.

<cfset sCurrentDirectory = GetDirectoryFromPath(CGI.Path_Translated)>


<CFX_DOMParse file="#sCurrentDirectory#data.xml" output="root"> 

<cfscript>

....

/**
�*�Here�Im�spliting�up�the�Categories�that�are�passed�back�to�me�in�a�comma�delimeted�string
�*�But�then�I�have�to�also�loop�thru�each�of�the�resulting�Categories�and�pull�back�its�associated
�*�CHILD_LIST�then pull�back�its�ATTRIBUTE_LIST�all�while�knowing�which���������
�*�ATTRIBUTE�belongs�with�which�CHILD_ID
�*
�*�
�*�Im a little lost on how to handle that ... any help would be greatly appreciated.
�*
�*�
�*/

/**
 *
 * Here you can see how Im accessing the elements of the XML file
 *
 *
 */

           Name = root.Studio.Name;
           Address = root.Studio.Address1;
           Address2 = root.Studio.Address2;
           City = root.Studio.City;
           State = root.Studio.State;
           Zip = root.Studio.Zip;

getCategories = root.Studio.event.Catagories.CHILD_LIST;
x = split(getCategories,",");

         for (i=0;i lt ArrayLen(x);i = i + 1) {            
           r=�arrayFind(x,"Reception");
                        ... do something
           b�=�arrayFind(x,"Bride_and_Groom");
                        ... do something
           g�=�arrayFind(x,"Group");
                ... do something
         }
                
</cfscript>


::::::::::::::::::::::::::::::::::::::::::::::�XML
...
<Studio Name="abc store" Address1="111 lane street" Address2="" City="daytona" 
State="FL" Zip="00011">
   <event EventName="Smith wedding">�����
           �<Catagories>
���������<Reception>
������������<Image�FileName="1.jpg"/>
������������<Image�FileName="2.jpg"/>
������������<Image�FileName="3.jpg"/>
������������<Image�FileName="4.jpg"/>
������������<Image�FileName="5.jpg"/>
������������<Image�FileName="6.jpg"/>
������������<Image�FileName="7.jpg"/>
������������<Image�FileName="8.jpg"/>
������������<Image�FileName="9.jpg"/>
���������</Reception>
���������<Bride_and_Groom>
������������<Image�FileName="1.jpg"/>
������������<Image�FileName="2.jpg"/>
������������<Image�FileName="3.jpg"/>
������������<Image�FileName="4.jpg"/>
������������<Image�FileName="5.jpg"/>
������������<Image�FileName="6.jpg"/>
������������<Image�FileName="7.jpg"/>
������������<Image�FileName="8.jpg"/>
���������</Bride_and_Groom>
�������</Catagories>
���</event>
....


Best Regards
Ramene Anthony


-----------------------+
cf-xml mailing list
http://torchbox.com/xml/list.cfm

Reply via email to