Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Passing XML Object to CFC Method

New Here ,
Jun 03, 2008 Jun 03, 2008
I generated an XML Document Object using CFXML and it seems to work fine until I try to pass it to a CFC method with an argument type of "xml". The docs say that xml can refer to either an xml object or xml string; however, when I try to invoke my CFC, it seems that CF8 is assuming it is an XML string and attempting to parse it, which fails because it is already parsed! The error is:

An error occured while Parsing an XML document.
Content is not allowed in prolog.

If I do a toString() to start with, it seems to work - so are the docs incorrect? Must "xml" type be an XML string only?
318
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 04, 2008 Jun 04, 2008
LATEST
CF8 is assuming it is an XML string and attempting to parse it, which fails because it is already parsed!

I don't think that's the cause of the error. There must have been a space or some other character(s) before the XML declaration.

I tested the following example -- successfully.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources