Description
The fn:normalize-space function collapses whitespace in a string. Specifically, it performs three steps:
- Replaces each carriage return (#xD), line feed (#xA), and tab (#x9) character with a single space (#x20)
- Collapses all consecutive spaces into a single space
- Removes all leading and trailing spaces
This description is © Copyright 2007, O'Reilly Media. It is excerpted from the book XQuery by Priscilla Walmsley, O'Reilly, 2007. For a complete explanation of this function, please refer to Appendix A of the book. Arguments and Return Type| Name | Type |
$arg |
xs:string? |
| return value |
xs:string |
Examples| XSLT Example | Results |
|---|
normalize-space('query')
|
query
|
normalize-space(' query ')
|
query
|
normalize-space('xml query')
|
xml query
|
normalize-space('xml query')
|
xml query
|
normalize-space('xml
query')
|
xml query
|
normalize-space('')
|
zero-length string |
normalize-space(' ')
|
zero-length string |
normalize-space(())
|
zero-length string |
See AlsoHistory |
|