Menu

Could you add a "Data: Pointer" field to OXml TXMLNode ?

Anonymous
2014-09-08
2014-09-11
  • Anonymous

    Anonymous - 2014-09-08

    In http://stackoverflow.com/questions/1841621, it is suggested that "XML DOM" can be used as non-visual tree data structure.

    Because a "Data: Pointer" field can make a tree node more useful, could you add a "Data: Pointer" field to OXml TXMLNode ?

    Best regards,
    Jiaguo

     
  • Ondrej Pokorny

    Ondrej Pokorny - 2014-09-09

    Yes, it's suggested on the SO, but in the answer it's also rejected by the questioner.
    I have to agree with the questioner - you want to use XML DOM for something it's not supposed to be used.

    If you want to link some data to TXMLNode, use TDictionary<txmlnode, ???=""> or TODictionary from ODictionary.pas.</txmlnode,>

     
  • Anonymous

    Anonymous - 2014-09-11

    Hi, thank you for your suggestion about linking data to TXMLNode with your ODictionary.pas ! It works fine ! Nonetheless, this will involve more variables.

    Could you help to comment whether it is bad to add a "Data: Pointer"field ? The TComponent has a Tag property to store customized data. :D

     
  • Ondrej Pokorny

    Ondrej Pokorny - 2014-09-11

    As I said before, XML DOM is not supposed to store customized data in the nodes.
    Furthermore, pointers are not a good solution for mobile platforms.

     

Anonymous
Anonymous

Add attachments
Cancel