Subject: RE: [xsl] addParameter method and MSXML From: "Bruce Rojas-Rennke" <brr@xxxxxxx> Date: Tue, 26 Aug 2003 09:15:36 -0600 |
Hello Americo & Jen, reading your comments, I modified my code as below, I think I'm getting closer, like I said I think the wierd part for us newbies is understanding this create processor part, I understood creating XMLinput & XSLinput objects, but the processor part seems like a 3rd step that doesn't quite mesh (to me). hows this look? ------------------------------------------------------------------------ <cfobject type="com" action="create" class="MSXML2.FreeThreadedDOMDocument" name="XSLinput"> <cfset XSLinput.async = "false"> <cfset XSLinput.load("http://127.0.0.1/ddm/apTransDetail.xslt")> <cfobject type="com" action="create" class="MSXML2.FreeThreadedDOMDocument" name="XMLinput"> <cfset XMLinput.async = "false"> <cfset XMLinput.load("http://127.0.0.1/ddm/apAgingDetail_rs.xml")> <cfset XSLProcessor = XSLinput.createProcessor> <cfoutput> <cfset XSLProcessor.addParameter("urlVar","#url.item#")> </cfoutput> <cfset XSLProcessor.input = "XMLinput"> <cfset result = XSLProcessor.transform(XSLinput)> <cfoutput> #result# </cfoutput> ------------------------------------------------------------------------ gracias nuevas, - Flashlight -----Original Message----- From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Américo Albuquerque Sent: Monday, August 25, 2003 6:33 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: [xsl] addParameter method and MSXML Hi. I don't know this cfobject language but it seams to me that the problem is a name one. I'll try to explain what I mean using the name of your objects You create a XSLinput object ans load a xslt file, this object is a FreeThreadedDOMDocument You create a XSLTinput ans set is stylesheet to XSLinput, this object is a XSLTemplate You create a XMLinput and load a xml document, this is a DOMDocument object You create a XSLProcessor from a XSLTemplate. Is this an object? If so where is it created? If no, where do you relate this object to XSLTinput? Is here where your code fail. Check your syntax and see where you'll have to change and what you need to change. You might need to add the relationsheep between XSLProcessor and XSLTinput just change the creation process to something like <cfset XSLProcessor = XSLTinput.createProcessor> Hope this helps Regards, Americo Albuquerque > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of > Bruce Rojas-Rennke > Sent: Tuesday, August 26, 2003 12:54 AM > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: RE: [xsl] addParameter method and MSXML > > > Hey Jen, > > My brain's getting mildew, would you have a moment to look > at below code and see if anything wrong jumps out at you? I > seem to get confused with the part where I create the XSL > processor and feed it.. > > -------------------------------------------------------------- > -------------- > --- > > <cfobject type="com" > action="create" > class="MSXML2.FreeThreadedDOMDocument" > name="XSLinput"> > <cfset XSLinput.async = "false"> > <cfset XSLinput.load("http://127.0.0.1/ddm/apTransDetail.xslt")> > > <cfobject type="com" > action="create" > class="MSXML2.XSLTemplate" > name="XSLTinput"> > <cfset XSLTemplate.stylesheet = "XSLinput"> > > <cfobject type="com" > action="create" > class="MSXML2.DOMDocument" > name="XMLinput"> > <cfset XMLinput.async = "false"> > <cfset XMLinput.load("http://127.0.0.1/ddm/apAgingDetail_rs.xml")> > > <cfset XSLProcessor = XSLTemplate.createProcessor> > <cfoutput> > <cfset XSLProcessor.addParameter("urlVar","#url.item#")> > </cfoutput> > > <cfset XSLProcessor.input = "XMLinput"> > > <cfset result = XSLProcessor.transformNode("XSLinput")> > > <cfoutput> > #result# > </cfoutput> > > -------------------------------------------------------------- > -------------- > --- > > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of > Jennifer Phillips > Sent: Friday, August 22, 2003 5:35 AM > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: RE: [xsl] addParameter method and MSXML > > > >Q: what class do I invoke to use the addparameter method > with MSXML 4.0 > >? my code below- my question refers to the COM object named > 'XSLinput', > >- > what > >class should I use there so I can use the addParameter > method widdit? > >Never mind the Cf bits, code is just shown here to be thorough.. > > Here is a example I wrote for another lister, shouldnt be > that hard to understand, to use it for MSXML 4.0, just add > .4.0 after all the class > names. Its a little different from a basic transformation without > parameters, you have to use the XSLTemplate and > IXSLProcessor, but its not that difficult. > > Dim XSL > Dim XSLTemplate > Dim XSLProcessor > Dim XMLDom > > ' Create a DOM for the XSLT > ' For some reason it must be FreeThreaded to work with > XSLTemplate in MSXML3 set XSL = > Server.CreateObject("MSXML2.FreeThreadedDOMDocument") > > ' Load in your stylesheet > XSL.Load "C:\xslt\brockTest2.xsl" > > ' Create the template object (Allows you to pass parameters) > set XSLTemplate = Server.CreateObject("MSXML2.XSLTemplate") > > ' Assign the XSLTemplate the style sheet you wish to use. > > set XSLTemplate.stylesheet = xsl > > set XMLDom = Server.CreateObject("MSXML2.DOMDocument") > > 'Load an XML > XMLDom.load("c:\xslt\test.xml") > > ' Create an XSL processor from the template > set XSLProcessor = XSLTemplate.createProcessor > > ' Add the parameter ' "DirectoryName" parameter must exist in > the XSLT XSLProcessor.addParameter "DirectoryName", > server.MapPath("/") ' > > ' Tell the XSLProcessor what the XML input is. > XSLProcessor.input = XMLDOM > > ' Do the transformation > XSLProcessor.transform > > ' Write out the result > Response.Write XSLProcessor.Output > > > If you have any questions let me know. > > Jen > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] addParameter method and M, Américo Albuquerque | Thread | RE: [xsl] addParameter method and M, Américo Albuquerque |
[xsl] <xsl:param> or <xsl:variable>, Abhijit Junnare | Date | RE: [xsl] <xsl:param> or <xsl:varia, Kienle, Steven C [IT |
Month |