XML for persisted data
-
Hello guys, I am designing an XML database and need some pointers. The database i am designing will be used to store configuration information - it will be similar to the type of database that a firewall might have - different rules with different settings. It will not be used on any special web application - it will be used as an internal configuration database for a local C++ application. I wanted to know if: 1) There are any XML/XML schema authoring tools which will assist me in creating the database and its relationships. 2) There are any XML schemas that exist which are similar to the model I am looking for. I could use these for reference since i am pretty new to XML. 3) I need to know which is the best way to extract the XML from my XML file(or files). The database could potentially be quite large, and i do not want to load the whole thing in memory before using it. I also do not want to reparse the entire document each time i need to make a query on it. I have heard of XPATH, scripting, DOM and SAX. I might even use a combination of them. Does anyone know which might be the best suited? Also, has anyone ever heard of XML query language? I have available quite a variaty of books (most from Wrox press). If anyone has good suggestions for more books I could buy, please let me know. Thanks a lot for the help! Jeremy. Jeremy Pullicino Professional C++ Developer Done any hacking lately?
-
Hello guys, I am designing an XML database and need some pointers. The database i am designing will be used to store configuration information - it will be similar to the type of database that a firewall might have - different rules with different settings. It will not be used on any special web application - it will be used as an internal configuration database for a local C++ application. I wanted to know if: 1) There are any XML/XML schema authoring tools which will assist me in creating the database and its relationships. 2) There are any XML schemas that exist which are similar to the model I am looking for. I could use these for reference since i am pretty new to XML. 3) I need to know which is the best way to extract the XML from my XML file(or files). The database could potentially be quite large, and i do not want to load the whole thing in memory before using it. I also do not want to reparse the entire document each time i need to make a query on it. I have heard of XPATH, scripting, DOM and SAX. I might even use a combination of them. Does anyone know which might be the best suited? Also, has anyone ever heard of XML query language? I have available quite a variaty of books (most from Wrox press). If anyone has good suggestions for more books I could buy, please let me know. Thanks a lot for the help! Jeremy. Jeremy Pullicino Professional C++ Developer Done any hacking lately?
-
Hello guys, I am designing an XML database and need some pointers. The database i am designing will be used to store configuration information - it will be similar to the type of database that a firewall might have - different rules with different settings. It will not be used on any special web application - it will be used as an internal configuration database for a local C++ application. I wanted to know if: 1) There are any XML/XML schema authoring tools which will assist me in creating the database and its relationships. 2) There are any XML schemas that exist which are similar to the model I am looking for. I could use these for reference since i am pretty new to XML. 3) I need to know which is the best way to extract the XML from my XML file(or files). The database could potentially be quite large, and i do not want to load the whole thing in memory before using it. I also do not want to reparse the entire document each time i need to make a query on it. I have heard of XPATH, scripting, DOM and SAX. I might even use a combination of them. Does anyone know which might be the best suited? Also, has anyone ever heard of XML query language? I have available quite a variaty of books (most from Wrox press). If anyone has good suggestions for more books I could buy, please let me know. Thanks a lot for the help! Jeremy. Jeremy Pullicino Professional C++ Developer Done any hacking lately?
Don't about many Schema authoring tools. I use XML Spy for XML, XSD etc. You may want to consider using XSLT for extracting data. If you design your code to apply an XSL to extract data from the XML then you have the flexibility of changing the XSL or creating additional XSLs for extracting different parts of the XML database wityhout having to change your code. Just an idea....
-
Hello guys, I am designing an XML database and need some pointers. The database i am designing will be used to store configuration information - it will be similar to the type of database that a firewall might have - different rules with different settings. It will not be used on any special web application - it will be used as an internal configuration database for a local C++ application. I wanted to know if: 1) There are any XML/XML schema authoring tools which will assist me in creating the database and its relationships. 2) There are any XML schemas that exist which are similar to the model I am looking for. I could use these for reference since i am pretty new to XML. 3) I need to know which is the best way to extract the XML from my XML file(or files). The database could potentially be quite large, and i do not want to load the whole thing in memory before using it. I also do not want to reparse the entire document each time i need to make a query on it. I have heard of XPATH, scripting, DOM and SAX. I might even use a combination of them. Does anyone know which might be the best suited? Also, has anyone ever heard of XML query language? I have available quite a variaty of books (most from Wrox press). If anyone has good suggestions for more books I could buy, please let me know. Thanks a lot for the help! Jeremy. Jeremy Pullicino Professional C++ Developer Done any hacking lately?
Jeremy Pullicino wrote: I am designing an XML database and need some pointers. Just quickly have a look at TeXtML[^] for an actual XML Database. Also they maky have whitepapers and links to resources on XML databases. Jeremy Pullicino wrote: Also, has anyone ever heard of XML query language? Yes, read about it at W3C and Google has plenty of links. FYI XSL is used for transforming XML while XQuery is for querying. Though in reality they are very similar and people chop and change between them.
Paul Watson
BlueGrassGroup.com
Cape Town, South Africa -
Don't about many Schema authoring tools. I use XML Spy for XML, XSD etc. You may want to consider using XSLT for extracting data. If you design your code to apply an XSL to extract data from the XML then you have the flexibility of changing the XSL or creating additional XSLs for extracting different parts of the XML database wityhout having to change your code. Just an idea....
Thanks about the XML Spy tip, I will make sure to download a copy of it today. I am worried about XSL for extracting data since performance is an issue for me (this database is read many times every second, from multiple threads, 24hrs a day). I was thinking of dynamically creating a schema with the fields I will want, and then extracting the data into that schema - however, I am stil learning about XML, so this might be too advanced for me right now. Thanks for the tips though :) XML is truly great. Jeremy Pullicino Professional C++ Developer Done any hacking lately?
-
Jeremy Pullicino wrote: I am designing an XML database and need some pointers. Just quickly have a look at TeXtML[^] for an actual XML Database. Also they maky have whitepapers and links to resources on XML databases. Jeremy Pullicino wrote: Also, has anyone ever heard of XML query language? Yes, read about it at W3C and Google has plenty of links. FYI XSL is used for transforming XML while XQuery is for querying. Though in reality they are very similar and people chop and change between them.
Paul Watson
BlueGrassGroup.com
Cape Town, South AfricaThanks for the tips especially the links. The xml database looks good - their site gave me many tips on how XML could be used in databases. Jeremuy. Jeremy Pullicino Professional C++ Developer Done any hacking lately?
-
Thanks about the XML Spy tip, I will make sure to download a copy of it today. I am worried about XSL for extracting data since performance is an issue for me (this database is read many times every second, from multiple threads, 24hrs a day). I was thinking of dynamically creating a schema with the fields I will want, and then extracting the data into that schema - however, I am stil learning about XML, so this might be too advanced for me right now. Thanks for the tips though :) XML is truly great. Jeremy Pullicino Professional C++ Developer Done any hacking lately?
The fastest way to extract data from an XML document is to use SAX (Simple API for XML)[^]. All major vendors provide an implemetaion, but it is not a standardized API (a standards body does not control the API) - it is a de fecto standard. SAX uses a streaming model where the XML parser notifies your applicaiton whenever it reads a part of the document and provides the details to you in plain text. There's a good article, part of which describes the SAX programming model at the 'other' site[^]. SAX scales well, but if you're still concerned about performance then you can just read the XML directly usinng file I/O and parse it yourself - that's as efficient as it gets but is difficult to maintain. Jeremy Pullicino wrote: dynamically creating a schema with the fields I will want No need to do this - see my other post about getting data from an XML document. That post uses the DOM, which may end up being too slow for your needs. Again, you can use SAX bu then extracting the relevant data is left an an excercise for you or you can od the do-it-yourself route and again have to deal with that issue but with the benefit of muh better performance. Erik Westermann Author, Learn XML In A Weekend (Fall 2002)