BizTalk Utilities CV ,   Jobs ,   Code library
 
Go to the front page to continue learning about XML or select below:

Contents

ReBlogger Contents

Previous posts in .NET XML, System.XML

 
 
Page 19771 of 20217

Building Custom XmlResolvers Article on MSDN XML Developer Center

Blogger : Mark Fussells XML
All posts : All posts by Mark Fussells XML
Category : .NET XML, System.XML
Blogged date : 2004 Oct 03

In between re-writing and updating the chapters for the beta version of the my book A First Look at ADO.NET and System.Xml V2.0, I found some time to write an article on Building Custom XmlResolvers for MSDN. What`s so great about this class is that it enables you to redirect the location of the XML that you want to load, as well as allowing you to define your own schemes, if necessary (e.g. db:// to load from a database). There are all sorts of great things that you can do with an XmlResolver and you can come up with some fairly intelligent caching solutions if your applications needs this. One aspect that I did not cover in this article is the use of the credentials property of the XmlResolver which there is a good KB article about here

As this went to press I was talking to a PM on the Frontpage team who complained that one problem they were having is that they did multiple round trips to a SQL Server data base in order to load stylesheets i.e. one trip per include and this was obviously having a impact on stylesheet compile time in some scenarios. No problem I said, simply write your own XmlResolver that batches up all the requests into a single batch call to the database and caches them in-memory. You will need to parse the s in advance is order to know which stylesheets to load, but a quick read with an XmlTextReader on the XSLT stylesheet can tell you the list, which you can then give to the XmlResolver.

It would be good to hear of any uses that you have for custom XmlResolvers in your applications.


Read comments or post a reply to : Building Custom XmlResolvers Article on MSDN XML Developer Center
Page 19771 of 20217

Newest posts
 

    Email TopXML