This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Is this possible in XSLT
- To: XSL List <xsl-list at lists dot mulberrytech dot com>
- Subject: Re: [xsl] Is this possible in XSLT
- From: Joerg Pietschmann <joerg dot pietschmann at zkb dot ch>
- Date: Thu, 30 Aug 2001 18:10:36 +0200
- Organization: ZKB
- Reply-To: xsl-list at lists dot mulberrytech dot com
"Nicholas Waltham" <info@nwaltham.com> wrote:
> I would like to be able to check a series items in a list against items in
> another. Selecting the parent item of the second list if it contains all the
> items in the list (but it may contain more) for example
If you want to check whether all the elements in a node set $list1
have similar companions in another node set $list2 you can try
something like this
<xsl:if test="$list/item[not($list2/item/@id=@id)]">
<xsl:message>Check failed</xsl:message>
</xsl:if>
If position is relevant too, or element names are variable, or
the structure if the elements may be more complicated, it gets
more difficult.
> I immagine being able to create a dom xml fragment containing the first list
> to be able to do this - I don't know if this really a good idea or not.
If you mean you'll resort to a script embedded in the style sheet:
This depends on what you exactly mean by "check against". Some, but
not all problems are easier solved in a script.
HTH
J.Pietschmann
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list