displaying HTML Text in Tree Data

Hi Folks,

I was trying to display an html Text in the data field of a Tree node.

See this line
<folder label="1. General" data="Information about the resource or content aggregation as a whole.">

When I put an HTML text in the data section, I get an error saying < is not a valid

How do I put html text in the data field of a tree node

thanks

RG
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
 <mx:Script>
      <![CDATA[
         import flash.events.*;
         import mx.events.*;
         import mx.controls.*;
		
			
         private function changeEvt(event:Event):void {
            var theData:String = ""
            if (event.currentTarget.selectedItem.@data) {
               theData =  event.currentTarget.selectedItem.@data;
            }
            textSpace.htmlText = theData;
         }

   ]]>
   </mx:Script>
   <mx:Tree id="tree1" labelField="@label" showRoot="true" width="450" height="600"
        dragEnabled="true"
        dropEnabled="true">
      <mx:XMLListCollection id="Taxonomy">
         <mx:XMLList>
            <folder label="1. General" data="Information about the resource or content aggregation as a whole.">
               <folder label="1.1 Identifier (Owner)"/>
               <folder label="1.2 Title"/>
               <folder label="1.3 Language"/>
               <folder label="1.4 Description"/>
               <folder label="1.5 Keyword"/>
               <folder label="1.6 Coverage"/>
               <folder label="1.7 Structure"/>
               <folder label="1.8 Aggregation Level"/>
               <folder label="1.9 Accessibility"/>
               
               
               
               <folder label="Personal Folder">
                  <Pfolder label="Business" />
                  <Pfolder label="Demo" /> 
                     <Pfolder label="Personal" isBranch="true" /> 
                     <Pfolder label="Saved Mail" /> 
                  </folder>
                  <folder label="Sent" />
                  <folder label="Trash" />
            </folder>
         </mx:XMLList>
      </mx:XMLListCollection>
   </mx:Tree>
</mx:Application>

Open in new window

rgarimellaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
I am not sure if I understood your question completely but you have to replace all < with < and then try.
0
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
oh "&lt ;" EE  converted my less then encoding to "<"
0
rgarimellaAuthor Commented:
Ya I tried "&lt ;" this does not work. I am trying to display html text in the data tag

This line

<folder label="1. General" data="Information about the resource or content aggregation as a whole.">
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
I am trying to use your exact code, what is "textSpace" in that MXML its missing.
0
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
Why don't you directly use tree1 by id as I am showing in the alert box, or else you are suppose to get the current target to tree and then get the selectedItem and its data.
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
	<mx:Script>
		<![CDATA[
			import flash.events.*;
			import mx.events.*;
			import mx.controls.*;
			
			
			private function changeEvt(event:Event):void {
				var theData:String = ""
				/*if (event.currentTarget.selectedItem.@data) {
					theData =  event.currentTarget.selectedItem.@data;
				}*/
				Alert.show(tree1.selectedItem.@data);
			}
			
		]]>
	</mx:Script>
	<mx:Tree id="tree1" labelField="@label" showRoot="true" width="450" height="600"
			 dragEnabled="true"
			 dropEnabled="true" change="changeEvt(event)">
		<mx:XMLListCollection id="Taxonomy">
			<mx:XMLList>
				<folder label="1. General" data="Information about the resource or content aggregation as a whole.">
					<folder label="1.1 Identifier (Owner)"/>
					<folder label="1.2 Title"/>
					<folder label="1.3 Language"/>
					<folder label="1.4 Description"/>
					<folder label="1.5 Keyword"/>
					<folder label="1.6 Coverage"/>
					<folder label="1.7 Structure"/>
					<folder label="1.8 Aggregation Level"/>
					<folder label="1.9 Accessibility"/>
					<folder label="Personal Folder">
						<Pfolder label="Business" />
						<Pfolder label="Demo" /> 
						<Pfolder label="Personal" isBranch="true" /> 
						<Pfolder label="Saved Mail" /> 
					</folder>
					<folder label="Sent" />
					<folder label="Trash" />
				</folder>
			</mx:XMLList>
		</mx:XMLListCollection>
	</mx:Tree>
</mx:Application>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rgarimellaAuthor Commented:
The solution that I want is not to just display the data label, but putting html text inside the data label.

Ignore textspace. Some debugging
0
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
wait I told u clearly that you question is not 100% clear, if you want to put in any html data inside a XML first of all you need to use a CDATA tag

http://www.w3schools.com/xml/xml_cdata.asp

and where exactly do you want to display that html??
0
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
by the way you can't have a CDATA as part of a XML attribute instead you need to have it as an element in your XML.
0
rgarimellaAuthor Commented:
not the complete solution that I was looking
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.