Copy link to clipboard
Copied
We just completed a ColdFusion 10 installation on Windows Server 2008 R2. After taking care of some configuration issues, we're now faced with a problem that we can't figure out. Searches on Google for the error returned almost nothing.
The error occurs when xmltransform is called in a CFC file. The error we get from CF is:
Failed to compile stylesheet. 1 error detected.
It's not very helpful. In the coldfusion-error.log file, we have this entry:
Error at xsl:output on line 2 column 193
XTSE1560: Conflicting values for output property method
Anyone have any ideas how to fix this? Is it something simple that we overlooked, or a fundamental difference in the way CF10 handles xmltransform?
Thanks,
Jamie Carter
This is telling us that there is another xsl:output element defined elsewhere. Have you checked the included XSL files?
Copy link to clipboard
Copied
I fixed that as well. Now I'm getting "An error occured while Transforming an XML document." There is nothing in the log file indicated what happened. It has the same message, with no detail. Apparently, CF thought that we were getting too close to fixing this, so it decided to make things harder.
And by the way Adobe (or Oracle), you misspelled OCCURRED.
Copy link to clipboard
Copied
I have now narrowed it down to the parameters variable. This is what the struct contains:
struct | |
---|---|
calPath | no calendar |
embedPath | https://www.aacc.edu/embed/default_emb.cfm |
formPath | no form |
playlistPath | no playlist |
regArrowPage | no regarrow |
regArrowStep | no regarrow |
visitorType | Future Students |
If I remove the parameters variable, the page loads properly. Something in there is making it fail.
Can you think of any reason why this would make it throw the error above?
Copy link to clipboard
Copied
What do you need the parameters for? You should search the XSL file, and included XSL files, for occurrences of calPath, embedPath, etc. Typically, such parameters are global XSL variables, and so are - or should be - defined as high up in the XSL document as possible.
The defining elements will look like:
<xsl:param name="calPath" />
<xsl:param name="embedPath" />
and so on. Later in the document their respective values are obtained as:
<xsl:value-of select="$calPath" />
<xsl:value-of select="$embedPath" />
and so on.
Check spelling (minding case-sensitivity) and verify that all the required name-value pairs are there.
Copy link to clipboard
Copied
I added most of the parameters a few months ago. The first was the visitor type, and later the others - they are for iFrame embedded objects. We couldn't get certain things to play nice with the XML so we went this route instead. They are used, but only when needed. When they aren't needed, they appear as above.
Copy link to clipboard
Copied
By my reckoning, the most likely cause of the error is a value element, like <xsl:value-of select="$calPath" />, without the corresponding param element. I would again look in the included XSLs.
Copy link to clipboard
Copied
I believe that you nailed it - I found a parameter being passed to the XML that was not even being used. This line in a CFC:
<cfset parameters["currentContentID"] = request.cfcContent.contentId >
was causing the XML parsing to crash. When I removed it, there was no error, and the page loaded normally! I did a grepWin search of our file system and discovered that no XSL actually even calls the variable. In CF7, it was allowed to slip through. In CF10, it was causing this unidentifyable error.
This is fantastic, as we can finally move forward with our projects. Thanks SO MUCH for your help! You are the Zen master of XML.
Hopefully this post will aid someone in the future as well!
Jamie Carter
Copy link to clipboard
Copied
I'm glad to hear! Please mark your post as the correct answer. It will surely help someone else in future.
Copy link to clipboard
Copied
This is interesting, when I ran the code in CF7, I got a different error:
An error occured while Transforming an XML document. Reference is not allowed in prolog. <br>The error occurred on line 12.
Line 12 is <cfset testOutput=xmlTransform(xmlFile,xslFile)>.
Copy link to clipboard
Copied
Check: I am on Coldfusion 11. I am now going to test it in Coldfusion 10.