This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: use of starts-with()
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] use of starts-with()
- From: "Matthew L. Avizinis" <mla at gleim dot com>
- Date: Fri, 26 Oct 2001 13:18:26 -0400
- Reply-To: xsl-list at lists dot mulberrytech dot com
Thanks much. However, this solution only works if the string contains only
the integer, parenthesis and space, i.e. without any other text. In the
original question I asked if the string _starts with_ "#) " [#=some int].
In comparing this solution with David Carlisle's, his is the more general
case.
It was fun to work this out, though. Thanks for both your efforts. This
was a good way to increase my skill a little more. (Although now that the
solution is laid out in front of me, I see that half the solution was
staring me in the face as an example all along on page 562 of XSLT
Programmer's Reference, 2nd. I just couldn't see how to put the two halves
together.)
And on the remote chance anyone is interested in why I wanted to know this:
My company had a number of outlines which were formatted in HTML. Since at
that time we needed a list type of "#) followed_by_text" we had create a <ol
style="list-type: none"> and insert the counting numbers as I outlined.
Now, years later, we XHTML-ized the HTML, and are converting it to an
XML-based publishing paradigm, but we only need the content from those lines
not the "#) " at the start. Now with this eloquent little check, when all
the <li> nodes are parsed the "#) " can be easily removed. Thanks again.
Matthew L. Avizinis <mailto:mla@gleim.com>
Gleim Publications, Inc.
4201 NW 95th Blvd.
Gainesville, FL 32606
(352)-375-0772 ext. 101
www.gleim.com <http://www.gleim.com>
> -----Original Message-----
> From: owner-xsl-list@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Chris Bayes
> Sent: Thursday, October 25, 2001 8:14 PM
> To: xsl-list@lists.mulberrytech.com
> Subject: RE: [xsl] use of starts-with()
>
>
> > Correct?
> Maybe. Or
> starts-with(translate(.,'123456789','000000000'),substring('000000)',8 -
> string-length(.)))
>
> Ciao Chris
>
> XML/XSL Portal
> http://www.bayes.co.uk/xml
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list