I've wrote an iview which renders and iview just like the .net using sap's xml and I'm trying to get it working. I think the iView server is having some problems with characters but I'm not sure how to replace them without extensive code..
in .net I can simply do this:
temp = Replace(temp, "href=""", "target=""_new"" href=""")
but I'm thinking I cannot use string.replaceAll or string.replace because we must use sdk 1.3.1 instead of 1.4.. and I dont want to tokenize etc.. unless I have to. Is there an easy way to replace characters in a string so my xml will not have problems because when it renders through the iview server it says:
"Incorrect syntax was used in a comment."
I need to replace all odd characters and html encode the &, "," etc.. any advice?
// This program written by John Mittendorf
// as a template for the SAP XML iView parcer
// This program in particulat goes to http://www.chron.com (Houston Chronicle Newspaper)
// and dnloads the top stories form the web page
// This program opens a stream from a url and
// is used to then parse the url for content in
// a format that the SAP Portal can understand
public class aportalparser extends AbstractPortalComponent
public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
InputStream incommingStream = null;
int EndPos = 0;
//Write xml for iView server.. note the escape char ..language="HyperRelational".. the "" for the ""
//See the portal iView dev docs for detail on the xml
//Code to nab the url data and put it into a stream
uRL = new URL("http://www.chron.com");
incommingStream = uRL.openStream();
dis = new DataInputStream(new BufferedInputStream(incommingStream));
while ((incommingString = dis.readLine()) != null)
buff += incommingString; //reads one line at a time and concatenates
//tweak the buffer and thin it down between content search points
TOP STORY2 VIGNETTE LIST
->", StartPos + 32));
>", StartPos)+ 0);
//start parsing.. page is nasty so the code is also...
//reset the string parse points for the tweaked buffer
StartPos = 0;
//start to search here.. we need to grap one before the loop
StartPos=(tweaked.indexOf("Cassius called", StartPos + 14));
//nab top article
StartPos = (tweaked.indexOf("");