I'm using this code to create a document.
I'm later adding some nodes and then saving the file. Below is a very stripped down version of one of the files.Code:Public Sub CreateXMLDoc(sFile As String) Set objDoc = New MSXML2.DOMDocument Set objNode = objDoc.createElement("report") Set objAttrib = objDoc.createAttribute("projectname") objAttrib.Value = sFile objNode.Attributes.setNamedItem objAttrib objDoc.appendChild objNode End SubWhat I would like to do is assign an XSL stylesheet the the XML through code like the example belowCode:<?xml version="1.0"?> <report projectname="C:\Documents and Settings\mthesing\Desktop\Copy of RTP Code Drop 03-20-07"> <file name="netlinks.asp" id="701"> <totallines>44</totallines> <codelines>38</codelines> <commentlines>6</commentlines> <created>4/10/2007 11:42:46 AM</created> <modified>1/18/2007 2:54:37 PM</modified> <filetype>Active Server Document</filetype> <size>1.03 KB</size> </file> <file name="stylesheet.asp" id="702"> <totallines>1</totallines> <codelines>1</codelines> <commentlines>0</commentlines> <created>4/10/2007 11:42:46 AM</created> <modified>5/26/2006 11:05:17 AM</modified> <filetype>Active Server Document</filetype> <size>0.08 KB</size> </file> <summary> <totaldirectories>23</totaldirectories> <totallines>99,838</totallines> <totalcodelines>91,773</totalcodelines> <totalcommentlines>8,065</totalcommentlines> </summary> </report>How do I do this?Code:<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="aspreport.xsl"?> <report projectname="C:\Documents and Settings\mthesing\Desktop\Copy of RTP Code Drop 03-20-07"> <file name="netlinks.asp" id="701"> <totallines>44</totallines> <codelines>38</codelines> <commentlines>6</commentlines> <created>4/10/2007 11:42:46 AM</created> <modified>1/18/2007 2:54:37 PM</modified> <filetype>Active Server Document</filetype> <size>1.03 KB</size> </file> <file name="stylesheet.asp" id="703"> <totallines>1</totallines> <codelines>1</codelines> <commentlines>0</commentlines> <created>4/10/2007 11:42:46 AM</created> <modified>5/26/2006 11:05:17 AM</modified> <filetype>Active Server Document</filetype> <size>0.08 KB</size> </file> <summary> <totaldirectories>23</totaldirectories> <totallines>105,111</totallines> <totalcodelines>97,046</totalcodelines> <totalcommentlines>8,065</totalcommentlines> </summary> </report>


Reply With Quote