XML Parser Template File

 

Create a new XML parser by making copy of the XML parser template file located in the following RC-WinTrans directory: "Samples" | "Developing" | "XML Parser."

Template file name: "XMLParser-Template.XSL"

 

The code of the extensible stylesheet (shown in the text box below) copies the content of the source XML file, so the transformed XML file will be identical to the source XML file.

 

Related topics...

 

<?xml version="1.0" ?>

<!-- Template file for an "RC-WinTrans XML Parser". -->

<!-- Schaudin.com, December 2006 -->

<!-- The template file's code copies the content of the source XML file.

       The transformed XML file will be identical to the source XML file.

-->

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

                xmlns:fn="http://www.w3.org/2005/02/xpath-functions"

                version="1.0">

   <xsl:output encoding="utf-8"/>

  

   <!-- Match the root node -->

   <xsl:template match="/">

      <xsl:text>

   </xsl:text>

    

   <xsl:apply-templates select="*|@*|text()|comment()|processing-instruction()"/>

   </xsl:template>

   <!-- Match everything else -->

   <xsl:template match="*|@*|text()|comment()|processing-instruction()">

      <xsl:copy><xsl:apply-templates

                select="*|@*|text()|comment()|processing-instruction()"/></xsl:copy>

   </xsl:template>

 

  <!-- Insert the specific template(s) here                                   -->

  <!-- Task: add an instruction attribute to all elements where the -->

  <!--        text of the element or attribute is to be translated        -->

 

</xsl:stylesheet>