Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

XML Usage

Posted on 2005-04-18
12
Medium Priority
?
320 Views
Last Modified: 2012-05-05
Ok here goes....

I use XML very infrequently, however i have used it a bit, but i think i should be using it a lot more.

I think my question is, when should i be using it...

Basically, the application i'm writing at the moment are business web applications, that is they are used primarily in-house and not generally moving a lot of information around over the internet.

Aside from configuration and the like, where should i be utilizing the power of XML?

Does anybody use a lot of XSL to format their ASP.NET pages?

I understand this is a bit of open ended question but i'm just interested in where people use xml in asp.net applications.

Great, thanks!
T25

0
Comment
Question by:Type25
12 Comments
 
LVL 8

Expert Comment

by:razo
ID: 13805501
u can use xml for simple data such as the users who can access the website....
it is better to use dbms when concerned with relaional data with select,insert and update
0
 
LVL 9

Author Comment

by:Type25
ID: 13805577
I use forms based authentication and a database to handle the users, it's more managable that way. Otherwise you're just talking about using a flat file essentially, which isn't as easy to update for others (?)
0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 13805627
We have used xml to
1) Fetch/update data - We have a data access layer component which accepts parameter in xml format .. the SP to be used, parameters etc... also some of the methods directly uses the SQL servers xml functionionality to update database ..
2) To store static data in xml files and make create cache objects which are dependent on these files ..
3) In house project - fetch and update data in xml format by using xmlhttp to call web service methods

>>Does anybody use a lot of XSL to format their ASP.NET pages?
Too complex, but very effective if you design it well. Would be more usedful if u have multiple devices used by the user to view the information .. and not just a browser ..
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Author Comment

by:Type25
ID: 13805662
Rejo, what are the advantages of fetching/updating data using XML?

Also, why would you *not* create your data access layer using standard classes with static methods?

Interested to know why you need to pass the sp name and parameters as xml ...etc??

Thanks
0
 
LVL 52

Assisted Solution

by:Carl Tawn
Carl Tawn earned 400 total points
ID: 13805716
Personally I think there is less need to pass XML around in an Object Oriented application, except for things like web services. I personally use XML/XSLT a lot in COM+ applications with classic ASP.

XML is very good for describing the data itself and any state information relating to the data. Its then a lot simpler to simply apply an XSL Transform to display the data rather than manually trawling through a recordset or other storage mechanism.

XML is also good for interoperability. If an industry uses a standard XML definition (i.e. Schema), then its a lot easier for businesses to pass information amongst themselves, and because it is self-describing its also easier for non-technical people to understand.

Just my "two cents", but I hope it helped.
0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 13805844
Just to set some standards. Our in-house development has uses grid ocx controls wherever we have to use grids to view/add/edit data. This grid gives us the flexibility of giving the user options to edit/delete multiple records, group/filter data on the fly etc . but then it has the disavantage that as it is not a server control, it is not directly accesible on the server .. so we use XMLHTTP to call web methods to do operation on databse .. so we have defined standards on how the the data has to be send to the Data acess layer (DAL) .. specific format .. so these web methods also get the data in these formats and then just call the respective DAL's method. some of the advantages of using xml strings to update/retrive data is that all the database operations are encapsulated with the DAL and the developer is just worried about sending the data in the correct xml format .. an example of our xml string would be
<sqlBatch >
      <batchParam defaultConStr=”ConnectionString" />
      <sqlCall exType="storedProc" recSet="yes">SPName
               <param paramType="Varchar">Test</param>
               <param paramType="Date">01-Aug-2005</param>
               <param paramType="Integer">1</param>
               <param paramType="Double"></param>
        </sqlCall>
      <sqlCall exType="storedProc" recSet="yes" connectStr=”Another Coonection String“>another SP or Same SP
               <param paramType="Varchar"></param>
               <param paramType="DATE"></param>
               <param paramType="Integer">1</param>
               <param paramType="Double">NULL</param>
        </sqlCall>
      <sqlCall exType="cmdText" recSet="yes">select * from tablename
        </sqlCall>
</sqlBatch>

Transaction handling is done by the DAL, different databases (Oracle or SQL server or 2 different instances of SQL server etc) can be updated using one call, multiple records can be updated using one call (master transaction scenario), the connectionstring does not necessarily have to provided in the xml string if u are updating the same database. Methods are exposed for it. Other methods exposed are  connection timeout, setnocount for SPs, Transaction handling etc etc ...

Instead of SP, u can also create Views and use them .. security is handled by giving execute permissions to the respective users and no select/insert/delete permissions given to users (one of reason - SQL injection) .. etc etc ...
0
 
LVL 9

Author Comment

by:Type25
ID: 13805940
Are there any resources/books out there that cover this sort of stuff... ?  By that i don't mean the xml syntax, i mean real world example of where xml can be utilized?

0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 13806023
I have not seen any .. let me kwow if u do find some reference ...
0
 
LVL 9

Author Comment

by:Type25
ID: 13806046
That's the annoying thing, everything is xml syntax and not much about real world usage.

I'm sure i could dream up some ways of utilizing XML in our applications but i'd like to know whether i'm doing it the right way, if you see what i mean.

0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 13806286
a real world example i could think of is
consider a case where u r receiving a lot of information from different organisation and u want to consolidate them or just display them in ur web site .. assuming the data received is in xml format, but different format, will u keep changing ur web page for every new provider u get? In this case, ur code will losts of if.. then or select case .. statements .. consider the other way round too .. lets say u r a provider who has to provide data to lots of information to various clients .. will u not prefer to send them in one universal format i.e. XMl and lets say the clients insist on u following their format and u do not want to loose them, then will u create different codes for all new clients or just use XSL to format the data as per the client's need .. hmmm???

0
 
LVL 26

Accepted Solution

by:
Rejojohny earned 1600 total points
ID: 13806327
some examples i could find .. maybe u could have a look at this and decide whether they are applicable to ur scenario too

Web Services Case Studies
http://www.microsoft.com/net/business/casestudies.asp

Using XSL to display data
http://www.permadi.com/tutorial/xmlExamples/

http://tutorials.findtutorials.com/read/id/173

Haven't read this one .. maybe u would like to ...
http://www.microsoft.com/office/xml/xmlproject.mspx
0
 
LVL 9

Author Comment

by:Type25
ID: 13806413
Great, when i get some time i'll have a look at those.

Thanks for the advice all.

0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

569 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question