Looks like it's converting inStr to XML, doing a quasi-XPath query to pull out the text of the first PRE tag within the BODY tag, and then splitting it into a Java array based on space characters. The regex used for the .split() call is kind of silly, just " +" would have been sufficient. I don't actually know anything about the XMLPassing class, so I could be off base.
cheers, barneyb On Tue, May 5, 2009 at 9:27 AM, Ciliotta, Mario <[email protected]> wrote: > > Hi all, > > I have been asked to convert a JAVA/JSP application over to CF and I > absolutly lost as to what this section of code is trying to do. The > original developer, along with knowledge and documentation of the > application are long gone. > > I am especially confused on this section of code: > XMLPassing ps = new XMLPassing(inStr); > String txtTime = ps.getTextByTags("body/pre"); > String[] tmArr = txtTime.split(" {1,}+"); > > If anyone could give me a quick and dirty over view of what is happening > that would be great. > > Thanks > Mario > > > public Vector getFileVct() > throws Exception > { > String method = "getFileVct()"; > String inStr0 = getInputString(); > > Vector fVct = new Vector(); > > String inStr = TextKit.replaceString(inStr0, "<br>", > ""); > inStr = TextKit.replaceString(inStr, "<hr>", ""); > inStr = TextKit.replaceString(inStr, "<html>", ""); > inStr = TextKit.replaceString(inStr, "</html>", ""); > inStr = TextKit.replaceString(inStr, " ", ""); > > inStr = "<instr>" + inStr + "</instr>"; > > //inStr = > "<instr>,<body>,<pre>asdfas<a>qwe</a>|12323</pre></body></instr>"; > XMLPassing ps = new XMLPassing(inStr); > String txtTime = ps.getTextByTags("body/pre"); > String[] tmArr = txtTime.split(" {1,}+"); > > if(tmArr.length < 7) { > Trace.appLog(method, "Error reading, inStr0: " + > inStr0); > Trace.appLog(method, "Error reading, inStr: " + inStr); > // Trace.appLog(method, "Error reading > txtTime: " + txtTime); > return fVct; > } > > String txtTime2 = tmArr[1] + " " + tmArr[2] + tmArr[3] + > " " + tmArr[4] + tmArr[5]; > Trace.appLog(method, "txtTime2:" + txtTime2); > //txtTime2 = DateKit.format(txtTime2, "MMM > dd,yyyy hh:mmaa", "yyyy-MM-dd kk:mm"); > txtTime2 = DateKit.format(txtTime2, "MMM dd,yyyy > hh:mmaa", "yyyy-MM-dd HH:mm"); > //Trace.appLog(method, "txtTime2_formated:" + txtTime2); > > Element elm = ps.getNodeByTags("body/pre"); > XMLPassing ps2 = new XMLPassing(elm); > Vector nodes = ps2.getNodesByTagName("A"); > Element a2 = (Element)nodes.get(1); > > String fName = XMLPassing.getText(a2); > //String fName = ps.getTextByTags("body/pre/A"); > //String txt = XMLPassing.getText(elm); > > FileNode fn = new FileNode(fName, txtTime2); > fVct.add(fn); > > //Trace.appLog(method, inStr); > Trace.appLog(method, txtTime + "|" + fName); > > return fVct; > } > > =============================================================================== > Please access the attached hyperlink for an important electronic > communications disclaimer: > http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html > =============================================================================== > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322180 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

