nice idea.
Are you trying to create .sql files with create table statements after parsing the xml?
u have figured out a neat of learning xml, parsing concepts! great.
then you might want to make some columns of type ID? (ie primary key?)
refer to them from other places to specify foreign key constraints? so they w'd be of the type IDREF. An attribute of type IDREF can take any value that is of the type ID
So i don't think it can give the effect of a database constraint though.
If somebody can throw some light on using xml as database, that will be great!
Some thoughts here..
If we have an element named <database>, i tend not to repeat the same name while declaring an element (for eg name). My feeling is that we can probably have <name> instead of <databaseName>. Please feel free ignore these suggestions though as am not sure if i can safely extend
java conventions to xml as well !
Actually lot of people whom i know prefer this convention when naming java packages as well.
com.i2.iquote.Controller
to
com.i2.iquote.IQuoteController
class Customer{
getName() instead of getCustomerName()
}
in the above cases Customer and IQuote have been found to be redundant.
Frankly, such tendencies to extend concepts picked up from a different environment
backfired in other places.
I can clearly remember that Python's way of using exceptions seemed to be quite different from that of java and i was told not to carry my java knowledge to python.
i can already see some problems if we are looking for ,say, the name of a column.
Doing
doc.getElementsByTagName("columName"); w'd fetch all the column names
whereas if i follow what i said eariler, i need to get to "column" element first before doing getElementsByTagName("Name");
can someone point out the conventions used while naming xml elements?
thanks!
[ June 24, 2002: Message edited by: Mapraputa Is ]