Makes two changes when it returns its argument value:
It removes leading and trailing white-space characters.
It replaces all substrings of two or more white-space characters that are not leading characters with a single white-space character.
normalize-space(string-parameter)
This example applies normalize-space to a parameter that includes leading and trailing spaces, and embedded newline and tab characters:
select xmlextract ('normalize-space(" Normalize space example. ")', text_doc) from sample_docs where name_doc='bookstore' ------------------------ Normalize space example.
normalize-space and tolower or toupper are useful in XPath predicates, when you are testing values whose use of white space and case is not known. The following predicate is unaffected by the case and whitespace usage in the title elements:
select xmlextract ('//magazine[normalize-space(tolower(title)="tracking trenton")]//price', text_doc) from sample_docs where name_doc='bookstore' -------------------------- <price>55</price>
Copyright © 2004. Sybase Inc. All rights reserved. |
![]() |