This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Is this possible in XSLT


"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]