I think actually there are some error conditions that we're not catching currently. For instance, the following input in serialize-direct-uri.xq:
{ "scheme" : "file", "path" : "d:/a/b/c" }
is a non-opaque URI because it has a path, rather than an opaque-part. But it produces the output:
file:d:/a/b/c
which is an opaque URI. I believe that the input is illegal, because a non-opaque URI with a scheme MUST have a path section that begins with a / character. So the above input should actually raise an error.
I think actually there are some error conditions that we're not catching currently. For instance, the following input in serialize- direct- uri.xq:
{ "scheme" : "file", "path" : "d:/a/b/c" }
is a non-opaque URI because it has a path, rather than an opaque-part. But it produces the output:
file:d:/a/b/c
which is an opaque URI. I believe that the input is illegal, because a non-opaque URI with a scheme MUST have a path section that begins with a / character. So the above input should actually raise an error.