Connecting Tech Pros Worldwide Help | Site Map

autonumber

Newbie
 
Join Date: Nov 2008
Posts: 20
#1: Apr 2 '09
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's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#2: Apr 2 '09

re: autonumber


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.
Newbie
 
Join Date: Nov 2008
Posts: 20
#3: Apr 2 '09

re: autonumber


Quote:

Originally Posted by Dormilich View Post

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
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#4: Apr 2 '09

re: autonumber


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).
Moderator
 
Join Date: Mar 2006
Posts: 1,103
#5: Apr 2 '09

re: autonumber


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.
Reply