w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
XSLT - Repeating Parent Node with Child Nodes

You could try,

XSL:

 <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
       <xsl:output indent="yes" />

    <xsl:template match="/">
         <xsl:copy-of select="//FlightDetails"/>
    </xsl:template>
    </xsl:stylesheet>

Output:

<?xml version="1.0" encoding="UTF-8"?>
<FlightDetails>
      <CouponNumber>1</CouponNumber>
      <ServiceClass>Y</ServiceClass>
   </FlightDetails>
<FlightDetails>
      <CouponNumber>2</CouponNumber>
      <ServiceClass>Y</ServiceClass>
   </FlightDetails>
<FlightDetails>
      <CouponNumber>3</CouponNumber>
      <ServiceClass>Y</ServiceClass>
   </FlightDetails>




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.