We are switching to CFMX from CF 5.  We were using a third party software 
(granularity) to parse our XML docs.  We come to find out that they do not support 
CFMX.  Below is some code I am using but it is not doing what I need it to do.  I need 
to be able to check the XML root name to see what kind of XML doc it is.  When I try 
to do this, it tells me that "You have attempted to dereference a scalar variable of 
type class java.lang.String as a structure with members.".  Can anyone help me with 
this?




<CFDIRECTORY ACTION="LIST" DIRECTORY="#Application.xml_filePath#" NAME="xmlDirectory" 
FILTER="*.xml" SORT="name ASC">
<!--- Check to see that there is at least one XML file --->
<CFIF xmlDirectory.recordcount GT 0>
        <!--- Loop through all XML files in the directory --->
        <CFLOOP QUERY="xmlDirectory">



<CFFILE action="read" file="#Application.xml_filePath#\#xmlDirectory.Name#" 
variable="input_xml" />


<!--- New MX stuff input on 07/24/2003--->
<CFSET stConvertedDom = XmlParse(input_xml#,"no")><!---  granularity suggested --->
<cfset stCfDom = "#Application.xml_filePath#\#xmlDirectory.Name#">

<cfset path = #Application.xml_filePath#>
<cfset directory = #xmlDirectory.Name#>
<cfoutput>input xml: #stConvertedDom#</cfoutput><br>
<cfoutput>input xml: #stCfDom#</cfoutput><br>
<cfoutput>xml filepath: #path#</cfoutput><br>
<cfoutput>xml directory name: #directory#</cfoutput>

        <CFSET Variables.flag_fileOK="Y">

<CFIF Variables.flag_fileOK IS "Y">
<!---   Extract the root element name of the XML structure (use the stCfDom structure 
because the root
                element name cannot be retrieved from the stConvertedDom structure); 
the root element name is
                used to determine whether the XML document contains Program Status or 
Risk data --->
                <CFSET Variables.xml_rootname="#stConvertedDom.document.root.name#">
                
                <!--- Set directory paths based on whether the file is Status or Risk 
update --->


<CFIF Variables.xml_rootname IS "Something>
  Go somewhere
<CFELSE>
  Go somewhere else
</cfif>



Thanks all.


Brian Yager
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

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

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to