| Ultrashock Forums
• XML - White space ? |
|||
![]() |
||||
| Search this Thread | Thread Tools | Display Modes |
|
|
|||||||||||||||||||||||||
![]() |
Ultrashock Member Comments:
|
4 Weeks Ago
#2 |
||
|
Last edited by tiran : 4 Weeks Ago at 08:45.
|
|
|
4 Weeks Ago
#3 |
||
|
tiran Thanks for your replay - I'm using AS3. I've solved the problem by putting the name as an attribute of the node |
|
|
4 Weeks Ago
#4 |
||
|
Cool, I should also mention that putting something like "Travel & Lifestyle" in an attribute is technically still bad form because of the "&". There aren't supposed to be special characters in attributes - these days they can be escaped and Flash isn't as strict as say an RSS feed, so you will be ok for the most part. Keep in mind this example though. Look what happens to the '&' in the attribute as opposed to the '&' in the CDATA ActionScript Code:
The trace looks like this: Code:
<root>
<item name="Travel & Lifestyle">
<name><![CDATA[Travel & LifeStyle]]></name>
</item>
<item name="New"/>
</root>
|
|
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|


3 comments
| 198 views



Linear Mode
I used the CDATA tag because of the Ampersand in the title - Flash doesn't care a ton about that in this context, but its a good practice in nodes that might contain special chars or HTML.
This will allow you to query the XML based on the "name" nodes value in flash.
What version of AS are you using and I can elaborate.