Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

best practice application in xml

Status
Not open for further replies.

WebRic

Technical User
Sep 21, 2004
95
0
0
GB
Hi,

I'm not too sure of the correct way to use xml. I can create a xml file relatively easily but I've never been sure of the best way top use it to pass lots of data.

i.e if I have ten thousand clients with full personal and address details would this be ok to stick in 1 xml file or should I really put each clients details in separate xml files? How big can an xml file get before its not useful anymore? What are the best methods or passing large amounts of data?

NB. I will use xml in a mainly online environment, although this will be connected with some offline systems.

Thanks for any advice,

Richard
 
XML is great for passing data around multiple systems, some online, some disconnected etc.. I generally stick to one XML file per 'transaction' .. and develop the schema's based on this.

For example your xml could take on the structure:

<root>
<function>update</function>
<data>
<client id="12345">
<newvalue field="name">joe</newvalue>
<newvalue field="age">21</newvalue>
</client>
<client id="54321">
<newvalue field="telephone">0123456789</newvalue>
</client>
</data>
</root>

You could have one, or multiple clients in that xml file, depending on what you were doing with the transaction.

In the example above, I have an element called 'function' that contains the data 'update'.. Theoretically, my program could be built to interpret that as "any clients in this file need to have it's data updated" and extract the information from the data element.

As it is, there are two clients in this file, but this could be easily one hundred or ten thousand (you would perhaps have to consider why are you processing ten thousand records at once, but it is possible all the same.)

I hope this gives you some idea's!



------------------------
Hit any User to continue
 
Heres a link you might consider....


Also - I haven't used XML to store any considerable amount of data (othe rthan the occasional config file). Why bother simulating a database environment when you can use MS Access, SQL or another relational db.

------------------------
Hit any User to continue
 
You should be using a database. XML is not good for large amounts of data. Use XML for small, highly structured data.

Jon

"I don't regret this, but I both rue and lament it.
 
Great stuff, that's exactly the info I needed.

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top