Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
mate of the state #1
xmlParse() claiming "document root missin"
In another thread previously I tried to address this issue. Somebody claimed
that removing the term PUBLIC from my internal DOCTYPE declaration solved the
issue, but it is not working for me still. In case it would help in outside
eyes debugging this, I've included all code that executes prior to the point of
failure. First, of course, we have Application.cfm. If this finds the XML
config file, it instantiates the master CFC and calls that CFCs init method,
which should then attempt to parse the config file.
<CFapplication
name="lindholm-front"
sessionmanagement="yes"
sessiontimeout="#createTimeSpan(0,1,0,0)#"<!--- // UDFs (beefy!) //>
<CFinclude template="includes/udf.cfm"> --->
<!--- // INIT THE SYSTEM! // --->
<CFscript>
// establish path to config file
configPath = expandPath('config.xml');
if (fileExists(configPath)) {
// instantiate the app
lindholm = createObject('component','cfc.lindholm');
lindholm.init(configPath);
} else {
// oops!
writeOutput('Critical error: The XML configuration file is missing!');
}
</CFscript>
<!--- // INCLUDE SITE-WIDE HEADER (top piece of bread in our site sandwich) //
--->
<CFinclude template="templates/header.cfm">
...
<!--- // LINDHOLM.CFC // --->
<CFcomponent hint="Root CFC">
<!--- // PROPERTIES // --->
<!--- // METHODS // --->
<!--- loadXML() --->
<CFfunction
name="loadXML"
returntype="void"
hint="Simplifies first two requisite steps for processing XML data."<CFargument name="configPath" type="string" required="yes" />>
<CFargument name="encoding" type="string" required="no" default="utf-8" />
<CFfile action="read" file="#arguments.configPath#" variable="config"
charset="utf-8" />
<CFset config = xmlParse(arguments.configPath) />
<CFreturn config />
</CFfunction>
<!--- init() --->
<CFfunction name="init" returntype="void">
<CFargument name="configPath" type="string" required="yes" />
<!--- HTTP headers --->
<CFheader name="Content-Type" value="text/html; utf-8" />
<CFscript>
// load the config file
this.configXML = this.loadXML(arguments.configPath);
</CFscript>
</CFfunction>
</CFcomponent>
mate of the state Guest
-
Problems connecting with any user besides "root"
Hello. I am using the trial version of Contribute 3; I need to make a decision on what CMS to suggest to my bosses by the end of the week, and... -
Configuring JRUN's "root directory"
Is there a way to configure JRUN so it won't necessarily use cfusion.war as the root directory? We'd like to be able to have a directory... -
Back to... document "appearance (8.5X11)" vs artboard size...
My new printshop (who I just started working with, and is conveniently located right down the street) is convinced that although I sized my .ai... -
Determining the "root" folder of the web application
ASP.NET creates every website as a new "project" off the default (localhost) web site. So, my project "Accounting" is accessed via... -
"eject" command only works for root
Dear all, The "eject" command (which opens the CD tray) works as expected if I run it as root. But as a common user, typing "eject" on the... -
mate of the state #2
Re: xmlParse() claiming "document root missin"
Ugh... I was trying to parse the path to the file, not the variable returned by <CFfile />...
D'oh. ;)
CARRY ON
mate of the state Guest



Reply With Quote

