[mod] tidy

This commit is contained in:
Andy Bunce 2025-10-07 17:23:32 +01:00
parent b0e18a87ac
commit 529b57d628
8 changed files with 19 additions and 29 deletions

View file

@ -1,6 +1,5 @@
import module namespace hnd="lsp/handlers" at "../webapp/lsp/handlers.xqm";
import module namespace syms="lsp/symbols" at "../webapp/lsp/providers/documentSymbols.xqm";
import module namespace lsp-diags = 'lsp-diags' at "../webapp/lsp/providers/diagnostics.xqm";
declare variable $src:="sample.docs/parse-pdfbox.xml";
declare variable $parse:=doc($src)/*;
hnd:diags($parse )
declare variable $text:=unparsed-text("sample.docs/pdfbox3-bad.xqm");
lsp-diags:list("file",$text,$parse )

View file

@ -34,7 +34,7 @@ declare namespace rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
declare namespace RandomAccessReadBuffer="java:org.apache.pdfbox.io.RandomAccessReadBuffer";
declare namespace RandomAccessReadBufferedFile = "java:org.apache.pdfbox.io.RandomAccessReadBufferedFile";
declare namespace PDRectangle="org.apache.pdfbox.pdmodel.common.PDRectangle";
declare namespace PDRectangle="java:org.apache.pdfbox.pdmodel.common.PDRectangle";
declare namespace File ="java:java.io.File";

View file

@ -1,5 +1,6 @@
xquery version '3.1';
xquery version '3.1';
(:~
A BaseX 10.7+ interface to pdfbox3 https://pdfbox.apache.org/ ,
requires pdfbox jars on classpath, in lib/custom or xar
@note following the java source the terms outline and bookmark
refer to the same concept. Also label and (page)range are used interchangably
@ -286,8 +287,7 @@ as map(*)*{
=>PDDocumentCatalog:getDocumentOutline()
return if(exists($outline))
then pdfbox:outline($pdf,PDOutlineItem:getFirstChild($outline))
else ()
then pdfbox:outline($pdf,PDOutlineItem:getFirstChild($outline))
}
};
@ -364,7 +364,6 @@ as item()?
then PDDocument:getDocumentCatalog($pdf)
=>PDDocumentCatalog:getPages()
=>PDPageTree:indexOf($page)
else ()
};
(:~ Return new PDF doc with pages from $start to $end as xs:base64Binary, (1 based)
@ -436,7 +435,7 @@ as xs:string?{
return string-join(($page,
if(empty($style)) then "-" else $style,
if(($start eq 1)) then "" else $start,
if(exists($prefix)) then '*' || $prefix else () (:TODO double " :)
if(exists($prefix)) then '*' || $prefix (:TODO double " :)
))
};