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

XmlValidate() - Content is not allowed in prolog

Guest
Nov 11, 2008 Nov 11, 2008

Copy link to clipboard

Copied

I posted in another thread but I believe the issue described there is resolved so I am starting a new thread with this new issue.

XmlValidate always returns "Content is not allowed in prolog" I searched this forum and google and I did see where this problem was resolved for some. It appears that the most common cause was a hidden character (BOP I believe) in the file. However, I have verified that my xml does not have that in it.
I am at a loos as to how to proceed. I am hoping someone out there has seen this and fixed it. I need some serious help.
TOPICS
Advanced techniques

Views

1.4K

Translate

Translate

Report

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

correct answers 1 Correct answer

Deleted User
Nov 12, 2008 Nov 12, 2008
quote:

Originally posted by: Newsgroup User
How did you verify this?



I ran some very helpful code from Ben Nadel at http://www.bennadel.com/index.cfm?dax=blog:1206.view that basically gets the first few characters of the parsed xml and outputs them with Asc(). After running that code I had no extra characters in there.

I did sort out this issue though. I had quotes around the first parameter:
<CFSET errorStructure = XmlValidate("xmlObject", " http://www.myserver.com/MyXsd.xsd")>. When ...

Votes

Translate

Translate
LEGEND ,
Nov 11, 2008 Nov 11, 2008

Copy link to clipboard

Copied

> It
> appears that the most common cause was a hidden character (BOP I believe) in
> the file. However, I have verified that my xml does not have that in it.

How did you verify this?

--
Adam

Votes

Translate

Translate

Report

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
Guest
Nov 12, 2008 Nov 12, 2008

Copy link to clipboard

Copied

quote:

Originally posted by: Newsgroup User
How did you verify this?



I ran some very helpful code from Ben Nadel at http://www.bennadel.com/index.cfm?dax=blog:1206.view that basically gets the first few characters of the parsed xml and outputs them with Asc(). After running that code I had no extra characters in there.

I did sort out this issue though. I had quotes around the first parameter:
<CFSET errorStructure = XmlValidate("xmlObject", " http://www.myserver.com/MyXsd.xsd")>. When I removed the quotes the "Content is not allowed in prolog" error went away but I came back to the original problem I reported about in another thread. Namely, the code would run for about 30 seconds and then a JRun Servlet Error is returned with "500 null" on the page.
It turns out THAT issue was because I had <xs:include schemaLocation="DocumentCommon.xsd"/> in the xsd file being called in XmlValidate. Once I copied and pasted the code in DocumentCommon.xsd into the called xsd, replacing the <xs:include schemaLocation>, it worked.

Very frustrating.


Votes

Translate

Translate

Report

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
LEGEND ,
Nov 12, 2008 Nov 12, 2008

Copy link to clipboard

Copied

> I did sort out this issue though. I had quotes around the first parameter:
> <CFSET errorStructure = XmlValidate("xmlObject",
> " http://www.myserver.com/MyXsd.xsd")>

This is a good case in point as to why it's always good to post the code
that's giving the problem, when raising an issue here ;-)

That would have been a quick one to spot with a second pair of eyes.

--
Adam

Votes

Translate

Translate

Report

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
Guest
Nov 12, 2008 Nov 12, 2008

Copy link to clipboard

Copied

You are 100% correct Adam. I made the mistake of starting another thread. I should have kept the one as the code was posted in the first thread.
I muddied my own waters and that ain't pretty!

Votes

Translate

Translate

Report

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
LEGEND ,
Nov 12, 2008 Nov 12, 2008

Copy link to clipboard

Copied

LATEST
> I muddied my own waters

That sound *sooo* wrong.

;-)

--
Adam

Votes

Translate

Translate

Report

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
Documentation