in reply to Re: Item Identification in XML Files
in thread Item Identification in XML Files

So you think doing something like the following would be the best solution?

<inventory> <item id="1"> <name>item's name</name> <price>item price</price> </item> <item id="2"> <name>item's name</name> <price>item price</price> </item> </inventory>

If so, which do you think is the best way to go about assigning the numbers. Also do you think the cron job idea is good for reassigning item ids that are currently no longer being used? Or is there a less costly method? Thanks.

Replies are listed 'Best First'.
Re: Re: Re: Item Identification in XML Files
by mirod (Canon) on Apr 30, 2003 at 09:05 UTC

    Why do you insist on re-assigning numbers? Do you have a limited supply of them ;--)

        Exactly. Wouldn't it also take up more memory?

      hi, I'll probably end up doing it this way. just one more question -- what do you think is the best way to store the identification numbers? should I just store the current max assigned number in a file? any other ideas? thanks.

        Data::UUID looks like something you could use (disclaimer, I have never used it myself). File locking can be tricky, so, if you decide to write the code yourself, do a little homework before, like searching here for "file locking", I like RE: File Locking for example.