Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default 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 &amp;#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

  2. Similar Questions and Discussions

    1. 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...
    2. 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 :+)
    3. 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...
    4. 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...
    5. 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 =...
  3. #2

    Default 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

  4. #3

    Default 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

  5. #4

    Default 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

  6. #5

    Default 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.
    &#xB; a.k.a. Chr(11) is a vertical tab
    &#xC; 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139