autonumber

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hsachdevah
    New Member
    • Nov 2008
    • 20

    autonumber

    Hello,
    I am a new guy to xml.
    I want to develop a application which saves notes.
    so I will be implementing <notes> root in xml with attribute "id"

    every time I insert a new node, how can I determine the id of the last node used?

    and how can I delete some node for a particular id?
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    that depends largely how you insert the nodes and how you do it (DOM, string insertion (via programming languages), XSLT)

    next you have to decide how you want to read the ids (XPath, string) and replace the nodes.

    once you know that we can help you much better than some general ideas.

    Comment

    • hsachdevah
      New Member
      • Nov 2008
      • 20

      #3
      Originally posted by Dormilich
      that depends largely how you insert the nodes and how you do it (DOM, string insertion (via programming languages), XSLT)

      next you have to decide how you want to read the ids (XPath, string) and replace the nodes.

      once you know that we can help you much better than some general ideas.
      I will be using asp.net

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        well, I can't help if it comes to ASP.NET specific question, though I'll try if it's something I know (like XSLT, XPath or DOM).

        Comment

        • jkmyoung
          Recognized Expert Top Contributor
          • Mar 2006
          • 2057

          #5
          What you ultimately do is find the largest notes id in the document. Assuming id is an attribute in the notes element, find xpath like:

          notes[not(@id &lt; //notes/id)]/@id

          to get the largest id.

          Comment

          Working...