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