all groups > flash data integration > september 2005 >
You're in the

flash data integration

group:

CDATA Issue


CDATA Issue pakora
9/20/2005 12:00:00 AM
flash data integration:
Hi

I am trying to apply html formatting to a block of text in an xml file. I
understand that the best way to do this is to use CDATA tags. The problem i
have is that the text is an attribute of a node. If i alter this, i.e. make it
a child node with its own opening and closing tags, it parses formatted text ok
but it really messes up the xml structure.

Does anyone know whether you can add CDATA tags into an attribute or
alternatively is there another way of getting it to format the text as html
from an attribute.

Any help greatly appreciated.
Re: CDATA Issue Dimitar
9/20/2005 6:32:20 PM
I am using CData in all my XML nodes and up to know there were no problems.

Either it parses the string value from the XML node (XML validation and
structure - valid) or it would parses some wrong data or woudln;t parse
anything.

Could you please post the XML file with the CData nodes and explain exactly
what do you messing up the XML structure?


Dimitar
Re: CDATA Issue pakora
9/21/2005 9:53:36 AM
Hi Dimitar - thanks for your reply

Here is my xml structure

<myQuiz>
<module number="01" title="Module Title" intro="This needs to be html
formatted text." movie="movie1.swf" summary="This needs to be html formatted
text.">
<questions>
<question answer="B" number="1" Value="What is the capital of the United
Kingdom?" objective="This needs to be html formatted text." >
<answers value="Berlin." exp="Dont be daft. Berlin is the capital of
Germany"/>
<answers value="London." exp="I would have had to kill you if you got this
question wrong."/>
<answers value="Washington." exp="Well - you have a point here."/>
</question>
<question answer="C" number="2" Value="Who is the President of the United
States of America?" objective="This needs to be html formatted text." >
<answers value="Tony Blair." exp="No - but he would like to be"/>
<answers value="Jacques Chirac." exp="would anything ever get done."/>
<answers value="George W Bush." exp="This answer is correct."/>
</question>
</questions>
</module>
</myQuiz>

The attributes requiring html text are 'intro' and 'summary' - attributes of
the 'module node' and 'objective' - an attribute of the 'question' node.

It all works fine as it is and the data is normalised and well formed. The
only trouble is that i need to have html formatted text on the three attributes
listed above and at the moment these just display as a single block of text.

I have used CDATA tags before but never on an attribute so it may be that i'm
doing it wrong but the way i see it is that CDATA have their own opening and
closing tages i.e. <![CDATA[HTML Formatted text goes here.]]> so i just cant
see how i can apply them to an attribute.

Any help greatly appreciated. I am quite new to Flash and am just learning
data integration.

Regards

Pakora
AddThis Social Bookmark Button