Xpath is quick enough to read it directly each time. It's what I like about it.
Jason Merrill | E-Learning Solutions | icfconsulting.com >>-----Original Message----- >>From: [EMAIL PROTECTED] [mailto:flashcoders- >>[EMAIL PROTECTED] On Behalf Of Kent Humphrey >>Sent: Thursday, February 02, 2006 5:36 PM >>To: Flashcoders mailing list >>Subject: Re: [Flashcoders] xpath / xpath4as2 beginners question >> >>Merrill, Jason wrote: >>> It's well formed, sure, but I would do it like this instead - make heavy >>> use of attributes - as much as possible for speed, relationships, and >>> readability, something like this: >> >>> Preferrably if you could find a way to work this, you could also maybe >>> just do this to reduce redundancy: >>> >>> <root> >>> <clients> >>> <client name="Borgo di Colleoli" sector="Property"> >>> <discipline name="Direct Mail"/> >>> <discipline name="Advertising"/> >>> </client> >>> <client name="Royal Bank of Scotland" sector="Finance"> >>> <discipline name="Interactive Design"/> >>> <discipline name="Strategy"/> >>> </client> >>> </clients> >>> ..add more here >>> </root> >>> >>> ...and then make some use of XPath's search features to find the >>> opposite relationships - i.e. sector to client, discipline to sector, >>> etc. - though I haven't used it yet so wouldn't have an example to share >> >>Thanks for that. Unfortunately I don't think I'm going to be able to use >>attributes for anything more than names, because a client may exist inside >>multiple sectors I believe. >> >>I was hoping I could cut down on the redundancy, so I'll certainly look into >>traversing the tree in both directions with XPath. >> >>I did wonder if using attributes more than text inside nodes made more sense >> >>> After reading this article, I'm confused why client name does not merit an >>element? >> >>I don't know the rules - or even if there ARE rules - but my reasoning was that >>the name attribute was part of the client, but the others were separate but >>belonged to the client. Just my logic. >> >>Another question, would I be better off parsing all my relationships into >>associative arrays (like they are hardcoded now) on start up, or is XPath quick >>enough that I could read it directly each time? >>_______________________________________________ >>Flashcoders mailing list >>Flashcoders@chattyfig.figleaf.com >>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders