Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
wittsdd #1
XmlParse Problems
Hello, I have searched everywhere and tried everything and cannot fix the
problem. I continually get the following error when trying to use the XMLParse
function so that I can read the values from an XML document. 'Illegal XML
character &#xb; ' Here is what I am trying.... <cfhttp method = 'Get'
url='...url...' path='E:\DevxtRoot\impt_rkms_search\'
file='test_danny.xml'> <cffile action='read'
file='E:\DevxtRoot\impt_rkms_search\test_danny.xml ' charset='utf-8'
variable='myxml'> <cfset mydoc = XmlParse(myxml)> Also, here is a snippet of
the XML doc that is returned... <?xml version='1.0' encoding='utf-8'?>
<NewDataSet> <Project> <IRAD_ID>973</IRAD_ID> <IRAD_Title>04 MARK 2
T/R Module Development</IRAD_Title> <Tech_Plan_FY>2004</Tech_Plan_FY>
</Project> <Project> <IRAD_ID>1063</IRAD_ID> <IRAD_Title>04-IDS160
Weapon System Tool/Capability Dev.</IRAD_Title>
<Tech_Plan_FY>2004</Tech_Plan_FY> </Project> </NewDataSet> Any help is greatly
appreciated Thanks, Danny
wittsdd Guest
-
XMLParse and XMLSearch
I have the following code: a variable "x" that contains an XML string; if I do an XMLParse on this variable, it works (cfdump shows me the xml... -
XMLParse Error works in 6.1 but not 7
I have a chunk of code that works on my 6.1 server, but not on my MX 7 server.... wtf? HELP! Thanks, Dave :+) -
xmlParse() claiming "document root missin"
In another thread previously I tried to address this issue. Somebody claimed that removing the term PUBLIC from my internal DOCTYPE declaration... -
xmlParse(cfhttp.filecontent)
I am using coldfusion to read rss feed. I was wondering why xmlParse(cfhttp.filecontent) works in one file residing in test server and fails to... -
XmlParse Delay capabilities in 7
I am trying to set a delay with the XMLParse function available only in 7.0. I set the XMLParse function as follows: <cfset xmlQuery =... -
drew222 #2
Re: XmlParse Problems
Yeah, problem is that character is a TAB character and therefore invalid. What
you need to do it so a REPLACE for all the characters to "" before you do the
xmlparse. Once you remove the offending character it should work fine.
drew222 Guest
-
wittsdd #3
Re: XmlParse Problems
I tried this line before the XMLParse
<cfset myxml2 = Replace(myxml,Chr(9),'', 'ALL')>
however, I still get the same error message.
Any Ideas?
Danny
wittsdd Guest
-
PENNY506 #4
Re: XmlParse Problems
I have also recieved this error during parsing of certain XML Documents. The
issue is that there are special 'high ascii' characters that are in the
Document That Need to be removed. For example I had this text in an xml doc
that failed: EJB.s The . looks like a period, but when you viwe it another
way it appears as EJBss. By doing an ASCII (ASC()) check on the string, I
find that it's this Series: 69 74 66 18 115 E J B ? S I'm likely
going to create a udf that does this conversion and can be found in the gallery
very soon. Hope this helps
PENNY506 Guest
-
morecarl #5
Re: XmlParse Problems
Originally posted by: wittsdd
I tried this line before the XMLParse <cfset myxml2 =
Replace(myxml,Chr(9),"", "ALL")> however, I still get the same error message.
Any Ideas? Danny
There are actually a number of control characters that will cause this problem
- you need to handle them all.
 a.k.a. Chr(11) is a vertical tab
 a.k.a. Chr(12) is a form feed
etc...
These were causing my xml parser to choke - the Replace function above cures
the problem is you string together enough of them.
e.g.
<cfset xmlDoc =
XmlParse(Replace(Replace(cfhttp.FileContent,Chr(11 ),"","ALL"),Chr(12),"","ALL"))>
Good luck.
morecarl Guest



Reply With Quote

