/[formed]/trunk/contrib/extract-xfa-items.sh
ViewVC logotype

Diff of /trunk/contrib/extract-xfa-items.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 39 by teichmann, Sun Aug 12 22:21:30 2007 UTC revision 40 by teichmann, Mon Aug 13 16:01:14 2007 UTC
# Line 23  fieldname="'$1'" Line 23  fieldname="'$1'"
23          <xsl:output method="xml" encoding="UTF-8"/>          <xsl:output method="xml" encoding="UTF-8"/>
24    
25          <xsl:template match="tmp:field[@name = $fieldname]/tmp:items">          <xsl:template match="tmp:field[@name = $fieldname]/tmp:items">
26                  <items>                  <choice>
27          <xsl:apply-templates/>          <xsl:apply-templates/>
28                  </items>                  </choice>
29          </xsl:template>          </xsl:template>
30    
31          <xsl:template match="tmp:field[@name = $fieldname]/tmp:items/tmp:text">          <xsl:template match="tmp:field[@name = $fieldname]/tmp:items/tmp:text">
32                  <item>                  <bool>
33                  <xsl:attribute name="value">        <xsl:attribute name="value">
34                          <xsl:value-of select="count(preceding-sibling::*)"/>          <xsl:value-of select="count(preceding-sibling::*)"/>
35                  </xsl:attribute>        </xsl:attribute>
36                  <xsl:attribute name="description">        <xsl:attribute name="description">
37                          <xsl:value-of select="."/>          <xsl:value-of select="."/>
38                  </xsl:attribute>        </xsl:attribute>
39                  </item>                  </bool>
40          </xsl:template>          </xsl:template>
41    
42    <xsl:template match="text()" />    <xsl:template match="text()" />
43          <xsl:template match="/">          <xsl:template match="/">
44        <document>
45          <xsl:apply-templates select="//tmp:field[@name = $fieldname]/tmp:items"/>          <xsl:apply-templates select="//tmp:field[@name = $fieldname]/tmp:items"/>
46        </document>
47          </xsl:template>          </xsl:template>
48    
49  </xsl:stylesheet>  </xsl:stylesheet>

Legend:
Removed from v.39  
changed lines
  Added in v.40

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26