Subject:tokenize a string with \r Author:Dana Pearson Date:25 Sep 2012 08:16 PM
Hoping someone might enlighten me about the use of tokenizing a string based on a carriage return. I'm using SS Enterprise Edition 2010.
I've used the tokenize function frequently but never on carriage return. My requirement here is to split a dc:alternative title string (see below). The string before the first \r will go the subfield/@code='a', the remainder of the content will go into @code='b'.
There are relatively few of instances of such title strings but when they occur, the string must be split. I tried substring before and after functions first but without the result I wanted although I had no idea whether it would split on the first or any \r. It did nothing.
But using the tokenize function has the same result.
I'm using \r because that is the character separating the last character on a line; the next character is the first on the following line. I've tried using �D; as well although they are the same.
Finally, in another content analysis stylesheet, I tried the following for which I received the error message:
"At least one xsl:matching-substring or xsl:non-matching-substring element must be present."
This is what I suspected about the variable construction but received no such error messages; that is, the test for
contains(.[@rdf:parseType], '\r+')">
has no effect at all.
Am I wrong that \r is the character to split this string?
In the partial code posted we don't see the template which is supposed to split the string and save the result into different attributes. If the above does not help. please post the full XSLT code and a sample of the RDF input document.
Subject:tokenize a string with \r Author:Dana Pearson Date:25 Sep 2012 11:04 PM
thanks for your reply, Ivan.
I tried out your suggestion but got the peculiar message that the processor was expecting </xsl:foreach> at the closing element of your $tokens variable.
Don't understand the use of 
 since the XSLT editor says that the character I'm focusing on is $#0D;
Should have posted the relevant use of the variable earlier but was thinking that I was misunderstading something in my variable code.
Should have reviewed contain(). In any case here is what I'm trying to do.