xslt

How to remove duplicate xml-nodes using xslt?

北城余情 提交于 2021-02-07 04:18:53
问题 I want to remove duplicates when all variables are exact matches using xslt. In this xml node 3 should be removed because it is a perfect copy of node 1. <root> <trips> <trip> <got_car>0</got_car> <from>Stockholm, Sweden</from> <to>Gothenburg, Sweden</to> <when_iso>2010-12-06 00:00</when_iso> </trip> <trip> <got_car>0</got_car> <from>Stockholm, Sweden</from> <to>New york, USA</to> <when_iso>2010-12-06 00:00</when_iso> </trip> <trip> <got_car>0</got_car> <from>Stockholm, Sweden</from> <to

Is it a good idea to use XML and XSLT for websites?

一世执手 提交于 2021-02-06 12:50:37
问题 I'm wondering whether it brings advantages or disadvantages when using a XML document for the content of a web page and XSLT to manage the display part and not using plain HTML. The first condition in my eyes is browser support for XML and XSLT. But as far as I know no modern browser has a problem with it. (Correct me if I'm wrong.) But are there for instance benefits (semantic web and so on) or losses (HTML tags are more common) in the ranking of search engines? Or do you see other reasons

Nesting xsl templates and referring multiple templates to the same node?

我是研究僧i 提交于 2021-02-05 12:10:44
问题 This is my first post :) I'll try to be clear and nice, thank you in advance for any help! And I apologize that this question is convoluted. :| Any friendly hints on how to better ask the question will be appreciated too! This is a reduced version of the xml source file I have: <?xml version="1.0" encoding="UTF-8"?> <FMPDSORESULT xmlns="http://www.filemaker.com/fmpdsoresult"> <ERRORCODE>0</ERRORCODE> <DATABASE>FTP XML.fmp12</DATABASE> <LAYOUT> </LAYOUT> <ROW MODID="0" RECORDID="1151"> <EDI

Nesting xsl templates and referring multiple templates to the same node?

旧时模样 提交于 2021-02-05 12:10:11
问题 This is my first post :) I'll try to be clear and nice, thank you in advance for any help! And I apologize that this question is convoluted. :| Any friendly hints on how to better ask the question will be appreciated too! This is a reduced version of the xml source file I have: <?xml version="1.0" encoding="UTF-8"?> <FMPDSORESULT xmlns="http://www.filemaker.com/fmpdsoresult"> <ERRORCODE>0</ERRORCODE> <DATABASE>FTP XML.fmp12</DATABASE> <LAYOUT> </LAYOUT> <ROW MODID="0" RECORDID="1151"> <EDI

XSLT 1.0 to move namespace to child node

蹲街弑〆低调 提交于 2021-02-05 11:28:08
问题 I only have access to xpath 1.0 commands and functions. I need to move the namespace declaration from the root node to a child node where that namespace starts to be used. Source XML: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <Accounts xmlns:test="http:example.com/test1"> <ParentAccount>10113146</ParentAccount> <test1>test1</test1> <test2>test2</test2> <test:Siblings> <test:CustomerNumber>10113146</test:CustomerNumber> <test:CustomerNumber>120051520</test:CustomerNumber> </test

XSL transformation attributes to elements

冷暖自知 提交于 2021-02-05 11:15:43
问题 I would like to convert xml attributes of input xml to elements of output xml. Example <Price price1="2" price2="3" total="5" other="x" tax="2"/> to <Price> <price1>2</price1> <price2>3</price2> <total>5</total> <other>x</other> <tax>2</tax> </Price> I tried like <xsl:element name="Price"> <xsl:for-each select="*:Price/@*"> <xsl:element name="*> <xsl:value-of select="@*"/> </xsl:for-each> </xsl:element></xsl:element> Not able to get the required output.Please suggest. 回答1: Try it this way:

XSL transformation attributes to elements

前提是你 提交于 2021-02-05 11:14:06
问题 I would like to convert xml attributes of input xml to elements of output xml. Example <Price price1="2" price2="3" total="5" other="x" tax="2"/> to <Price> <price1>2</price1> <price2>3</price2> <total>5</total> <other>x</other> <tax>2</tax> </Price> I tried like <xsl:element name="Price"> <xsl:for-each select="*:Price/@*"> <xsl:element name="*> <xsl:value-of select="@*"/> </xsl:for-each> </xsl:element></xsl:element> Not able to get the required output.Please suggest. 回答1: Try it this way:

(Recursion) auto-incrementation for all depth level elements and keeping heredity path in chain

旧街凉风 提交于 2021-02-05 09:53:30
问题 Is it possible to make unique id (here as an attribute "path"'s value) by implementing incremental principle? for 3 lvl depth recursion, for example it would look like "1/1/1" or "1/1/2" - if there is a sibling on a third level I may admit that from technical point of XSLT realization it would be useful to use level prefix before +1 increment counting. That case also would be correct. the main thing - to assembly unique id ("path") 1-source <root> <object id="a" id-3="value"/> <object id="b"

(Recursion) auto-incrementation for all depth level elements and keeping heredity path in chain

穿精又带淫゛_ 提交于 2021-02-05 09:53:21
问题 Is it possible to make unique id (here as an attribute "path"'s value) by implementing incremental principle? for 3 lvl depth recursion, for example it would look like "1/1/1" or "1/1/2" - if there is a sibling on a third level I may admit that from technical point of XSLT realization it would be useful to use level prefix before +1 increment counting. That case also would be correct. the main thing - to assembly unique id ("path") 1-source <root> <object id="a" id-3="value"/> <object id="b"

XSLT output not as expected

老子叫甜甜 提交于 2021-02-05 09:44:07
问题 I have a requirement to remove parent xml nodes and copy entire xml inside node. I have written a xslt code it, however, it is not working as expected. Input XML: <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge"> <ns0:Message1> <ns3:Response xmlns:ns3="urn:enoc.com:HTRUAE:EmployeeLeavesData_Portal"> <EmployeeLeave> <EmployeeID>100064</EmployeeID> <EmployeeAbsenceDays>1</EmployeeAbsenceDays> </EmployeeLeave> <EmployeeLeave> <EmployeeID>100065</EmployeeID> <EmployeeAbsenceDays>1<