Thank you for posting your solution. I mainly do XML from within a program too. > Date: Fri, 7 Aug 2009 13:36:45 -0400 > From: [email protected] > To: [email protected] > Subject: Re: [U2] xml mapping file question > > So here is how I did it. > > To recap. I wanted to include the xsl-stylesheet in the xml document > that is produced by XMLExecute(). Below is the code that produced the > desired result. > > > PROGRAM STDCSTXML > $OPTIONS INFORMATION > $INCLUDE UNIVERSE.INCLUDE XML.H > > > ;* CMD is the paragraph that we want to run > ;* OPTIONS are the paramters that you would normally pass to TOXML > CMD = "SORT STOCKFILE WITH QTY GT 0 DESC UM STATDESC QTY STD.CST > TOTAL TOTCST" > OPTIONS = "ELEMENTS" > STATUS = XMLExecute(CMD,OPTIONS,XML.VAR,XSD.VAR) ;* XML.VAR > holds the variable that we'll use to create a dynamic array (DA) > PARSE = XML.VAR ;* PARSE is now the DA > > PARSE = CONVERT('>',@VM,PARSE) ;* Use CONVERT function to > convert all ending '>' in each XML elemetn to Value Marks > > LOCATE '?' IN PARSE<1,1> SETTING X ELSE ;* dimension the DA and > find the first ? in the DA > ;* Insert the new XML stylesheet element into the DA > PARSE = INSERT(PARSE,1,2,0,'<?xml-stylesheet type="text/xsl" > href="http://cicnet.celestecorp.com/cms/xml/xslt/cilstdcst.xsl"?') > END > PARSE = CONVERT(@VM,'>',PARSE) ;* convert the VM's back to '>' > OPEN '','XMLREPORTS' TO FILE THEN ;* Open the folder and write to it. > WRITE PARSE TO FILE, 'stdcst.xml' > END > END ;*Rinse, repeat, =) > > > > I'll also add that I created the file called XMLREPORTS as a Type 19, > then edited the voc record for XMLREPORTS to actually point to a > shared folder on our Intranet web server. > > This works flawlessly for me and I hope that it may also help someone > else in the future. Oh and management loves it and is now wanting to > do this for a lot of general purpose reports. > > Enjoy, > Norm > _______________________________________________ > U2-Users mailing list > [email protected] > http://listserver.u2ug.org/mailman/listinfo/u2-users
_________________________________________________________________ Express your personality in color! Preview and select themes for HotmailĀ®. http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:WM_HYGN_express:082009 _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users
