xslt-1.0

Skip an element when copying the whole node in xslt

六月ゝ 毕业季﹏ 提交于 2019-12-12 00:55:24
问题 Is it possible to skip an element from a node? For example we have node as Test and it has child elements x , y , z . I want to copy the whole Test node but don't want z element in the final result. Can we use not() in copy-of select ? I tried but it didn't work. Thanks. 回答1: No, <xsl:copy-of> gives you no control over what happens inside what you are copying. That's what an identity template with selective omissions is for: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL

Concatenate XSLT element values based on another element value

烈酒焚心 提交于 2019-12-12 00:53:53
问题 I have the following XML: <root> <attributes> <attribute_value>ID1</attribute_value> <attribute_name>id</attribute_name> </attributes> <attributes> <attribute_value>ID2</attribute_value> <attribute_name>id</attribute_name> </attributes> <attributes> <attribute_value>some-link</attribute_value> <attribute_name>link</attribute_name> </attributes> </root> I want to iterate over the file and concatenate all the "attribute_value" values based on the "attribute_name" value using XSLT (1.0 or 2.0).

Complex XML to XML Transformation using XSLT

萝らか妹 提交于 2019-12-12 00:29:35
问题 this might not be complex to you all but it's extremely difficult for me. This is my second attempt. I have changed my data around to include more information that will take less to transform. Basically I am trying to take data consisting of three vacation plans (VA, SS and WR) and project out the amount of time each plans will accrue each pay period, by worker, for an entire year. I've only included three pay periods in my data to keep it short(er). I need a separate record for each worker /

xslt - programming techniques

霸气de小男生 提交于 2019-12-11 23:37:51
问题 A question on Oliver Beckers efficient methods on xslt programming at this link. We know that using this code, we can eliminate verbose xsl choose method concat( substring(Str1,1 div Cond), substring(Str2,1 div not(Cond)) ) However what can we specify in 'condition', just to check for presence or absence of nodes? we cannot specify concat( substring(Str1,1 div test="/node"), substring(Str2,1 div not(test="/node")) ) which will throw syntax errors. 回答1: Try this expression (where node is the

How to print Timezone GMT+1 or GMT+2 when time summer is activated in XSLT 1.0

旧巷老猫 提交于 2019-12-11 23:19:32
问题 I want to see if there's any possibillty to change Time Zone from GMT+1 to GMT+2 when daylight save activated and started in PDF file genreted from XSLT file now the value of time zone is hardcoded : <xsl:value-of select="payment/@date-produce" /> (GMT+1) so please can you help me to automatize this thanks. 回答1: There's no standard function in XSLT 1.0 that will help with this, and the EXSLT date/time library won't help either. You'll need to write your own extension. In XSLT 2.0/3.0 the

XML to XML transformation with XSL

浪尽此生 提交于 2019-12-11 23:06:44
问题 I'm trying to transform an XML file to another XML file. Here is my input file: <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="inlamning.xsl"?> <Ansokan> <forskola_namn>Kopparholmen</forskola_namn> <barn persunnummer="200505051111"> <namn>Niklas Niklasson</namn> <syskon_pnr>200606061111</syskon_pnr> <allergi>Laktos</allergi> </barn> <vardnadshavare personnummer="198606061111"> <fornamn>Magnus</fornamn> <efternamn>Niklasson</efternamn> <adress> <hem>Magnusgatan

XSLT-1.0 How to pick multiple tags between two similar tags as it is?

▼魔方 西西 提交于 2019-12-11 22:20:33
问题 I am using xsl to transform xml to xml. Could you please help me to write xsl code to convert input to output? I need the data as rich text data in CDATA for first two tags. Thanks in advance. Input: <ATTRIBUTE-VALUE> <THE-VALUE> <div xmlns="http://www.w3.org/1999/xhtml"> <h1 dir="ltr" id="_1536217498885">Main Description</h1> <p>Line1 The main description text goes here.</p> <p>Line2 The main description text goes here.</p> <p>**<img alt="Embedded Image" class="embeddedImageLink" id="

XSLT - Modifying value of a XML node depending on other nodes

早过忘川 提交于 2019-12-11 22:15:43
问题 I am new to XSLT programming and struggling with the following issue: XML: <All_Results> <Result> <url>http://server/sites/sitecoll/library/Folder/NewFolder/test v1.0.docx</url> <hithighlightedproperties> <HHUrl>SomeValue1</HHUrl> </hithighlightedproperties> <isdocument>True</isdocument> <serverredirectedurl>SomeValue</serverredirectedurl> </Result> <Result> <url>http://server/sites/sitecoll/library/NewFolder1/test v2.0.docx</url> <hithighlightedproperties> <HHUrl>SomeValue1</HHUrl> <

Reporting duplicate or non-duplicate nodes using XSL 1.0

两盒软妹~` 提交于 2019-12-11 22:11:26
问题 Using XSLT 1.0 I need to find if there are duplicate nodes or are there single nodes from the to and from categories. I have found this XSL comparison of nodes that is very similar, but couldn't get it to work either. XML: <acl> <enabled>true</enabled> <from> <rule> <name>1.1.1.1</name> <pattern>1.1.1.1</pattern> <allow/> <log>true</log> <alarm>0</alarm> </rule> <rule> <name>1.1.1.3</name> <pattern>1.1.1.3</pattern> <allow/> <log>false</log> <alarm>0</alarm> </rule> <rule> <name>1.1.1.4</name

Using Template Within XSLT Key Generation

寵の児 提交于 2019-12-11 21:25:54
问题 I have an XML document containing items, each having a tokenized ID string. <?xml version="1.0"?> <Test> <Items> <Item> <ID>1_A_3</ID> <Name>foo</Name> </Item> <Item> <ID>1_B_5</ID> <Name>bar</Name> </Item> <Item> <ID>1_B_7</ID> <Name>baz</Name> </Item> </Items> </Test> I need to transform this into another XML document that groups the items according to the middle part of their ID string (the letter in the above example). <?xml version='1.0' ?> <GroupedItems> <Group id="A"> <Item>foo</Item>