Skip to content
Snippets Groups Projects
Commit a0e3280a authored by usikora's avatar usikora :monkey:
Browse files

add @break='yes' if tei:pb has a whitespace text() as preceding or following sibling

parent 5f425c17
No related branches found
No related tags found
No related merge requests found
...@@ -186,7 +186,7 @@ declare function pre:preprocessing ...@@ -186,7 +186,7 @@ declare function pre:preprocessing
) )
case element(pb) return ( case element(pb) return (
let $preceeding-sibling := $node/preceding-sibling::node()[1] let $preceding-sibling := $node/preceding-sibling::node()[1]
let $following-sibling := $node/following-sibling::node()[1] let $following-sibling := $node/following-sibling::node()[1]
let $first := $node = $node/parent::node()/node()[not(self::text() and normalize-space(self::node()) = '')][1] let $first := $node = $node/parent::node()/node()[not(self::text() and normalize-space(self::node()) = '')][1]
let $ignore := ("docAuthor", "app", "index", "seg", "bibl") let $ignore := ("docAuthor", "app", "index", "seg", "bibl")
...@@ -195,15 +195,29 @@ declare function pre:preprocessing ...@@ -195,15 +195,29 @@ declare function pre:preprocessing
$node/@*, $node/@*,
if ( if (
( $preceeding-sibling[self::text() and not(normalize-space(.) = '')] and ends-with($preceeding-sibling, " ") = false() ) ( $preceding-sibling[self::text() and not(normalize-space(.) = '')] and ends-with($preceding-sibling, " ") = false() )
and and
( $following-sibling[self::text() and not(normalize-space(.) = '')] and starts-with($following-sibling, " ") = false() ) ( $following-sibling[self::text() and not(normalize-space(.) = '')] and starts-with($following-sibling, " ") = false() )
) then ( attribute {"break"}{"no"} ) ) then ( attribute {"break"}{"no"} )
(:else if (
( $preceeding-sibling[self::text() and not(normalize-space(.) = '')] and ends-with($preceeding-sibling, " ") = true() )
and
( $following-sibling[self::text() and not(normalize-space(.) = '')] and starts-with($following-sibling, " ") = true() )
) then ( attribute {"clear"}{"left"} ) :)
else if ( $following-sibling[self::docAuthor or self::app or self::index or self::seg or self::bibl] ) then ( else if ( $following-sibling[self::docAuthor or self::app or self::index or self::seg or self::bibl] ) then (
attribute {"break"}{"yes"} attribute {"break"}{"yes"}
) )
else if (
( $preceding-sibling[self::text() and normalize-space(.) = ''] )
and
( $following-sibling[self::text() and normalize-space(.) = ''] )
) then (
attribute {"break"}{"yes"}
)
else ( ) else ( )
} }
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment