Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
intermediate-format
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
bibliothek-der-neologie
intermediate-format
Commits
4b38b4d9
Commit
4b38b4d9
authored
6 years ago
by
MRodz
Browse files
Options
Downloads
Patches
Plain Diff
Undo changes (have been introduced for testing)
parent
2d8ea5d8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/intermediate_format/whitespace-handling.xqm
+15
-2
15 additions, 2 deletions
modules/intermediate_format/whitespace-handling.xqm
with
15 additions
and
2 deletions
modules/intermediate_format/whitespace-handling.xqm
+
15
−
2
View file @
4b38b4d9
...
@@ -31,9 +31,9 @@ declare function whitespace:text
...
@@ -31,9 +31,9 @@ declare function whitespace:text
(
$text
as
text
()
*,
$escape-char
as
xs:string
?
)
as
text
()
*
{
(
$text
as
text
()
*,
$escape-char
as
xs:string
?
)
as
text
()
*
{
let
$whitespace-node
:=
$text
[
matches
(
.,
"[\s\n\r\t]"
)
and
normalize-space
(
.
)
=
""
]
let
$whitespace-node
:=
$text
[
matches
(
.,
"[\s\n\r\t]"
)
and
normalize-space
(
.
)
=
""
]
let
$single-whitespace-between-nodes
:=
$text
=
' '
let
$single-whitespace-between-nodes
:=
$text
=
" "
return
return
if
(
not
(
$whitespace-node
)
or
$single-whitespace-between-nodes
)
then
(
if
(
not
(
$whitespace-node
))
then
(
if
(
$escape-char
)
then
(
if
(
$escape-char
)
then
(
whitespace:escape-text
(
$text
,
"@"
)
whitespace:escape-text
(
$text
,
"@"
)
...
@@ -63,3 +63,16 @@ declare function whitespace:escape-text
...
@@ -63,3 +63,16 @@ declare function whitespace:escape-text
text
{
replace
(
$text
,
'[\s]+'
,
$escape
)}
text
{
replace
(
$text
,
'[\s]+'
,
$escape
)}
};
};
declare
function
whitespace:remove
(
$nodes
as
node
()
*
)
as
node
()
*
{
for
$node
in
$nodes
return
typeswitch
(
$node
)
case
text
()
return
if
([
matches
(
$node
,
"[\s\n\r\t]"
)
and
normalize-space
(
.
)
=
""
])
then
()
else
$node
default
return
$node
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment