xslt

How do I strip / add namespaces / prefixes in this XML / XSLT?

♀尐吖头ヾ 提交于 2020-01-16 08:53:11
问题 Given the following XML: <?xml version="1.0" encoding="utf-8"?> <Store> <p1:Document xmlns:p1="urn:iso:std:iso:xyz"> <p1:Class> Hello <p1:Type> Now </p1:Type> </p1:Class> <!-- more elements --> </p1:Document> </Store> How would I write an XSLT to transform the Document element in the following way: <?xml version="1.0" encoding="utf-8"?> <Store> <Document xmlns="urn:iso:std:iso:123> <Class> Hello <Type> Now </Type> </Class> <!-- more elements --> </Document> </Store> As you can see, I need to

merging multiple attribute nodes with same value

此生再无相见时 提交于 2020-01-16 08:30:11
问题 Can you please help me on how to do this xml: The xml looks like <a name="hr_1" id="hr"> <text>11</text> </a> <a name="hr_2" id="hr"> <text>12</text> </a> <a name="hre_1" id ="hre"> <text>11</text> </a> <a name="hre_2" id ="hre"> <text>12</text> </a> expected output:The transformed output is expected like below <b name ="hr"> <value>11</value> <value>12</value> </b> <b name ="hre"> <value>11</value> <value>12</value> </b> 回答1: From comment: Thank you so much... How can i do it in xslt 1.0..

merging multiple attribute nodes with same value

≯℡__Kan透↙ 提交于 2020-01-16 08:30:09
问题 Can you please help me on how to do this xml: The xml looks like <a name="hr_1" id="hr"> <text>11</text> </a> <a name="hr_2" id="hr"> <text>12</text> </a> <a name="hre_1" id ="hre"> <text>11</text> </a> <a name="hre_2" id ="hre"> <text>12</text> </a> expected output:The transformed output is expected like below <b name ="hr"> <value>11</value> <value>12</value> </b> <b name ="hre"> <value>11</value> <value>12</value> </b> 回答1: From comment: Thank you so much... How can i do it in xslt 1.0..

Removing double quotes in XSL

我与影子孤独终老i 提交于 2020-01-16 04:54:07
问题 I am using XSL 1.0, I have this kind of XML- <ID>"7080"</ID> <NAME>"Media"</NAME> <ADDRESS> <STREET_1>"400 Street"</STREET_1> </ADDRESS> The values are coming with Double Quotes. I am trying to remove these double quotes in XSL 1.0 and show up my Result as: <ID>7080</ID> <NAME>Media</NAME> <ADDRESS> <STREET_1>400 Street</STREET_1> </ADDRESS> Also, I have tried it to apply translate function to the root element of the XML but it isn't working. Any suggestion would help! 回答1: You can use

Make XSLT and XML Output to a XML File

眉间皱痕 提交于 2020-01-16 00:54:13
问题 I have a few problems with XSLT. I have this XML File: <?xml version="1.0" encoding="UTF-8" ?> <?xml-stylesheet type="text/xsl" href="XSLTest.xsl"?> <pages> <page> <title>New Title</title> <id>4782</id> <timestamp>2012-09-13 13:15:33</timestamp> <contributor> <username>kf</username> <id>2</id> </contributor> <text xml:space="preserve"> some text </text> </page> </pages> and this XSL File: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999

refactor XML with XSL

自闭症网瘾萝莉.ら 提交于 2020-01-16 00:49:21
问题 I need to move the <sectionid/> and the <sponsor/> elements inside the corresponding <amendment/> . Here is an example: From : <root> <sectionid>A</sectionid> <sponsor>john</sponsor> <sponsor>paul</sponsor> <amendment> <id>1</id> <text>some text</text> </amendment> <sectionid>B</sectionid> <sponsor>peter</sponsor> <amendment> <id>5</id> <text>some text</text> </amendment> <amendment> <id>4</id> <text>some text</text> </amendment> <sponsor>max</sponsor> <amendment> <id>6</id> <text>some text<

How to create a modal popup message from XSL

大憨熊 提交于 2020-01-15 19:10:36
问题 I am creating an XSL page where I want to do call a modal popup. Below is part of my XSL file: <xsl:if test="(/ShoppingBag/Multibuy/Discount) > 0"> <tr> <td class="sbTotalsColLeft saving"> DiscountDetails </td> <td class="sbTotalsColRight"> </td> </tr> </xsl:if> What I want to do is when client clicked on DiscountDetails I want to display a modal popup with below information <table class="tbpromotionTypes"> <xsl:for-each select="/ShoppingBag/MultibuyDiscountedPromotionTypes/PromotionType">

multi nested loops by XSL to convert a XML to Table

☆樱花仙子☆ 提交于 2020-01-15 12:21:07
问题 Thanks for How to use XSLT to convert a XML to Table [CODE UPDATED 11/6], now I am able to convert xml to table by XSLT, however when I add in one more nested loop, the result is not fully loaded, I am not sure what went wrong. Data XML <Records> <Person id="756252" date="15-Oct-2014"> <Gender>Male</Gender> <NameDetails> <Name NameType="Primary Name"> <NameValue> <FirstName>Ken</FirstName> <Surname>Wu</Surname> </NameValue> </Name> <Name NameType="AKA"> <NameValue> <FirstName>Kenneth<

XSLT nested menu transform based on featured attribute

我的梦境 提交于 2020-01-15 11:53:28
问题 I am writing an application that will modify existing menu output. I have a number of ways I can think of to do this, one of them I think is XSLT but I am a complete beginner in such transforms. I am looking to change the following: <ul> <li><a href="#">Item1</a> <ul> <li class="featured"><a href="#">Item 1.1</a></li> <li><a href="#">Item 1.2</a></li> <li class="featured"><a href="">Item 1.3</a></li> <li><a href="#">Item 1.4</a></li> </ul> </li> </ul> To the new: <ul> <li><a href="#">Item1</a

XSLT nested menu transform based on featured attribute

情到浓时终转凉″ 提交于 2020-01-15 11:53:23
问题 I am writing an application that will modify existing menu output. I have a number of ways I can think of to do this, one of them I think is XSLT but I am a complete beginner in such transforms. I am looking to change the following: <ul> <li><a href="#">Item1</a> <ul> <li class="featured"><a href="#">Item 1.1</a></li> <li><a href="#">Item 1.2</a></li> <li class="featured"><a href="">Item 1.3</a></li> <li><a href="#">Item 1.4</a></li> </ul> </li> </ul> To the new: <ul> <li><a href="#">Item1</a