By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,212 Members | 1,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,212 IT Pros & Developers. It's quick & easy.

Custom class exists to add, update, delete and select nodes in record style XML file???

P: n/a
I am considering writing a Class that Selects, Adds, Updates and Deletes
Nodes in an XML File but do not what to reinvent the wheel. (See XML file
below)

That data format would emulate records in a Database Table with a Primary
Key for each Record (see xml sample below) and a flat file structure. I
would use a class to manipulate this type of data structure extensivly if I
had one.

Does anyone know of such an animal?

Thanks In Advance

Earl

<?xml version="1.0"?>
<ROOT NextPk="3">
<RECORD PkNum="1">
<NAME>Mark</NAME>
<PHONE>2147386130</PHONE>
</RECORD>
<RECORD PkNum="2">
<NAME>Earl Teigrob</NAME>
<PHONE>7757885132</PHONE>
</RECORD>
</ROOT>

Nov 11 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Earl Teigrob wrote:
I am considering writing a Class that Selects, Adds, Updates and Deletes
Nodes in an XML File but do not what to reinvent the wheel. (See XML file
below)

That data format would emulate records in a Database Table with a Primary
Key for each Record (see xml sample below) and a flat file structure. I
would use a class to manipulate this type of data structure extensivly if I
had one.

Does anyone know of such an animal?

Look at XmlDocument or XmlDataDocument.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #2

P: n/a
Oleg,

I was actually thinking about using those classes to create a very specific
class to manage the "records" of an xml file. This would be a very
specialized class that emulates the functions of a database working with
records of a table. Some of the methods could look like this:
public Bool Add(HashTable KayValues) [-->returns success t/f]
public Bool Update(int PkNum, HashTable KeyValues) [-->returns success t/f]]
public Bool Delete(int PkNum) [-->returns success t/f]]
public XmlNodeList Select(HashTable KeyValues) [-->returns XmlNodeList of
Matching Nodes]

public HashTable SelectOne(HashTable KeyValues) [-->returns HashTable of
First Matching Node]

public HashTable SelectByPkNum(int PkNum) [-->returns HashTable of Matching
PkNum Node]

The HashTable keys would be the names of the fields and the values would be
the values to add, update or return.

The PkNum attribute wouild be automatically added to each new node when it
is added the the NextPk attribute would be incrimented to the next value for
each add.

Hope that explains it better.

Earl

I am considering writing a Class that Selects, Adds, Updates and Deletes
Nodes in an XML File but do not what to reinvent the wheel. (See XML file
below)

That data format would emulate records in a Database Table with a Primary
Key for each Record (see xml sample below) and a flat file structure. I
would use a class to manipulate this type of data structure extensivly if I
had one.

Does anyone know of such an animal?

Thanks In Advance

Earl

<?xml version="1.0"?>
<ROOT NextPk="3">
<RECORD PkNum="1">
<NAME>Mark</NAME>
<PHONE>2147386130</PHONE>
</RECORD>
<RECORD PkNum="2">
<NAME>Earl Teigrob</NAME>
<PHONE>7757885132</PHONE>
</RECORD>
</ROOT>
"Oleg Tkachenko" <oleg@NO_SPAM_PLEASEtkachenko.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Earl Teigrob wrote:
I am considering writing a Class that Selects, Adds, Updates and Deletes
Nodes in an XML File but do not what to reinvent the wheel. (See XML file below)

That data format would emulate records in a Database Table with a Primary Key for each Record (see xml sample below) and a flat file structure. I
would use a class to manipulate this type of data structure extensivly if I had one.

Does anyone know of such an animal?

Look at XmlDocument or XmlDataDocument.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #3

P: n/a
Earl Teigrob wrote:
I was actually thinking about using those classes to create a very specific
class to manage the "records" of an xml file. This would be a very
specialized class that emulates the functions of a database working with
records of a table. Some of the methods could look like this:
public Bool Add(HashTable KayValues) [-->returns success t/f]
public Bool Update(int PkNum, HashTable KeyValues) [-->returns success t/f]]
public Bool Delete(int PkNum) [-->returns success t/f]]
public XmlNodeList Select(HashTable KeyValues) [-->returns XmlNodeList of
Matching Nodes]


This looks like System.Data.DataTable class, you can consider extensing it.

--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.