Warning: file_get_contents(documentation/articles/samplesminiappminiapp.sh.html): failed to open stream: No such file or directory in /home/norejdls/sites/ns-xml/www/lib/ns-php/ns/ui/tab.5.php on line 90

Warning: file_get_contents(documentation/articles/samplesminiappminiapp.sh.html): failed to open stream: No such file or directory in /home/norejdls/sites/ns-xml/www/lib/ns-php/ns/ui/tab.5.php on line 90

Warning: Cannot modify header information - headers already sent by (output started at /home/norejdls/sites/ns-xml/www/lib/ns-php/ns/ui/tab.5.php:90) in /home/norejdls/sites/ns-xml/www/index.php on line 124
ns-xml project home ~ XSLT documentation
  / Strings manipulation

Table of content

Parameters

Variables

Templates


Details

Parameters

Default End-of-line character(s)
str.blanks="' '"

Default value: ' '

Variables

UNIX-style end of line character (LF)
MacOS-style end of line character (CR)
Windows-style end of line character (CRLF)
str.breakables="' ,;:?.!'"
Breakable characters. The first 2 characters are always breakable, the others requires a space after

Default value: ' ,;:?.!'
str.smallCase="'abcdefghijklmnopqrstuvwxyz'"

Default value: 'abcdefghijklmnopqrstuvwxyz'
str.upperCase="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"

Default value: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
str.ascii="!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"

Default value: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
str.hex="0123456789ABCDEF"

Default value: 0123456789ABCDEF

Templates


Indicates if text contains blank chars
  1. text
    Text to check
  2. _position
    Reserved
    Default value: 1
str.isBlankChar(char="substring(., 1, 1)", _position="1")

Output 1 if the character is a blank character, O otherwise
  1. char
    Characted to test
    Default value: substring(., 1, 1)
  2. _position
    Private parameter
    Default value: 1

Get the substring before the last occurrence of the given delimiter
  1. text
  2. delimiter

Get the substring after the last occurence of the given delimiter
  1. text
  2. delimiter

Number of occurrence of a given string at the beginning of another string
  1. text
    Text
  2. needle
    Substring to search
  3. offset
    Internal use
    Default value: 1
  4. count
    Internal use
    Default value: 0
  1. text
    Text
  2. needle
    Substring to search

Number of occurrence of a given string at the end of another string
  1. text
    Text
  2. needle
    Substring to search
  3. offset
    Internal use
    Default value: 0
  4. count
    Internal use
    Default value: 0

Replace a string by another
  1. text
    Text to process
  2. replace
    Text to replace
  3. by
    Replacement string

Count occurences of a string in another
  1. text
    Text to process
  2. substring
    Substring to count
  3. _count
    Reserved
    Default value: 0

Repeat a string
  1. text
    Text to repeat
    Default value: ' '
  2. iterations
    Repetitions
    Default value: 1
  1. node
    Default value: .
str.firstBreakableCharacterPosition(text=".", startOffset="0", _position="1", _bestValue="string-length($text) + 1")
  1. text
    Text to process
    Default value: .
  2. startOffset
    Don't consider character before
    Default value: 0
  3. _position
    Internal use
    Default value: 1
  4. _bestValue
    Internal use
    Default value: string-length($text) + 1

Find the last breakable character index
  1. text
    Text to process
    Default value: .
  2. startOffset
    Don't consider character before
    Default value: 0
  3. _position
    Internal use
    Default value: 1
  4. _bestValue
    Internal use
    Default value: -1
str.wrap(text=".", lineMaxLength="80", endlChar="$str.endl", forceBreak="true()")

Wrap text
  1. text
    Text to wrap
    Default value: .
  2. lineMaxLength
    Maximum number of character per line
    Default value: 80
  3. endlChar
    End-of-line string
    Default value: $str.endl
  4. forceBreak
    Force line break even if no breakable character was found
    Default value: true()
str.prependLine(text, level="1", prependedText, endlChar="$str.endl", wrap="false()", forceBreak="true()", lineMaxLength="80")

Indent a text block by adding indentaction characters at the beginning of all text lines
  1. text
  2. level
    Default value: 1
  3. prependedText
  4. endlChar
    Default value: $str.endl
  5. wrap
    Default value: false()
  6. forceBreak
    Default value: true()
  7. lineMaxLength
    Default value: 80

Trim text at the beginning and the end
  1. text
    Text to trim
    Default value: .
  1. text
    Default value: .
  1. text
    Default value: .

http://lists.xml.org/archives/xml-dev/200109/msg00248.html
  1. text
  2. prefix
  3. suffix

Decode base64 encoded string as hex string. Adapted from the work of Hermann Stamm-Wilbrandt. http://stamm-wilbrandt.de/en/xsl-list/Base64ToHex.xsl
  1. text
    Base64 text to convert
  2. _init
    Private parameter
    Default value: true()