title: How to remove leading and trailing white spaces from 5th row excel xml workbook using XSLT
body: <p>How can the leading and trailing white spaces from 5th row excel xml workbook cell values can be removed? I tried the following but didn't workout</p>
  
  <p><strong>XSLT:</strong></p>
  
  <pre><code>&lt;xsl:strip-space elements="/ss:Workbook/ss:Worksheet/ss:Table/ss:Row[position() = 5]/ss:Cell/ss:Data"/&gt;
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p><strong>XML</strong></p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
   xmlns:o="urn:schemas-microsoft-com:office:office"
   xmlns:x="urn:schemas-microsoft-com:office:excel"
   xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
   xmlns:html="http://www.w3.org/TR/REC-html40"&gt;
   &lt;DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"&gt;
    &lt;Author&gt;Jefferson D&lt;/Author&gt;
    &lt;LastAuthor&gt;Jefferson D&lt;/LastAuthor&gt;
    &lt;Created&gt;2015-10-29T17:10:31Z&lt;/Created&gt;
    &lt;LastSaved&gt;2015-10-29T17:15:02Z&lt;/LastSaved&gt;
    &lt;Company&gt;*CL&lt;/Company&gt;
    &lt;Version&gt;12.0&lt;/Version&gt;
   &lt;/DocumentProperties&gt;
   &lt;OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office"&gt;
    &lt;AllowPNG/&gt;
   &lt;/OfficeDocumentSettings&gt;
   &lt;ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"&gt;
    &lt;WindowHeight&gt;22060&lt;/WindowHeight&gt;
    &lt;WindowWidth&gt;34400&lt;/WindowWidth&gt;
    &lt;WindowTopX&gt;-20&lt;/WindowTopX&gt;
    &lt;WindowTopY&gt;-20&lt;/WindowTopY&gt;
    &lt;Date1904/&gt;
    &lt;ProtectStructure&gt;False&lt;/ProtectStructure&gt;
    &lt;ProtectWindows&gt;False&lt;/ProtectWindows&gt;
   &lt;/ExcelWorkbook&gt;
   &lt;Styles&gt;
    &lt;Style ss:ID="Default" ss:Name="Normal"&gt;
     &lt;Alignment ss:Vertical="Bottom"/&gt;
     &lt;Borders/&gt;
     &lt;Font ss:FontName="Verdana"/&gt;
     &lt;Interior/&gt;
     &lt;NumberFormat/&gt;
     &lt;Protection/&gt;
    &lt;/Style&gt;
    &lt;Style ss:ID="s16"&gt;
     &lt;Font ss:FontName="Verdana" ss:Bold="1"/&gt;
    &lt;/Style&gt;
   &lt;/Styles&gt;
   &lt;Worksheet ss:Name="Sheet1"&gt;
    &lt;Table ss:ExpandedColumnCount="3" ss:ExpandedRowCount="10" x:FullColumns="1"
     x:FullRows="1"&gt;
     &lt;Column ss:AutoFitWidth="0" ss:Width="176.0"/&gt;
     &lt;Column ss:AutoFitWidth="0" ss:Width="141.0"/&gt;
     &lt;Column ss:AutoFitWidth="0" ss:Width="152.0"/&gt;
     &lt;Row&gt;
      &lt;Cell ss:Index="2" ss:StyleID="s16"&gt;&lt;Data ss:Type="String"&gt;Ad Report&lt;/Data&gt;&lt;/Cell&gt;
     &lt;/Row&gt;
     &lt;Row ss:Index="3"&gt;
      &lt;Cell&gt;&lt;Data ss:Type="String"&gt;IssueNo: 1&lt;/Data&gt;&lt;/Cell&gt;
     &lt;/Row&gt;
     &lt;Row&gt;
      &lt;Cell&gt;&lt;Data ss:Type="String"&gt;IssueName: XXX&lt;/Data&gt;&lt;/Cell&gt;
     &lt;/Row&gt;
     &lt;Row&gt;
      &lt;Cell&gt;&lt;Data ss:Type="String"&gt;Issue Date: YYY&lt;/Data&gt;&lt;/Cell&gt;
     &lt;/Row&gt;
     &lt;Row ss:StyleID="s16"&gt;
      &lt;Cell&gt;&lt;Data ss:Type="String"&gt;  Ad Name  &lt;/Data&gt;&lt;/Cell&gt;
      &lt;Cell&gt;&lt;Data ss:Type="String"&gt;  UID   &lt;/Data&gt;&lt;/Cell&gt;
      &lt;Cell&gt;&lt;Data ss:Type="String"&gt; Status &lt;/Data&gt;&lt;/Cell&gt;
     &lt;/Row&gt;
     &lt;Row&gt;
      &lt;Cell&gt;&lt;Data ss:Type="String"&gt;WWW&lt;/Data&gt;&lt;/Cell&gt;
      &lt;Cell&gt;&lt;Data ss:Type="String"&gt;0A1&lt;/Data&gt;&lt;/Cell&gt;
      &lt;Cell&gt;&lt;Data ss:Type="String"&gt;active&lt;/Data&gt;&lt;/Cell&gt;
     &lt;/Row&gt;
     &lt;Row&gt;
      &lt;Cell&gt;&lt;Data ss:Type="String"&gt;XXX&lt;/Data&gt;&lt;/Cell&gt;
      &lt;Cell&gt;&lt;Data ss:Type="String"&gt;1B2&lt;/Data&gt;&lt;/Cell&gt;
      &lt;Cell&gt;&lt;Data ss:Type="String"&gt;active&lt;/Data&gt;&lt;/Cell&gt;
     &lt;/Row&gt;
     &lt;Row&gt;
      &lt;Cell&gt;&lt;Data ss:Type="String"&gt;YYY&lt;/Data&gt;&lt;/Cell&gt;
      &lt;Cell&gt;&lt;Data ss:Type="String"&gt;2C3&lt;/Data&gt;&lt;/Cell&gt;
      &lt;Cell&gt;&lt;Data ss:Type="String"&gt;inactive&lt;/Data&gt;&lt;/Cell&gt;
     &lt;/Row&gt;
    &lt;/Table&gt;
    &lt;WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"&gt;
     &lt;Print&gt;
      &lt;ValidPrinterInfo/&gt;
      &lt;PaperSizeIndex&gt;10&lt;/PaperSizeIndex&gt;
      &lt;HorizontalResolution&gt;-4&lt;/HorizontalResolution&gt;
      &lt;VerticalResolution&gt;-4&lt;/VerticalResolution&gt;
     &lt;/Print&gt;
     &lt;ShowPageLayoutZoom/&gt;
     &lt;PageLayoutZoom&gt;100&lt;/PageLayoutZoom&gt;
     &lt;Selected/&gt;
     &lt;Panes&gt;
      &lt;Pane&gt;
       &lt;Number&gt;3&lt;/Number&gt;
       &lt;ActiveRow&gt;13&lt;/ActiveRow&gt;
       &lt;ActiveCol&gt;2&lt;/ActiveCol&gt;
      &lt;/Pane&gt;
     &lt;/Panes&gt;
     &lt;ProtectObjects&gt;False&lt;/ProtectObjects&gt;
     &lt;ProtectScenarios&gt;False&lt;/ProtectScenarios&gt;
    &lt;/WorksheetOptions&gt;
   &lt;/Worksheet&gt;
  &lt;/Workbook&gt;
  </code></pre>
  
  <p>The white spaces in the Ad Name, UID, Status has to be removed</p>