<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" 
    
    xmlns:pep="http://www.pepsico.com/us/fr/pep/2007-09-08"
    xmlns:usfr-pte="http://www.xbrl.org/us/fr/common/pte/2005-02-28"
    xmlns:ix="http://www.corefiling.com/ns/2007/inlinexbrl"
    xmlns:xhtml="http://www.w3.org/1999/xhtml"
    xmlns:xbrli="http://www.xbrl.org/2003/instance" 
    xmlns:link="http://www.xbrl.org/2003/linkbase"
    xmlns:rtr="http://www.reuters.com/xbrl/reuters-2007-06-30" 
    xmlns:gc="http://www.xbrl.org/uk/fr/gcd/2004-12-01" 
    xmlns:ifrs-gp="http://xbrl.iasb.org/int/fr/ifrs/gp/2006-08-15"
    xmlns:ae="http://www.companieshouse.gov.uk/ef/xbrl/uk/fr/gaap/ae/2006-07-01"
    xmlns:pt="http://www.xbrl.org/uk/fr/gaap/pt/2006-07-01" 
    xmlns:xlink="http://www.w3.org/1999/xlink">

    <!-- Output XML -->
    <xsl:output method="xml"/>

    <!-- To start, only process the xbrli:xbrl element found in the header -->
    <xsl:template match="/">
        <xsl:apply-templates select="/xhtml:html/xhtml:div/xbrli:xbrl"/>
    </xsl:template>

    <!-- Block automated processing of the body element -->
    <xsl:template match="xhtml:body"/>

    <!-- Disolve any xhtml elements, but process the elements and comments -->
    <xsl:template match="xhtml:*">
        <xsl:apply-templates select="*|comment()"/>
    </xsl:template>

    <!-- Catch the XBRL document element and copy all namespaces, then process contents -->
    <xsl:template match="xbrli:xbrl">
        <xsl:copy>
            <!-- copy-namespaces="yes" exclude-result-prefixes="xhtml"> -->
            <xsl:apply-templates select="*|@*|text()|comment()"/>
            <xsl:apply-templates select="//xhtml:body/*"/>
        </xsl:copy>
    </xsl:template>

    <!-- Default action for elements is to copy and continue -->
    <xsl:template match="*">
        <xsl:element name="{name()}">
            <xsl:apply-templates select="*|@*|text()|comment()"/>
        </xsl:element>
    </xsl:template>

    <!-- Catch "class" attributes and disolve -->
    <xsl:template match="@class"/>

    <!-- Copy all other attributes -->
    <xsl:template match="@*">
        <xsl:copy/>
    </xsl:template>

    <!-- By default, do nothing with text nodes (override default template action to output) -->
    <xsl:template match="text()"/>

    <!-- If the text node's parent is NOT in the XHTML namespace, then copy it -->
    <xsl:template match="text()[namespace-uri(parent::node()) != 'http://www.w3.org/1999/xhtml']">
        <xsl:copy/>
    </xsl:template>

</xsl:stylesheet>

