This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: divide strings
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] divide strings
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Sun, 23 Sep 2001 22:55:49 +0100
- Cc: <daniel dot goldbach at gmx dot de>
- Reply-To: xsl-list at lists dot mulberrytech dot com
> I hope someone can help me... I have the following
> problem... if you have a
> schema with a <union> tag in it, it looks e.g. like this:
>
> </xsd:simpleType>
> <xsd:simpleType name="CostelloFamily">
> <xsd:union memberTypes="PatsFamily BarbsFamily
> JudysFamily TomsFamily RogersFamily
> JohnsFamily"/>
> </xsd:simpleType>
>
> You can union all simpleTypes mentioned within "memberTypes".
> Now my question: I do not want to get the whole String
> membertypes but I
> would like to divide it into its several simpleTypes.
> Furthermore I would like
> to create a loop that runs until all simpleTypes within
> memberTypes were
> selected...
You need to use a recursive named template. The template processes the first
word in the string (identified using substring-before()), then calls itself
to process the remaining words in the string (identified using
substring-after()). You'll find plenty of examples of such templates in XSLT
Programmer's Reference or on the FAQ site.
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list