Xml?

fkheng

Well-known member
Joined
May 8, 2003
Messages
155
Location
Malaysia
What is the difference between XML and XSLT?
What can I use XML or XSLT for (whats an example of its application)?

Im asking these questions as Im trying to decide which one to learn up...
 
XML is a method of formatting a file so you can get the information you want, it acts basically like a database.
Code:
<MyXMLDocument>
     <MyHeader Prop1="Hello">
           <Name>People</Name>
           <Address>23 Something Lane</Address>
     </MyHeader>
     <MyHeader Prop1="Hello Again" Prop2="Important">
            <Name>Someone</Name>
     </MyHeader>
</MyXMLDocument>
You use the readers in System.XML to parse these documents and get the info you want, Microsoft is pushing it as a replacement for INI files, it can also be used as a database.
 
i see, hm.......but using asp.net to connect to a database, would there still be any use for my program if i use XML? can these 2 be used together?
 
Ill try to answer one by one.

Q: would there still be any use for my program if i use XML?
A:
Well, it depends on why you would like to use XML in the first place.
If you would like to create web pages that seperate content from UI (-its good to do so , for more detail search for MVC-), of course it would be good to use XML and then XSLT to convert them to HTML.
Q: can these 2 be used together?

A:
Well, it depends on the database you are using.
There are native XML databases and there are Relational Databases. Native XML databases (e.g. EXIST or Tamino) stored data as XML files. Relational database (e.g. SQL server, Oracle) stored data as tables.

Both of the database types still can accept XML, however if we use the former one (native xml database), it would be easier to store. It is still possible though to use xml together with relational databases. One can still actually traverse the XMLDocument object or XPathNavigator object and actually extract the data to store in the database, it would be quite slow though. Anyway, usually only a small part of the xml would be stored in database.

However, Ive read that some relational database have ways too to store xml directly at a predefined format or even better, but I cant comment on those.

Hope the info is useful.

Best Regards,

David Lo
 
becoz from wat i understnad from the explanations above, XML can be more efficient than normal relational databases...

so in terms of developing an internet application, im not sure whether i should go ahead with ASP.NET or can i use em together? still undecided about it...is it advisable to use them together for the same webpage?
 
i see, okay, i am learning ASP.NET now, in the process, but was curious becoz many modern internet apps seem to involve hype about XML, so i also want to try it out, but wat can i use it for? in wat kind of applications then?
 
Think of XML as just a much improved and standardized way of structuring data, just like how AndreRyan illustrated in an earlier reply. It is not a programming language like ASP.NET so you cant build apps w/ it, but a markup language like HTML. You can use it in any application if theres a requirement to structure data in an "XML-like" manner. The links provided by Bucky should give you a good tutorial on what XML is all about.
 
When you learn ASP.NET you can use XML from within your ASP.NET applications, you will still use ASP.NET but instead of communicating with Relational databses, you can if you want use XML files instead.
 
hm.........interesting, ah man, means ill have to get an XML book...

okay, just another question, er.....are there any so called "guidelines" as to when i should use a relational database or when i should use XML files for storing data? which would be appropriate so i can decide...
 
One of XMLs strong points is that its universal; any XML parser
application on any platform can get the same data from a file.
XML web services exploit this ability in a good way: they
return data in a specific XML protocol, SOAP, so that anybody can
interpret it.

So if youre looking for interoperability, that is, transferring data
beteen apps, languages, and platforms, XML is the way to go.
 
Back
Top