XSLT test1 graphical mapping using examples see the code

 https://xsltfiddle.liberty-development.net/


<?xml version="1.0" encoding="UTF-8"?>

<MapExampleFlatStructureMessage version="1.1">

  <Person>

    <Id>123456</Id>

    <Name>John Doe</Name>

    <TelephoneNumber>555-1234</TelephoneNumber>

  </Person>

  <Person>

    <Id>789012</Id>

    <Name>Jane Smith</Name>

    <TelephoneNumber>555-5678</TelephoneNumber>

  </Person>

</MapExampleFlatStructureMessage>


--------------

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output indent="yes"/>

  <xsl:template match="MapExampleFlatStructureMessage">

    <xsl:copy>

      <xsl:apply-templates select="Person[starts-with(Name,'J')]" />

    </xsl:copy>

  </xsl:template>

  

  <xsl:template match="Person">

    <xsl:copy>

    <xsl:apply-templates select="@*|node()" />

     <!-- another farm 

      <xsl:apply-templates select="Id | Name | TelephoneNumber"/>-->

      

    </xsl:copy>

  </xsl:template>

  

  

 <xsl:template match="@*|node()">

    <!--  or

    <xsl:template match="Id | Name | TelephoneNumber"> -->

    <xsl:copy-of select="." />

  </xsl:template>

  

</xsl:stylesheet>

-----------------------


<?xml version="1.0" encoding="UTF-8"?>

<MapExampleFlatStructureMessage>

   <Person>

      <Id>123456</Id>

      <Name>John Doe</Name>

      <TelephoneNumber>555-1234</TelephoneNumber>

   </Person>

   <Person>

      <Id>789012</Id>

      <Name>Jane Smith</Name>

      <TelephoneNumber>555-5678</TelephoneNumber>

   </Person>

</MapExampleFlatStructureMessage>


Popular posts from this blog

pss book : శ్రీకృష్ణుడు దేవుడా, భగవంతుడా completed , second review needed. 26th April 2024

pss book: గురు ప్రార్థనామంజరి . completed 21st july 2024

pss book: కధల జ్ఞానము read review pending. 25th june 2024