0

My XQuery is like this:

for $cit in  /*:CitedReferenceCIT[@status = 'D']
where contains($cit/@file, "#")
return string-join(base-uri($cit/@file))

When I run this query, I got the error prompt like this:

Error:

Stopped at C:/Users/Administrator/Desktop/XQuery/233Update.xq, 3/28: [XQST0046] URI '/STD_KR_CIT_ZIP/20160927/20070102/20070102-1-001.ZIP/1/KR202007000003512KR00200700003560ACITKO20070102KR00#/KR202007000003512KR00200700003560ACITKO20070102KR00#.XML' is invalid.

It seems related to the '#', but this is what it is in the file path, there is no way to overcome this, Can anyone tell me how to overcome this?

piet.t
  • 11,718
  • 21
  • 43
  • 52
  • It would help if you showed an example of what you are trying to achieve, or at least explained it. A sample of the input and the full query would also be helpful as at the moment it's not clear if your context is a database path or a file in the filesystem. It's also not clear that this is an issue restricted to BaseX so you may get more help if you tag it with the relevant XQuery tag. – chrisis Jun 22 '17 at 12:05
  • I was trying retrieving document path from database, I need the path in string type, I referred to some books and found the base-uri() fucntion can return the document uri, I tried the function with my some document in dirctory, it returns what I really want. But when I use it with my database, It came acrossed with some illegal URI that contains '#', I finally found that db:path() is the right function for me. – Donald John Jun 22 '17 at 14:37

1 Answers1

0

Use db:path() instead of base-uri() to get the document path in database.