我希望在XSL/FO中反转for-each循环.
例如xml
<data>
<record id="1"/>
<record id="2"/>
<record id="3"/>
<record id="4"/>
<record id="5"/>
<record id="6"/>
</data>
Run Code Online (Sandbox Code Playgroud)
与xsl
<xsl:for-each select="descendant-or-self::*/record">
<xsl:value-of select="@id"/>
</xsl:for-each>
Run Code Online (Sandbox Code Playgroud)
我正在寻找输出654321而不是123456
这怎么可能?
我不知道为什么使用POI编写的文件不能由Excel 2013打开,但POI仍然可以读取该文件.(单元格值可以更改)
这是文件中的错误
这是代码
FileInputStream fis = null;
try {
fis = new FileInputStream(fileUri); //not error at fileUri
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String urii = fileUri.replace(".xls", "0.xls"); //not error
File fisx = new File(urii);
Workbook workbook = null;
workbook = new HSSFWorkbook(fis);
Sheet sheet = workbook.getSheetAt(0);
Row row = sheet.getRow(0);
Cell cell = row.getCell(0);
String p = cell.getStringCellValue();
TextView a = (TextView) findViewById(R.id.txtUri);
cell.setCellValue(new String("popo"));
String x = cell.getStringCellValue();
TextView b …Run Code Online (Sandbox Code Playgroud) 我目前正在使用使用Driver嵌入式的FOP,如下所示
Driver driver = new Driver();
driver.setRenderer(Driver.RENDER_PDF);
driver.setInputSource(new InputSource(new FileInputStream(tempout)));
File tempFile = File.createTempFile("W2P", ".pdf");
FileOutputStream pdfOutput = new FileOutputStream(tempFile);
tempFile.deleteOnExit();
driver.setOutputStream(pdfOutput);
driver.run();
Run Code Online (Sandbox Code Playgroud)
但是我想以编程方式访问配置设置,特别是输出分辨率,因为我必须生成多个分辨率文件72dpi 150dpi 300dpi,我唯一能做到这一点的方法是更改为FOPFactory,如下所示
FopFactory fopFactory = FopFactory.newInstance();
OutputStream out = new BufferedOutputStream(new FileOutputStream(new File("C:/Temp/myfile.pdf")));
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out);
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(); // identity transformer
Source src = new StreamSource(new File("C:/Temp/myfile.fo"));
Result res = new SAXResult(fop.getDefaultHandler());
transformer.transform(src, res);
Run Code Online (Sandbox Code Playgroud)
是否可以使用驱动程序来控制FOP引擎,或者我必须切换到FOPFactory?这样做有什么好处/问题?
我在数据库中有一个变量映射,我想在网页上显示详细信息,前端是struts2.我试过这个
<html:iterator value="fields" id="field">
<html:textfield name="#field.value" key="#field.value" label="#field.key"/>
</html:iterator>
Run Code Online (Sandbox Code Playgroud)
显然这不起作用,我怎么能轻松获得密钥名称,所以我可以有这样的代码
想法是显示如下
Name: [ ]
Random: [ ]
Something: [ ]
Run Code Online (Sandbox Code Playgroud)
作为表单中的文本字段...
我怎么能这么做呢?
java ×3
android ×1
apache-fop ×1
apache-poi ×1
excel ×1
forms ×1
struts2 ×1
xml ×1
xsl-fo ×1
xslt ×1