xslt-1.0

CSS style for leading dots

左心房为你撑大大i 提交于 2019-12-07 04:49:30
问题 I'm working on a CSS style which produces dots for a table of contents page. The code is based on https://code.google.com/p/wkhtmltopdf/issues/detail?id=1073. The idea is to create a div with lots of dots in it and overlay it with a span-elements (text and page-number), which have a white background. This works quite good, except for following two issues: dots are "cut" (screenshot: http://i.imgur.com/VRJQCP5.png) if a text-element requires more than one line, it doesn't get displayed Code: <

Get first child node in XSLT using local-name()

梦想的初衷 提交于 2019-12-07 04:26:20
问题 Assume we have this simple xml ... <books> <book> <author/> <title/> </book> <book> <author/> <title/> </book> </books> I'm using this xpath to get the elements of the first book instance. //books[1]/* Returns <author/> <title/> And that works fine, but I have to get it working using local-name(). I've tried the following but none of these work... //*[local-name()='books']/* this returns repeating author and title elements, not good, I only need them from the first child //*[local-name()=

XSLT 1.0 variant for distinct-values

大兔子大兔子 提交于 2019-12-07 01:58:38
问题 I have an XSLT in which I create (from the input data) intermediary variables like the following (hard-coded example, but dynamic in nature): <xsl:variable name="variableX"> <ValidCode CodePart="CP1" Code="C1"/> <ValidCode CodePart="CP2" Code="C2"/> <ValidCode CodePart="CP1" Code="C3"/> <ValidCode CodePart="CP2" Code="C4"/> <ValidCode CodePart="CP2" Code="C5"/> </xsl:variable> I wish to loop over the distinct occurrences of CodePart values. In XSLT 2.0 it's easy: <xsl:for-each select=

XSLT 1.0 - Remove duplicates fields

穿精又带淫゛_ 提交于 2019-12-06 21:01:26
I'm having a problem with XSLT V1.0 with removing the duplicated nodes. I have this for entry <?xml version="1.0" encoding="utf-8"?> <myRoot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Mappings> <Mapping fieldName="field1" > </Mapping> <Mapping fieldName="field1"> </Mapping> <Mapping fieldName="field2" > </Mapping> <Mapping fieldName="field3" > </Mapping> <Mapping fieldName="field4"> </Mapping> </Mappings> </myRoot> I have this XSL file <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" encoding="utf-8"

XML to XML conversion with XSLT (Add, delete, modify)

£可爱£侵袭症+ 提交于 2019-12-06 20:03:28
I'm trying to convert from one XML (XHTML) file to another one with XSLT. I have to add some new elements and attributes, remove some elements and attributes as well as update the value of some existing attributes. So for with the valuable help given in this forum, I'm able to do many tasks as per the answer of my previous question: XML to XML with XSLT- Add, Remove, Modify Elements and Attributes but the problem arises when the elements have the same name and one same attribute. At that point I'm unable to distinguish it for modification. For Example: I have two scripts of type="t/j" after

Converting CSV to hierarchichal XML using XSLT

自闭症网瘾萝莉.ら 提交于 2019-12-06 16:15:30
问题 I need to create an XSLT to convert a CSV (comma separated file) into hierarchical XML. This is the input file: <root> L11,L12,L21,L22,L31,L32 1,A,1,C,1,G 1,A,1,C,2,H 1,A,2,D,1,I 1,A,2,D,2,J 2,B,1,E,1,K 2,B,1,E,2,L 2,B,2,F,1,M 2,B,2,F,2,N </root> This is desired output XML: <?xml version="1.0" encoding="utf-8"?> <Document> <Level1> <L11>1</L11> <L12>A</L12> <Level2> <L21>1</L11> <L22>C</L12> <Level3> <L31>1</L31> <L32>G</L32> </Level3> <Level3> <L31>2</L31> <L32>H</L32> </Level3> </Level2>

I would like to implement a `split function/template` which takes as input a string and a delimiter and returns a split array of the string

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 16:05:28
I would like to implement a split function/template in XSLT which takes as input a string and a delimiter and returns a split array of the string.. Or rather I'd like the ability to do something along the lines of: <xsl:call-template name="F"> <xsl:with-param name="input" select="'a,b,c,d,e'"/> <xsl:with-param name="replacement"> <option value='$x'>$x</option> </xsl:with-param> </xsl:call-template> which will give me <option value='a'>a</option><option value='b'>b</option><option value='c'>c</option><option value='d'>d</option><option value='e'>e</option> Question targeted at XSLT 1.0 (but i

XSL - remove the duplicate node but keep the original

独自空忆成欢 提交于 2019-12-06 15:32:04
Need help in removing the duplicate node from the input xml using XSLT This is how my XML looks like, <?xml version="1.0"?> <NodeA NodeAattr="123"> <NodeB NodeBattr="456"></NodeB> <NodeC> <NodeD="ValueD"> <NodeE Name="ValueABC"> <NodeF Value="0"></NodeF > </NodeE > <NodeE Name="ValueABC"> <NodeF Value="0"></NodeF > </NodeE> </NodeD> </NodeC> </NodeA> My final output should look like <NodeA NodeAattr="123"> <NodeB NodeBattr="456"></NodeB> <NodeC> <NodeD="ValueD"> <NodeE Name="ValueABC"> <NodeF Value="0"></NodeF> </NodeE > </NodeD> </NodeC> </NodeA> Here the Name attribute of Node E has

Using XSLT to create a well formatted nested table from unknown XML

可紊 提交于 2019-12-06 14:59:38
The task I was given: My boss wants me to create an XSLT that takes XML of an unknown structure, and put it into a nested table (tag names as table headers) without repeating table headers where possible. I was almost able to get what he wants (The table ) The question: I have only worked with XSLT's for a few days now (have gone through a few tutorials and played with it a bit), So if anyone can point me in a good direction on where to find information that will help me with my problem, it would be greatly appreciated. Environment Data: I am working with XSLT and PHP (DOM objects). My boss

XSLT - remove all attributes

我只是一个虾纸丫 提交于 2019-12-06 14:06:23
Pretty straightforward question. Didn't find an answer to exactly this one. Would like to see XSLT 1.0 without attribute axis, and others too if possible (I am using python's lxml lib which is not really catching up on that stuff). Your solution should work without issue, but there's an even easier way - just use an identity template that doesn't include attributes: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output omit-xml-declaration="yes" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:template match="node()"> <xsl:copy> <xsl:apply-templates />