Boboms

Filter.xsl

Aug 9th, 2024
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.84 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" exclude-result-prefixes="office table text">
  3.  
  4.   <xsl:output method = "xml" indent = "yes" encoding = "UTF-8" omit-xml-declaration = "no"/>
  5.  
  6.   <xsl:template match="/">
  7.  
  8.    <xsl:apply-templates select="/*/office:body" />
  9.  
  10.  </xsl:template>
  11.  
  12.  <xsl:template match="office:body">
  13.   <xsl:apply-templates />
  14.  </xsl:template>
  15.  
  16.  <xsl:template match="office:spreadsheet">
  17.   <xsl:apply-templates />
  18.  </xsl:template>
  19.  
  20.  <xsl:template match="office:spreadsheet/table:table">
  21.  <memorials>
  22.     <memorial health="true" ord="1">
  23.             <name>Base</name>
  24.             <notes></notes>
  25.    <xsl:for-each select="table:table-row[position() > 1]">
  26.  
  27.         <records>
  28.             <xsl:variable name="mygender1">
  29.                         <xsl:value-of select="table:table-cell[1]/text:p" />
  30.                 </xsl:variable>
  31.  
  32.             <xsl:variable name="myord1">
  33.                         <xsl:value-of select="table:table-cell[2]/text:p" />
  34.                 </xsl:variable>
  35.  
  36.             <xsl:variable name="mystatus1">
  37.                         <xsl:value-of select="table:table-cell[3]/text:p" />
  38.                 </xsl:variable>
  39.  
  40.             <xsl:variable name="myprefix1">
  41.                         <xsl:value-of select="table:table-cell[4]/text:p" />
  42.                 </xsl:variable>
  43.    
  44.             <record gender="{$mygender1}" ord="{$myord1}" status="{$mystatus1}" prefix="{$myprefix1}">
  45.                     <name><xsl:value-of select="table:table-cell[5]/text:p" /></name>
  46.                 <comment><xsl:value-of select="table:table-cell[6]/text:p" /></comment>
  47.                
  48.                 </record>
  49.         </records>
  50.  
  51.    </xsl:for-each>
  52.  
  53.     </memorial>
  54. </memorials>
  55.  </xsl:template>
  56. </xsl:stylesheet>
Tags: xml XSLT
Advertisement
Add Comment
Please, Sign In to add comment