Hi, I have the following XML file (it is a TCX file)

<?xml version="1.0"?>
<TrainingCenterDatabase xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2">
  <Activities>
    <Activity Sport="Biking">
      <Id>..</Id>
      <Lap StartTime="..">
        <TotalTimeSeconds>..</TotalTimeSeconds>
        <DistanceMeters>..</DistanceMeters>
        <MaximumSpeed>..</MaximumSpeed>
        <Calories>..</Calories>
        <Intensity>Active</Intensity>
        <Cadence>75</Cadence>
        <TriggerMethod>Manual</TriggerMethod>
        <Track>
          <Trackpoint>
            <Time>2017-12-16T12:43:10Z</Time>
            <DistanceMeters>0</DistanceMeters>
            <Cadence>1</Cadence>
            <Extensions>
              <TPX xmlns="http://www.garmin.com/xmlschemas/ActivityExtension/v2">
                <Speed>0</Speed>
                <Watts>1</Watts>
                <Slope>-1.49</Slope>
              </TPX>
            </Extensions>
          </Trackpoint>
          .
          .
          .
          .

I want to add the following to each <Trackpoint> tag:

<AltitudeMeters>..</AltitudeMeters>
<Position>
    <LatitudeDegrees>..</LatitudeDegrees>
    <LongitudeDegrees>..</LongitudeDegrees>
</Position>

Using the attached xsl sheet. When I run the file with PHP only the identity template is being invoked and not the second template. I think it may be due to namespace but have no idea really. Any ideas greatly appreciated. Thanks James.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.