|
Re: Create XML Data source using DE API [message #1022388 is a reply to message #1021631] |
Thu, 21 March 2013 19:27 |
|
Vinoth
Have you tried setting the FILELIST property of your datasource using script?
If you were passing in a parameter with the xml file location you could do it like:
//Data source beforeOpen
this.setExtensionProperty("FILELIST", params["myxmllocation"].value);
|
|
|
|
|
|
Re: Create XML Data source using DE API [message #1029786 is a reply to message #1027606] |
Sat, 30 March 2013 06:00 |
|
I do not have an example of this but if your xml data source is nested in a table that contains clob xml you may be able to set the xml stream in the oncreate of the data item. As a simple example in a beforeOpen script on an xml data source you can do something like:
importPackage( Packages.java.io );
var mystr = "<?xml version=\"1.0\"?>";
mystr = mystr + "<library>";
mystr = mystr + "<book category=\"COOKING\">";
mystr = mystr + "<title lang=\"en\">The test3 Cook Book</title>";
mystr = mystr + "<author name=\"Miguel Ortiz\" country=\"es\"/>";
mystr = mystr + "<sold>10,312</sold>";
mystr = mystr + "<year>2005</year>";
mystr = mystr + "</book>";
mystr = mystr + "<book category=\"CHILDREN\">";
mystr = mystr + "<title lang=\"en\">Everyone is Super Special</title>";
mystr = mystr + "<author name=\"Sally Bush\" country=\"uk\"/>";
mystr = mystr + "<sold>8,222</sold>";
mystr = mystr + "<year>2005</year>";
mystr = mystr + "</book>";
mystr = mystr + "<book category=\"AUTOBIOGRAPHY\">";
mystr = mystr + "<title lang=\"en\">Japanese Greetings</title>";
mystr = mystr + "<author name=\"Taro Yamada\" country=\"uk\"/>";
mystr = mystr + "<sold>7,852</sold>";
mystr = mystr + "<year>2005</year>";
mystr = mystr + "</book>";
mystr = mystr + "<book category=\"WEB\">";
mystr = mystr + "<title lang=\"en\">Query Kick End</title>";
mystr = mystr + "<author name=\"James McGovern\" country=\"us\"/>";
mystr = mystr + "<sold>15,111</sold>";
mystr = mystr + "<year>2006</year>";
mystr = mystr + "</book>";
mystr = mystr + "<audio format=\"CD\" category=\"MUSIC\">";
mystr = mystr + "<title lang=\"en\">Feels Like Home</title>";
mystr = mystr + "<artist name=\"Norah Jones\" country=\"us\"/>";
mystr = mystr + "<sold>9,675</sold>";
mystr = mystr + "<year>2005</year>";
mystr = mystr + "</audio>";
mystr = mystr +"</library>";
JavaStr = new java.lang.String( mystr );
bais = new ByteArrayInputStream( JavaStr.getBytes());
appcon = reportContext.getAppContext();
appcon.put("org.eclipse.datatools.enablement.oda.xml.inputStream", bais);
In your case you would read the value in the oncreate of the data item containing the clob and then then nested dataset should pickup the new inputStream for each row.
|
|
|
Powered by
FUDForum. Page generated in 0.04812 seconds