2 Replies Latest reply: Apr 25, 2008 8:42 AM by kodemonki RSS

    CFxml and Prolog

    kodemonki Community Member
      I used the attached code to generate an xml file. I then validated the file here: http://www.w3schools.com/Dom/dom_validate.asp and tried things mentioned here: http://forum.java.sun.com/thread.jspa?messageID=3605567&tstart=0. There is nothing (at least that I can see) before <?xml version="1.0" encoding="UTF-8"?> and there are no spaces or extra white space in the xml file.

      Yet I still get "Content is not allowed in prolog. " when I try to use xmlParse() on the file.

      Thoughts? Thanks!
        • 1. Re: CFxml and Prolog
          kodemonki Community Member
          No one has had this problem using CF8 to generate XML?
          • 2. Re: CFxml and Prolog
            kodemonki Community Member
            If I add the line: <?xml-stylesheet type="text/xsl" href="display.xsl"?> at the appropriate spot in the CF generated XML file and and go to www.mywebpage.com/myxmlfile.xml it will show up properly. Am I transforming the XML incorrectly?

            <cfxml var="spreadsheet">
            xml stuff
            </cfxml>
            <cffile nameconflict="overwrite" action="write" file="C:\Inetpub\wwwroot\internal\programs\dgim\spreadsheets\monthly\xml\create.xml" output="#toString(spreadsheet)#">
            <cfset xmldoc = xmlParse("C:\Inetput\wwwroot\internal\programs\dgim\spreadhseets\monthly\xml\create.xml") >
            <cffile action="read" file="C:\Inetpub\wwwroot\internal\programs\dgim\spreadsheets\monthly\xml\display.xsl" variable="xsl_trans">
            #xmlTransform(xmldoc,xsl_trans)#