File: buscaPar.xsl

package info (click to toggle)
apertium-en-ca 0.8.4-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 11,044 kB
  • ctags: 15
  • sloc: xml: 9,313; sh: 457; makefile: 193
file content (55 lines) | stat: -rw-r--r-- 1,977 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8" indent="no"/>

<xsl:template match="/">
  <xsl:text disable-output-escaping="yes"><![CDATA[
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                              xmlns:data="http://www.apertium.org">
	<xsl:import href="principal.xsl"/>
	<data:paradigms>
]]> </xsl:text>

  <xsl:apply-templates select="//par[@prm]">
	<!-- Show the sorted pairs of expansion -->
	<xsl:sort select='./@n' data-type='text' order='descending' />
  	  <xsl:sort select='./@prm' data-type='text' order='descending' />
  </xsl:apply-templates>
  <xsl:apply-templates select="//par[@sa]">
	<!-- Show the sorted pairs of expansion -->
	<xsl:sort select='./@n' data-type='text' order='descending' />
  	  <xsl:sort select='./@sa' data-type='text' order='descending' />
  </xsl:apply-templates>

  <xsl:text disable-output-escaping="yes"><![CDATA[
	</data:paradigms>
  <xsl:variable name="paradigms" select="document('')/*/data:paradigms/*"/>
</xsl:stylesheet>
  ]]> </xsl:text>

</xsl:template>



<!-- type is "text" to insert a simple text and is "tag" to insert a xml tag -->
<xsl:template match="par[@prm]">
  <xsl:text disable-output-escaping="yes"><![CDATA[		<paradigm name="]]></xsl:text>
  <xsl:value-of select="@n"/> 
  <xsl:text disable-output-escaping="yes"><![CDATA[" prm="]]></xsl:text>
  <xsl:value-of select="@prm"/> 
  <xsl:text disable-output-escaping="yes"><![CDATA[" type="text"/>
]]> </xsl:text>
</xsl:template>
<xsl:template match="par[@sa]">
  <xsl:text disable-output-escaping="yes"><![CDATA[		<paradigm name="]]></xsl:text>
  <xsl:value-of select="@n"/> 
  <xsl:text disable-output-escaping="yes"><![CDATA[" prm="]]></xsl:text>
  <xsl:value-of select="@sa"/> 
  <xsl:text disable-output-escaping="yes"><![CDATA[" type="tag"/>
]]> </xsl:text>
</xsl:template>



</xsl:stylesheet>