ok, so i figured out my first question....

but I have another question about parsing xml...


look at this xml::::

 <rss version="2.0" xmlns:dc=" http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:content=" http://purl.org/rss/1.0/modules/content/">
  <employees>
    <employee id="1266">
      <employee_id>1266</employee_id>
      <picture>somepicture location</picture>
      <firstname>Aaron</firstname>
      <lastname>Smith</lastname>
      <displayname>Aaron Smith</displayname>
      <title>dev</title>
      <department>Interactive</department>
      <deskphone>5812456545</deskphone>
      <mobile>786547852562</mobile>
      <email>[EMAIL PROTECTED]</email>
      <screenname>aaronsmithcpb</screenname>
    </employee>
  </employees>
</rss>

when I try an trace out the first name of the employee node, i have ot use the toString() method in order to actually see the name (Aaron),

when i use employees.employee[0].firstname.toString() = Aaron
now if i do: employees.employee[0].firstname = <firstname xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy=" http://purl.org/rss/1.0/modules/syndication/" xmlns:content="http://purl.org/rss/1.0/modules/content/ ">Aaron</firstname>

what is the deal with that??? that node doesn't even have any xmlns declarations in the defined XML, why would accessing just the firstname property tag all that on there? Should'nt the second one be giving me just Aaron as well??

thanks..







On 9/19/06, aaron smith <[EMAIL PROTECTED] > wrote:
look at this example:


:::::

<?xml version=" 1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml " layout="absolute" creationComplete="init()">
   
    <mx:Model id="txml">
        <employees>
            <employee>
                <firstname>Aaron</firstname>
            </employee>
            <employee>
                <firstname>DDDDD</firstname>
            </employee>
        </employees>
    </mx:Model>
   
    <mx:Script>
        private function init():void
        {
            XPLogger.info( txml.employees.employee[0].firstname );
        }
    </mx:Script>
   
</mx:Application>

::::::


This generates a runtine error: "Cannot access a property or method of a null object reference."

Why exactly is this generating a runtime error? I can't figure it out.. even when you try this:: XPLogger.info( txml.employees.employee[0] )

now the other thing is this. when i do an XPLogger.info( txml.employees ) it traces as [object]

any ideas?


__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to