><?xml version="1.0" encoding="utf-8" ?> ><PlugInEvents> > <PlugInEvent> > <Name>Application.Startup</Name> > <Description>Occurred when application startup</Description> > <MustImplementTypes> > <MustImplementType> > <Type>IApplication</Type> > <EventHandler>Startup</EventHandler> > <Assembly>c:\\aaa.dll</Assembly> > </MustImplementType> > </MustImplementTypes> > </PlugInEvent> > <PlugInEvent> > <Name>Application.Shutdown</Name> > <Description>Occurred when application shutdown</Description> > <MustImplementTypes> > <MustImplementType> > <Type>IApplication</Type> > <EventHandler>Shutdown</EventHandler> > <Assembly>c:\\aaa.dll</Assembly> > </MustImplementType> > <MustImplementType> > <Type>IGlobal</Type> > <EventHandler>GlobalShutdown</EventHandler> > <Assembly>c:\\Global.dll</Assembly> > </MustImplementType> > </MustImplementTypes> > </PlugInEvent> ></PlugInEvents> >>
>Name: Application Startup >Description: Occurred when application startup >Must Implement: > Type: IApplication > EventHandler: Startup > Assembly: c:\\aaa.dll > >Name: Application Shutdown >Description: Occurred when application shutdown >Must Implement: > Type: IApplication > EventHandler: Shutdown > Assembly: c:\\aaa.dll > Type: IGlobal > EventHandler: GlobalShutdown > Assembly: c:\\Global.dll >>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns="http://www.w3.org/1999/xhtml"> <xsl:output method="text"/> <xsl:strip-space elements="*"/> <xsl:template match="/PlugInEvents"> <xsl:apply-templates /> </xsl:template> <xsl:template match="PlugInEvent"> Name: <xsl:value-of select="Name" /> Description: <xsl:value-of select="Description"/> Must Implement:<xsl:apply-templates select="MustImplementTypes"/> ----------------------------------------------------------------- </xsl:template> <xsl:template match="MustImplementType"> Type: <xsl:value-of select="Type"/> EventHandler: <xsl:value-of select="EventHandler"/> Assembly: <xsl:value-of select="Assembly"/> </xsl:template> </xsl:stylesheet>and here's how to use it to output to a file:
System.Xml.Xsl.XslCompiledTransform xslt = new System.Xml.Xsl.XslCompiledTransform(); xslt.Load("Input.xslt"); xslt.Transform("input.xml", "output.txt");