In CF 5 and earlier there's a limitation in the CFSCRIPT loop where it can only loop 
over CF structures, not object structures. This may have been changed in CF MX (I'll 
check it out).

At 01:09 PM 5/30/02, you wrote:
>Hi all,
>  I posted a similar question on the CF forums today and was pointed in the
>right direction; now I need some additional help.
>
>I'm trying to loop over a DOM tree created with msxml. This is a snap using
>cfloop. However, I want to convert my cfloop code to cfscript code so that I
>can write some UDFs for xml parsing (recursion is what I'm going for).
>
>
>Here's the code in question:
>
>  <!--- BEGIN XML PARSING --->
> <cfscript>
>  xmlContent=ReReplace(xmlContent ,"<!DOCTYPE[^>]+>","");       
>  objXML.LOADXML(#xmlContent#);
> 
>  Metadata=objXML.selectSingleNode("metadata");
>  
>  MetadataNodes=Metadata.ChildNodes;
>  mdLength = MetadataNodes.length;
>  stMetadata=structNew();
>  i=1;
>  
>  // begin looping through the xml document
>
>  for (mainNodes in MetadataNodes){ 
>     val=structInsert(stMetadata,#mainNodes.nodename#,"#mainNodes.text#");
>  }
>
>The error message tells me that MetadataNodes is not a structured object.
>the mdLength variable evaluates correctly; so I just need to figure out how
>to build a node list that CF can use.
>
>Any advice?
>FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
>Archives: http://www.mail-archive.com/[email protected]/
>Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists 

______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to