In our software we’re using a Basex database and integrate with it via the Java library. We’re currently using 8.0.3, but attempted to upgrade to the latest version (9.0.2) when
we encountered a breaking issue. The REPLACE command class now interprets all XML with an attribute as a path. I can reproduce this in the basex command line client, but not the GUI.
Reproducer case:
BaseX 9.0.2 [Client]
Try 'help' to get more information.
> create db test
Database 'test' created in 25.24 ms.
> open db test
Database 'db' was not found.
> open test
Database 'test' was opened in 1.57 ms.
> REPLACE com.example.model.user.Account-2397 "<text version="draft"><title>Chapter</title></text>"
Resource "C:/Java/basex902/bin/"<text version=draft><title>Chapter</title></text>"" not found.
> REPLACE com.example.model.user.Account-2397 <text version="draft"><title>Chapter</title></text>
Resource "C:/Java/basex902/bin/"<text version=draft><title>Chapter</title></text>"" not found.
> REPLACE com.example.model.user.Account-2397 <text version='draft'><title>Chapter</title></text>
Resource "C:/Java/basex902/bin/"<text version='draft'><title>Chapter</title></text>"" not found.
> REPLACE "com.example.model.user.Account-2397" <text version='draft'><title>Chapter</title></text>
Resource "C:/Java/basex902/bin/"<text version='draft'><title>Chapter</title></text>"" not found.
> REPLACE "com.example.model.user.Account-2397" "<text version='draft'><title>Chapter</title></text>"
Resource "C:/Java/basex902/bin/"<text version='draft'><title>Chapter</title></text>"" not found.
> REPLACE top.xml "<text version='draft'><title>Chapter</title></text>"
Resource "C:/Java/basex902/bin/"<text version='draft'><title>Chapter</title></text>"" not found.
> REPLACE top.xml <xml/>
0 resource(s) replaced in 29.71 ms.
> REPLACE top.xml <xml version='draft'/>
Resource "C:/Java/basex902/bin/"<xml version='draft'/>"" not found.
>
Storing the XML in a file and replacing that works:
> REPLACE com.example.model.user.Account-95 test.xml
1 resource(s) replaced in 5.03 ms.
> xquery //account
<account uuid="83ff82e4-01b1-4624-969e-2ba7e7deeb29" id="10095"><x/></account>
Can you assist in solving this mystery?