Commit 287d6fa6 authored by Wolfgang's avatar Wolfgang

docx parsing: avoid invalid URL exception when copying media files

parent d36a93e2
......@@ -51,7 +51,9 @@ declare function docx:copy-media($rels as element(), $unzipped as xs:string, $me
if ($mediaPath) then
let $pathComponents := tokenize(replace($mediaPath, "^/db/(.*)$", "$1"), "/")
let $collection := docx:mkcol-recursive("/db", $pathComponents)
for $image in $rels/rel:Relationship[@Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"]
for $image in $rels/rel:Relationship
[@Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"]
[not(@TargetMode)]
let $target := $image/@Target
let $relPath := replace($target, "^(.*?)/[^/]+$", "$1")
let $imgName := replace($target, "^.*?([^/]+)$", "$1")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment