Friday, March 31, 2006

The default XML style in IE

Many moons ago, I had written an XML editor in Visual Basic 6. Although its primary view was a tree view on the XML, I had also put in the XML source display. For the XML source display, I used IE as a control and navigated to the XML file.
A couple of days ago, one of my colleagues wanted to display XML in a web page (in ASP.NET.) ASP.NET has a XML Display control. And this control can display the xml using a style sheet. So this time around, the idea was to get hold of the XSL that IE uses to display XML, than to actually embed IE in the app.
He eventually did not use the XSL for the display, but for later reference this is what could've been done. The XSL is embedded in msxml.dll and msxml3.dll as a string resource.
1. res://msxml.dll/DEFAULTSS.xsl or res://msxml3.dll/DEFAULTSS.xsl can be opened in IE to display the XSL. ref: http://www.perfectxml.com/articles/xml/XSLTInMSXML.asp
2. These resources can be extracted using either Visual Studio or ResHacker. Just open the dll in one of these tools and in the treeview, go to section 23, and copy/paste into notepad.
3. Place the xsl in the web app folder, and in the XML Viewer control, set the path to the xsl, either in code or using the properties window.






Technorati Tags: , , , , , ,

1 comment:

  1. I just saw this – X-Pubs 2006, Europe’s largest XML content management and publishing conference. Looks like they have Ann Rockley and JoAnn Hackos, plus Adobe, Mark Logic, XMetal, Idiom etc.

    Its on 20-21st June in London

    Have a look

    www.x-pubs.com

    XML Content management conference

    ReplyDelete