views:

88

answers:

3
<?xml version="1.0" encoding="utf-8"?>
<WorkItems>
  <WorkItem Duration="1" ID="1" Title="this breaks: &quot;"></WorkItem>
</WorkItems>

I embed this XML into my Flex 4 app:

<fx:XML source="data.xml" id="Data">
</fx:XML>

And I get an error: TypeError: Error #1090: XML parser failure: element is malformed.

If I remove the quot part of the title it works fine. How come? Isn't this the proper way to escape "?


Edit: Opened a bug with Adobe.

+1  A: 

That's valid XML, possibly a bug in Flex...? Try parsing it in ActionScript instead and see what happens.

thenduks
if I turn the title into a sub element it works also.. I guess it's a bug handling quoted text.
Assaf Lavie
A: 
JabbyPanda
CDATA for an attribute??
Assaf Lavie
Sorry I was not paying attention that you have quote in the XML atribute. " should work for Flash Player. If it does not for Flex , then it is a bug of mxmlc compiler.
JabbyPanda
A: 

I've had a similar issue - though I was working with free standing "&" characters and had to do preprocess the XML with:

        $xml = str_replace("&", "&amp;", $response->getBody());

Can you pre-process the XML to change the escape string into character literals?

MBHNYC