xmlParse() claiming "document root missin"

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. 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...
    5. "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...
  3. #2

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139