xsl-list
[Top] [All Lists]

[xsl] problem getting "every" expression to work

2009-07-20 13:48:16
Dear all,

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.

Thanks in advance for any help!
Joyce Chapman

XSL:
<xsl:template c01[(_at_)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>

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>