Subject: Re: [xsl] problem getting "every" expression to work From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Mon, 20 Jul 2009 14:23:34 -0400 |
Beginner here! I've been trying to use the "every" expression, but I can't seem to get it right. I put an example below and I'm hoping someone can help. I'm trying to do one thing when the element <container> is encoded for every c02[not(@level)] but something else when some of the c02[not(@level)] do not have <container> encoded. The example XSL code below is currently processing both of the <c01> in the example XML, even though the second <c01> has a <c02> with no <container> encoded.
<xsl:template match="c01[@level='series']"> ... process c01 elements when every c02/did has a container ... </xsl:template>
Good luck, Wendell
XSL: <xsl:template c01[@level='series']> <xsl:when test="c02[not(@level)][every $i in did satisfies $i/container]"> ...do such and such... ...otherwise do such and such... </xsl:template>
XML:
<c01 level="series">
<c02>
<did>
<container type="folder">239</container>
<unittitle>Committee on Economic and Racial Justice, 1935-1941</unittitle>
</did>
</c02>
<c02>
<did>
<container type="folder">239</container>
<unittitle>Congregational Christian Service Committee International Service Center,
1949-1950</unittitle>
</did>
</c02>
</c01>
<c01 level="series">
<c02>
<did>
<container type="folder">239</container>
<unittitle>Committee on Economic and Racial Justice, 1935-1941</unittitle>
</did>
</c02>
<c02>
<did>
<unittitle>Congregational Christian Service Committee International Service Center,
1949-1950</unittitle>
</did>
</c02>
</c01>
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] problem getting "every" e, Michael Kay | Thread | [xsl] nested for-each on disjoint n, Dick Penny |
RE: [xsl] problem getting "every" e, Michael Kay | Date | Re: [xsl] question on support of st, Hermann Stamm-Wilbra |
Month |