Jump to content

Same Xml Task Can Perform Using Html.


shobhit.singh783

Recommended Posts

* XML was designed to transport and store data, with focus on what data is. * HTML was designed to display data, with focus on how data looks.I think we can also use html to transport and store data as a replacement over xml.Pls put your thoughts for why we should prefer xml over html to transport and store data.My thoughts: 1) We can use xml to store and send dynamic data and for this we only have to use few lines of code. 2) We can use our own tags and not to depend on predefined tags as in html like <tr><td><br>...... etc.Your suggestions will be highly appreciated.Regards,Shobhit

Link to comment
Share on other sites

Your statement that we could use HTML instead of XML is correct, as HTML is indirectly based on XML... to be more precise, it's (directly) based on SGML, from which XML is based on.As it says, XML focuses on what data is. XHTML (the HTML version based on XML, instead of SGML) is one such language, for which "data" is "tabular data", "list data", "quote", "paragraph" and so forth. Other XML languages, like SVG for example, define data as "circle", "rectangle", "path", etc.You can use XML to create your own language that doesn't fit into these ones. You could use later translate your language into something that the environment you're working with (e.g. the browser) understands, typically XHTML. If it does fit into XHTML though, it's perfectly fine to use XHTML instead of creating your own dialect.

Link to comment
Share on other sites

Thanks in advance for replying and to share with me knowlenge!Actually this question is asked by interviewer to me that why we use xml then I told that by using xml we can store and send data.After that interviewer told me that, then tell me use of html. I told him html is used to focus on how data looks. But I strucked on point when he told me we can not use html for storing and sending data, html is nothing but xml so why we should xml and not to html. Either I did not satisfied him but I got the job. :)Regards,Shobhit

Your statement that we could use HTML instead of XML is correct, as HTML is indirectly based on XML... to be more precise, it's (directly) based on SGML, from which XML is based on.As it says, XML focuses on what data is. XHTML (the HTML version based on XML, instead of SGML) is one such language, for which "data" is "tabular data", "list data", "quote", "paragraph" and so forth. Other XML languages, like SVG for example, define data as "circle", "rectangle", "path", etc.You can use XML to create your own language that doesn't fit into these ones. You could use later translate your language into something that the environment you're working with (e.g. the browser) understands, typically XHTML. If it does fit into XHTML though, it's perfectly fine to use XHTML instead of creating your own dialect.
Link to comment
Share on other sites

For future's sake, consider saying "XHTML" instead of "HTML". Since XHTML is based on XML, they'll probably understand your point of view, and if not, it's easy to defent that position.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...