xslt-1.0

How to change Apache FOP Xalan XSLT Processor?

天涯浪子 提交于 2019-12-21 16:57:30
问题 I am using Apache FOP 1.1.I want to change current apache Xalan XSLT processor to other for supporting XSLT 2.0. Currently it is not supporting XSLT 2.0. Please help me how to solve this problem. thank you. 回答1: I got my Answer. TransformerFactory has a plug-ability layer. JAXP provides a common Java interface that allows flexibilty to add various implementations of the supported standards XSLT processors. TransformerFactory tFactory = TransformerFactory.newInstance(); This had look-up

How to get maximum value under same node in xslt

核能气质少年 提交于 2019-12-21 07:34:32
问题 I have a xml like below : <Report xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Name>HourlyReport</Name> <Id>8</Id> <TotalResults>1</TotalResults> <TotalPages>1</TotalPages> <Items> <Item> <Id>1</Id> <Hour0>23</Hour0> <Hour1>12</Hour1> <Hour2>7</Hour2> <Hour3>18</Hour3> <Hour4>32</Hour4> . . . <Hour20>28</Hour20> <Hour21>39</Hour21> <Hour22>51</Hour22> <Hour23>49</Hour23> </Item> </Items> </Report> i Need maximum value from above XML

Get file name using xsl

為{幸葍}努か 提交于 2019-12-21 03:47:15
问题 How can I get the file name using xsl 1.0? I tried <xsl:value-of select="base-uri()" /> but got "Fatal Error! Could not find function: base-uri" 回答1: There is no such XPath function, or XSLT extension to XPath function to do this in XSLT v1/XPath v1. It is quite possible for there to be no file, and even if there is no reason for the XSLT engine to have that file name (consider loading the file content into a buffer, parsing the buffer into a DOM and then passing the DOM to the XSLT processor

How to add header and footer for every pages in xsl-fo to generate pdf

我只是一个虾纸丫 提交于 2019-12-21 03:37:15
问题 please find the following xsl-fo , tried to set header and footer for every page in pdf, but got only header at first page and footer at last page. But here i needed for every page. How to perform this. <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:template match='/'> <fo:root> <fo:layout-master-set> <fo:simple-page-master master-name="my-page" page-height="29.7cm" page

XSLT: If tag exists, apply template; if not, choose static value

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-21 03:36:21
问题 I am new to XSLT in general so please bear with me... With that in mind, what I am trying to do is check for a certain tag in the XML. If it is there I want to apply a template. If not, I want to add it (as a blank value). Basically always forcing it to be in the final output. How would I do this? I had something like this... <xsl:choose> <xsl:when test="@href"> <xsl:apply-templates select="country" /> </xsl:when> <xsl:otherwise> </xsl:otherwise> </xsl:choose> The top poriton of the code is

Determining Last page position in xsl-fo

有些话、适合烂在心里 提交于 2019-12-20 07:35:55
问题 Can we somehow determine the position of the last-page in XSL-FO? If I want to place my footer only on the last page, then how it could be done? As Input data varies and is not static. So any number of pages can come depending on the data. 回答1: Hope, it's not too late. But anyway, for all interested people: Create a page master <fo:simple-page-master master-name="my-last-page">...</fo:simple-page-master> and put your footer as a "region-after" into that master. Add this to your repeatable

Convert string to binary base64

江枫思渺然 提交于 2019-12-20 06:28:48
问题 Is there any way on how to convert a string to binary base64? I've seen many references but it didn't work in my end. For example I have this input file: <RootElement xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Data> <Binary> <RawData>This element should convert string to binary base64.</RawData> </Binary> </Data> </RootElement> I need to generate: <RootElement xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001

Adding one or incrementing variable in xslt

十年热恋 提交于 2019-12-20 05:01:21
问题 I want to make a Counter value getting incremented based on a condition. But i was not able to increment a value or add 1 to a global variable. I was using the following code <xsl:variable name="count">0</xsl:variable> <xsl:variable name="incre">1</xsl:variable> <xsl:template match="/"> <xsl:if test="$video1 != ''"> <xsl:variable name="count" select="number($count)+number($incrementor)"/> <!-- display video1 --> </xsl:if> <xsl:if test="$video2 != ''"> <xsl:variable name="count" select="number

Merge functionality of two xsl files into a single file (continued…)

ⅰ亾dé卋堺 提交于 2019-12-20 04:51:16
问题 This is in continuation of my question: Merge functionality of two xsl files into a single file (not a xsl import or include issue) I have to merge the solution (xsl) of above question to below xsl: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:template match="/"> <Declaration> <Message> <Meduim> <xsl:value-of select="/Declaration/Message/Meduim"/> </Meduim> <MessageIdentifier> <xsl:value-of select="

Merge functionality of two xsl files into a single file (continued…)

℡╲_俬逩灬. 提交于 2019-12-20 04:51:07
问题 This is in continuation of my question: Merge functionality of two xsl files into a single file (not a xsl import or include issue) I have to merge the solution (xsl) of above question to below xsl: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:template match="/"> <Declaration> <Message> <Meduim> <xsl:value-of select="/Declaration/Message/Meduim"/> </Meduim> <MessageIdentifier> <xsl:value-of select="