xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Why is apply-templates not called?


Subject: [xsl] Why is apply-templates not called?
From: Jeff Lowery <jlowery@xxxxxxxxxxxxxx>
Date: Mon, 9 Dec 2002 17:35:45 -0800

I suspect I'm going to expose a fundamental misunderstanding of how XSLT
works, but here goes...

Using the following script snippet, both <Color> elements are output
correctly:

<xsl:template match="jdf:ColorantControl">
  <ProcessColorMap>
    <xsl:for-each select="jdf:ColorPool/jdf:Color[(@Name='Cyan') or
(@Name='Yellow') or (@Name='Magenta') or (@Name='Black')]">
      <Color
       colorName="{@Name}"
      >
      </Color>
    </xsl:for-each>
  </ProcessColorMap>
  <SpotColorMap>
    <xsl:for-each select="jdf:ColorPool/jdf:Color[not((@Name='Cyan') or
(@Name='Yellow') or (@Name='Magenta') or (@Name='Black'))]">
      <Color
         colorName="{@Name}"
      >
      </Color>
    </xsl:for-each>
  </SpotColorMap>
</xsl:template>

This approach works, but contains duplicate XML.  What I'd like to do is put
this common XML in another template, so I would have:

...
<SpotColorMap>
    <xsl:for-each select="jdf:ColorPool/jdf:Color[not((@Name='Cyan') or
(@Name='Yellow') or (@Name='Magenta') or (@Name='Black'))]">
       <xsl:apply-templates/>
    </xsl:for-each>
  </SpotColorMap>
...

<xsl:template match="jdf:Color">
      <Color
         colorName="{@Name}"
      >
      </Color>
</xsl:template>


But she no work!

I'm using instant Saxon 6.5.2

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor