[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] How do I search ancestors in the output tree?


Subject: Re: [xsl] How do I search ancestors in the output tree?
From: "Christopher R. Maden" <crism@xxxxxxxxx>
Date: Fri, 31 Aug 2012 15:36:05 -0400

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/31/2012 03:32 PM, Costello, Roger L. wrote:
> How do I search ancestors in the output tree?  (As opposed to
> searching ancestors in the input tree).

You donbt.

But you know what your input is, and you know what your transformation
rules are, so you should be able to deduce what your output tree is.

E.g.,

<xsl:template match="Book">
  <xsl:choose>
    <xsl:when test="ancestor::A[@id = current()/@id]">
      <!-- do something... -->
    </xsl:when>
    <xsl:otherwise>
      <!-- do something else ... -->
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

~Chris
- --
Chris Maden, text nerd  <URL: http://crism.maden.org/ >
LIVE FREE: vote for Gary Johnson, Libertarian for President.
     <URL: http://garyjohnson2012.com/ >  <URL: http://lp.org/ >
GnuPG fingerprint: DB08 CF6C 2583 7F55 3BE9  A210 4A51 DBAC 5C5C 3D5E
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQEcBAEBAgAGBQJQQRIlAAoJEEpR26xcXD1esrkH/3ShEBVCfJlbESMJta4LHhxV
l35WMlKD5avEpH1iqFRW1DO8u1ONzpnekVnm/HZIjWPu0ro32m+LVrd2xd0kUqI8
rNFeGp/Tq0Ket2JdzaNfBrIhBwchGWSEo/UlQ+QUjKyp0u6AxDbVBeL6sT0Q3TCb
59NZzthHn2rYaf2V4ELnxZ2hFWZAfuSO87UfxUnKxLXPFXW5iupA8PdW9EryL3j0
SOBFNDhtZ5EhlmqMM521oWvUGcPUzGahIKliQCeOWy6CbqlLDx5VIG+ZaeFVcFf2
w5zPIi0jPujl8ljrVYITz5OwmkCwN/anHm+vuXW1rCUBksGSCfaeehqwm9dlTsQ=
=oYUQ
-----END PGP SIGNATURE-----


Current Thread