xslt-1.0

Replace XML values with sequential alphabets in XSL transform

我是研究僧i 提交于 2019-12-25 03:25:10
问题 Given the input XML <FlightOptions> <item> <Fares> <item> <FareClass>T</FareClass> <Fare>100</Fare> <FareType>E</FareType> <Seats>5</Seats> </item> <item> <FareClass>Y</FareClass> <Fare>200</Fare> <FareType>E</FareType> <Seats>10</Seats> </item> <item> <FareClass>R</FareClass> <Fare>250</Fare> <FareType>E</FareType> <Seats>20</Seats> </item> <item> <FareClass>N</FareClass> <Fare>100</Fare> <FareType>F</FareType> <Seats>5</Seats> </item> <item> <FareClass>M</FareClass> <Fare>200</Fare>

How to merge two xml file using xslt1.0?

白昼怎懂夜的黑 提交于 2019-12-25 03:13:35
问题 File1.xml <?xml version="1.0" encoding="ISO-8859-1"?> <catalog> <data> <title>Title1</title> <description>Description1</description> <myid>1</myid> </data> <data> <title>Title2</title> <description>Description2</description> <myid>2</myid> </data> </catalog> File2.xml: <?xml version="1.0" encoding="ISO-8859-1"?> <catalog> <data> <author>Author1</author> <date>12/34/5678</date> <myid>1</myid> </data> <data> <author>Author2</author> <date>87/65/4321</date> <myid>2</myid> </data> </catalog> need

Struggling with xslt grouping and querying against xpath count

梦想与她 提交于 2019-12-25 03:01:43
问题 So I'm stuck with XSLT 1.0 In my XML I have something like this: <BenefitDefinitions> <BenefitDefinition> <BenefitCode>A</BenefitCode> <FulfillmentName>Test</FulfillmentName> </BenefitDefinition> <BenefitDefinition> <BenefitCode>B</BenefitCode> <FulfillmentName>Test</FulfillmentName> </BenefitDefinition> <BenefitDefinition> <BenefitCode>C</BenefitCode> <FulfillmentName>Test</FulfillmentName> </BenefitDefinition> </BenefitDefinitions> ... <Coverage> <Cover> <BenefitCode>A</BenefitCode> <Cover>

Struggling with xslt grouping and querying against xpath count

大城市里の小女人 提交于 2019-12-25 03:01:33
问题 So I'm stuck with XSLT 1.0 In my XML I have something like this: <BenefitDefinitions> <BenefitDefinition> <BenefitCode>A</BenefitCode> <FulfillmentName>Test</FulfillmentName> </BenefitDefinition> <BenefitDefinition> <BenefitCode>B</BenefitCode> <FulfillmentName>Test</FulfillmentName> </BenefitDefinition> <BenefitDefinition> <BenefitCode>C</BenefitCode> <FulfillmentName>Test</FulfillmentName> </BenefitDefinition> </BenefitDefinitions> ... <Coverage> <Cover> <BenefitCode>A</BenefitCode> <Cover>

Transform XML format to another XML format using XSLT

坚强是说给别人听的谎言 提交于 2019-12-25 02:52:06
问题 I am new to XSLT, I need to change the input xml to the output xml Input <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ad:AcceptDataInfo xmlns:ad="http://www.abc.com"> <ad:Product>ABC</ad:SubType> <ad:AccountNo>123</ad:AccountNo> <ad:Date>20140429</ad:Date> <ad:Time>160102</ad:Time> </ad:AcceptDataInfo> output expected <Documents> <Document> <Prop> <Name>Product</Name> <Value>ABC</Value> </Prop> <Prop> <Name>AccountNo</Name> <Value>123</Value> </Prop> <Prop> <Name>Date</Name>

Picking unique heads

独自空忆成欢 提交于 2019-12-25 02:43:38
问题 I some XML that is already ordered and grouped by categories. So, I was thinking of using XSLT 1.0 grouping to pull out the category heads. But I was wondering if there is an easier way to simply pick the first heading of each category and group and delete or ignore the duplicates. Here is a sample of the XML: <dataroot> <CaseStudies> <category>1</category> <GroupNo>2</GroupNo> <H1>Evaluation and Management</H1> <H2>Office or Other Outpatient Services</H2> <H3>New Patient</H3> <indicators>{+}

XSLT - Updating the Header

删除回忆录丶 提交于 2019-12-25 02:38:25
问题 The request XML i have is given below and the XSLT transformation Iam using is also given. Unfortunately the ordertotal xml tag is repeating twice after transformation. How can i update the existing tag rather than inserting double tag Request XML is <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns2:fetchOrderListResponse xmlns:ns2="http://impl.lob.wipro.com/"> <return> <customerOrderNumber>1</customerOrderNumber> <orderDetails> <itemPrice>50.0</itemPrice

XSLT add attributes to elements in a variable

此生再无相见时 提交于 2019-12-25 02:33:06
问题 In XSLT 1.0 I have a variable with some XML nodes: <xsl:varible name="MyVariable"> <SomeElement>text here</SomeElement> <SomeElement>text with <OtherElement>other element</OtherElement></SomeElement> <SomeElement>something else <DoNotAddAnything>...</DoNotAddAnything></SomeElement> </xsl:variable> I need to add an attribute with some value to elements SomeElement and OtherElement (but not to others). I need to transform the content of the variable to something like this: <SomeElement

xsl data attribute not getting value showirorng > er

早过忘川 提交于 2019-12-25 02:32:54
问题 I am trying to pass this value in data attribute but I don't know how to retrieve in XSL. Without putting it in data attribute, I am getting the value. http://xsltransform.net/bFukv8i/9 Providing a snippet of my XSL code below: <article class="banner-hero banner-hero--blocks" data-nav-title="<xsl:value-of select='//Devices//SideMenu//NavTitle'/>"></article> <script> 回答1: Use <article class="banner-hero banner-hero--blocks" data-nav-title="{//Devices//SideMenu//NavTitle}"></article> , that is

xsl use-character-maps eqivalent in xsl 1.0

白昼怎懂夜的黑 提交于 2019-12-25 02:28:29
问题 I have a xsl 2.0 stylsheet which uses xsl 2.0 specific enhancements. I am now trying to move templates in xsl 1.0 as I have some restrictions in using xsl2.0. When I am running my xsl 1.0 templates I am getting some encoding related errors. I wanted to understand what is the equivalent of use-character-maps in xsl 1.0. Thanks 回答1: Character maps are a new feature in XSLT 2.0, there is no equivalent feature in XSLT 1.0. However if you want to output a certain entity or character reference in