Hope this will giv some idea for u:)..

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute"
creationComplete="initApp()">
<mx:Script>
    <![CDATA[
        private var str:String =
"<page><header>HEADER-1</header><body><bodyies>BODY-1</body><body>BODY-2</body>";

        private function initApp():void{
            var myExp:RegExp = /<body>/ig;
            var numOftag:Array = str.match(myExp);
        }
    ]]>
</mx:Script>
</mx:Application>

Thanks,
Dinesh

On Thu, Aug 6, 2009 at 9:04 AM, adrianwonder <[email protected]> wrote:

>
> Hi everyone
>
> does anybody knw how to count the number of tags from a XML file? for
> example...
>
> <page>
> <header>HEADER-1
> </header>
> <body>
> BODY-1
> </body>
> <header>
> HEADER-2
> </header>
> <body>
> BODY-2
> </body>
> </page>
>
> If we wanted to count the number of body tags from this XMl file using
> flex, we should get the result 2.
>
> Any ideas or suggestions?
>
> Adrian
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to