1 Reply Latest reply on Jun 2, 2014 7:39 AM by cpDev

    XML doesn't throw expected TypeError when end-tag is incorrect

    cpDev

      I have a rather strange problem. When I attempt to construct an XML object using an object that contains incorrect ending tags, say something like this:

       

      <book>
         <chapter>
            <title>foo</title>
         </book> <!-- incorrect -->
      </chapter>
      
      
      

       

      not only does the XML constructor not complain, somehow, magically, it appears to "fix" the XML by swapping the ending </book> and </chapter> tags. I confirmed this by inspecting the result of the XML.toXMLString and found that the tags are swapped.

       

      There seems to be some kind of a compile configuration I'm using/missing. If I try to compile the same code using Flash Builder (instead of flexmojos, which I typically use), the expected TypeError is actually thrown:

       

      TypeError: Error #1085: The element type <chapter> must be terminated by the matching end-tag: </chapter>

       

      What's going on? Is there source code for XML that I can step into?