Skip to main content
Inspiring
April 16, 2008
Question

CFxml and Prolog

  • April 16, 2008
  • 2 replies
  • 537 views
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!
    This topic has been closed for replies.

    2 replies

    kodemonkiAuthor
    Inspiring
    April 25, 2008
    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)#

    kodemonkiAuthor
    Inspiring
    April 21, 2008
    No one has had this problem using CF8 to generate XML?