xslt-1.0

What this stands for in xsl? match=“@*|node()”

回眸只為那壹抹淺笑 提交于 2019-12-04 22:39:59
问题 Can anyone explain what this means in xsl? Exactly what does each expression stands for <xsl:template match="@*|node()"> 回答1: @* matches any attribute node, and node() matches any other kind of node (element, text node, processing instruction or comment). So a template matching @*|node() will apply to any node that is not consumed by a more specific template. The most common example of this is the identity template <xsl:template match="@*|node()"> <xsl:copy><xsl:apply-templates select="@*

XSLT - build multiple (n) html tables of equal size (in this case, 3x3)

会有一股神秘感。 提交于 2019-12-04 19:45:26
Reference Question 1 Reference Question 2 Ok, both of the preceding links go to discussions of how to build cells and rows within tables. I was hoping to find an expanded example that showed how to build multiple TABLES of N-cells each (in this case 9 cells each - 3x3). I have been trying for a while to use the logic from the two examples and about 500 other places on the web but haven't been able to crack the nut. Can someone, perhaps the contributor to the above links, shed some light on how one would build N-tables of 3x3 from a single dataset as opposed to one table of specific rows? One

XSLT: Reading content that is devided by empty tags

我是研究僧i 提交于 2019-12-04 19:36:38
So I am busy creating a XSLT file to process various XML documents into a new node layout. There's one thing I can't figure out, here is an example of XML that I'm working with: <page> This is a paragraph on the page. <newParagraph/> This is another paragraph. <newParagraph/> Here is yet another paragraph on this page. <page> As you can see the paragraphs are split up using empty tags as deviders. In the result XML I want this: <page> <p> This is a paragraph on the page. </p> <p> This is another paragraph. </p> <p> Here is yet another paragraph on this page. </p> <page> How can I achieve this

XSLT - Creating Dynamic Grid

时间秒杀一切 提交于 2019-12-04 17:40:44
I am creating dynamic table(grid) using xslt, XSLT : <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output omit-xml-declaration="yes" indent="yes"/> <xsl:key name="RowAttribsByName" match="Row/@*" use="concat(generate-id(..), '|', name())"/> <xsl:variable name="vColNames" select= "/*/Columns/*[not(@Hidden = 'true')]/@Name"/> <xsl:template match="/*"> <table border="1"> <tr> <xsl:apply-templates select="Columns/*"/> </tr> <xsl:apply-templates select="Rows/Row"/> </table> </xsl:template> <xsl:template match="Column[not(@Hidden = 'true')]"> <td><xsl:value-of

Filter XML based on attribute value using xslt

风格不统一 提交于 2019-12-04 11:18:32
I have searched here and I'm not able to find how to filter an xml based on their attribute. I have this xml: <?xml version="1.0" encoding="utf-8"?> <document> <document_head> <title>This is the title</title> <version>This is the title</version> </document_head> <document_body> <paragraph id="AXD"> <text> This is a text that should be in the result </text> <properties> <size>13px</size> <color>#000000</color> </properties> <author>Current user</author> </paragraph> <paragraph id="SFI"> <properties> <text> This is some other text that should not be in there </text> </properties> </paragraph>

How to change Apache FOP Xalan XSLT Processor?

本小妞迷上赌 提交于 2019-12-04 07:34:11
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. 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 procedure to locate XSLT processors.AS we does not defined any,it will take available or default. Now, I am adding

xsl:key not working when looping through nodeset obtained with xalan:nodeset

半城伤御伤魂 提交于 2019-12-04 07:33:00
I have found a case where xsl:key seems not to be working. I am using XSLT 1 with Xalan (compiled) and this is what is happening: 1.- This works: key named test1 works fine: <xsl:variable name="promosRTF"> <xsl:copy-of select="promo[@valid='true']"/> </xsl:variable> <xsl:variable name="promos" select="xalan:nodeset($promosRTF)" /> <!-- now the key: when defined and used here it works fine: --> <xsl:key name="test1" match="//promo" use="'anytext'" /> <xsl:for-each select="key('test1','anytext')/*"> loop through elements in key... ok, works fine </xsl:for-each> <xsl:for-each select="$promos/*">

How to get all the IDs from two XML and merge to a single XML using XSL

为君一笑 提交于 2019-12-04 06:08:34
问题 I am trying to compare two responses and find out the same and different IDs from them. After that I need to merge them to a single XML document. Here is one XML document, which is saved in some variable called $one: <test> <console> <consoles> <ID>123</ID> </consoles> <consoles> <ID>122</ID> </consoles> <consoles> <ID>134</ID> </consoles> </console> </test> Here is the other XML document, which is saved in some variable called $two: <test> <console> <consoles> <ID>123</ID> </consoles>

Select descendant elements that are not contained in another type of element

梦想与她 提交于 2019-12-04 05:57:34
In XPath 1.0, how can I select all descendant nodes C of current (context) node A, that are not contained in an intervening node of type B? For example, find all <a> links contained in the current element, that are not inside a <p> . But if the current element is itself inside a <p> , that's irrelevant. <p> <—— this is irrelevant, because it's outside the current element ... <div> <—— current element (context node) ... <a></a> <—— the xpath should select this node ... <p> ... <a></a> <—— but not this, because it's inside a p, which is inside context ... <p> ... </div> ... </p> The ... in the

How to normalize XML on reverse domain name sorting and custom filtering

你。 提交于 2019-12-04 05:45:24
问题 I've been working on a Geo application. Over the time the product's XML has grown bit messy. The problem arises when synchronizing the changes across multiple environments, like Dev, Test, etc. I'm trying to figure out a way to normalize the content, so I can avoid some cumbersome while editing and merging, and hence, have a productive development. I know it sounds crazy, and there's lot on the background, but let me jump to the actual issue leaving the history. Here's the issue: Multiple