Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 116797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:14:05+00:00 2026-05-11T03:14:05+00:00

I’m seeing something very very strange happening in a Flex app I’m maintaining. I’ve

  • 0

I’m seeing something very very strange happening in a Flex app I’m maintaining.

I’ve been going through it removing all calls to trace() and replacing it with calls into the logging framework (using the built in mx.logging stuff). After doing so some XML parsing code suddenly broke, and I can’t for the life of me figure out why.

here’s the code:

private var loader:URLLoader; // created elsewhere  private function handleComplete(event:Event):void {       default xml namespace = com;   xml = XML(loader.data);   var response:XML = new XML(xml..raniResponse);   //now handles a null response object   if(xml && response.children().length() > 0) {     LOG.debug('Got response.');     var cityXML:XML = new XML(xml..city);     var stateXML:XML = new XML(xml..stateProv);     /* Some extra processing is done here */   } } 

With the code like this, with that LOG.debug() call in place, I get the following error on the line cityXML is defined:

TypeError: Error #1088: The markup in the document following the root element must be well-formed. 

If I comment out the LOG.debug() call it works fine.

I thought there might be some weirdness with the custom log target I created, so I removed that. Currently the only target being used is the built-in trace target.

Does anyone know what’s going on? Why would a logging call break the XML parsing? I can’t think of anything it could be doing that would break it.

EDIT:

I did some more tests, and it’s just getting weirder.

I changed the code based on David’s comment to use xml..city[0] instead of new XML(xml..city) for both assignments. This caused the exception to happen a bit later (in some code not shown above where it’s referencing cityXML). So I tried stepping through in the debugger and noticed something odd.

cityXML was being set to null, while stateXML was getting the proper value. Looking at the xml object in the debugger showed all the correct data, so it should have been fine. As a random test I rearranged the code so that stateXML was being loaded first. After doing that, stateXML is null, while cityXML is correct.

So, whichever assignment happens immediately after the log is failing, but whatever happens after that worked fine.

Here’s the (somewhat sanitized) XML that’s being parsed:

<?xml version='1.0' encoding='utf-8'?> <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>   <soapenv:Body>     <com:MyCompanyRANIv.01 xmlns:com='com:myc:rani:1:0:message' xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>       <com:raniResponse>         <com:telephonyInfo>           <com:countryCode>1</com:countryCode>           <com:telephoneNumber>14121234567</com:telephoneNumber>         </com:telephonyInfo>         <com:geoInfo>           <com:coordinates>             <com:latLon>               <com:lat>40.49</com:lat>               <com:lon>-79.92</com:lon>             </com:latLon>           </com:coordinates>           <com:countryInfo>             <com:country>               <com:featureName>United States</com:featureName>               <com:featureTypeDescription>United States of America</com:featureTypeDescription>               <com:featureCode value='US' system='ISO 3166' family='Country Code' systemVer='1-alpha-2' />             </com:country>           </com:countryInfo>           <com:stateProvInfo>             <com:stateProv>               <com:featureName>PENNSYLVANIA</com:featureName>               <com:featureTypeDescription xsi:nil='true' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' />               <com:featureCode family='US State Code' system='FIPS State Alpha Code' systemVer='' value='PA' />             </com:stateProv>           </com:stateProvInfo>           <com:regionInfo>             <com:region>               <com:featureName xsi:nil='true' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' />               <com:featureTypeDescription xsi:nil='true' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' />               <com:featureCode family='' system='' systemVer='' value='' />             </com:region>           </com:regionInfo>           <com:countyParishInfo>             <com:countyParish>               <com:featureName>ALLEGHENY</com:featureName>               <com:featureTypeDescription xsi:nil='true' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' />               <com:featureCode family='' system='' systemVer='' value='' />             </com:countyParish>           </com:countyParishInfo>           <com:cityInfo>             <com:city>               <com:featureName>PITTSBURGH</com:featureName>               <com:featureTypeDescription xsi:nil='true' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' />               <com:featureCode family='' system='' systemVer='' value='' />             </com:city>           </com:cityInfo>           <com:buildingInfo>             <com:building>               <com:featureName xsi:nil='true' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' />               <com:featureTypeDescription xsi:nil='true' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' />             </com:building>           </com:buildingInfo>           <com:streetAddress address='' />         </com:geoInfo>         <com:services host='false' wireless='false' other='false' />       </com:raniResponse>       <com:raniRequest>         <com:fullyQualifiedTelephoneNumber>14121234567</com:fullyQualifiedTelephoneNumber>       </com:raniRequest>     </com:MyCompanyRANIv.01>   </soapenv:Body> </soapenv:Envelope> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T03:14:06+00:00Added an answer on May 11, 2026 at 3:14 am

    Posting this as an answer instead of an edit as it includes some workarounds.

    I did a few more tests. Here’s the relevant code from the first:

    LOG.debug('Got response:'); var cityXML:XML = xml..city[0]; var stateXML:XML = xml..stateProv[0]; 

    Stepping through with the debugger, cityXML is assigned to null, while stateXML gets the right value.

    Next, I tried this:

    LOG.debug('Got response:'); trace('foobar'); var cityXML:XML = xml..city[0]; var stateXML:XML = xml..stateProv[0]; 

    It worked! (why?!). Both cityXML and stateXML got the right values.

    Not satisfied with this, I tried another test. I thought maybe I just needed some other operation between the log and the first assignment (no idea WHY, but just experimenting here). So I tried this:

    LOG.debug('Got response:'); var someDumbVariable:Number = 42; var cityXML:XML = xml..city[0]; var stateXML:XML = xml..stateProv[0]; 

    This didn’t work. So, one more test:

    LOG.debug('Got response:'); var cityXML:XML = xml..city[0]; cityXML = xml..city[0]; var stateXML:XML = xml..stateProv[0]; 

    This worked! When stepping through with the debugger the first assignment ends with cityXML being set to null. However, the 2nd assignment to it gives the correct value. (I tried simply splitting the cityXML line into a declaration on one line and the assignment on another, but that didn’t change the behavior. 2 assignments seemed necessary).

    Another workaround:

    LOG.debug('Got response:'); if(xml.length() == 0) { return; } var cityXML:XML = xml..city[0]; var stateXML:XML = xml..stateProv[0]; 

    I still have no idea why the log would cause this stuff to happen, but it seems that either throwing a trace in or attempting the assignment twice works around the issue. I’m going to keep investigating to see if I can figure out the root cause here, but at least I’ve now got a couple workarounds that don’t involve removing the logging.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have a text area in my form which accepts all possible characters from
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have been unable to fix a problem with Java Unicode and encoding. The
I am writing an app with both english and french support. The app requests
I am using Paperclip to handle profile photo uploads in my app. They upload

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.