Hi!
I'm relatively new to BaseX/XQuery and currently using a XML with the following format:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <modsCollection xmlns="http://www.loc.gov/mods/v3" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-0.xsd "> <mods ID="ISI:000330282600027" version="3.0"> <titleInfo> <title>Minimum Relative Entropy for Quantum Estimation: Feasibility and General Solution</title> </titleInfo>
The file is called "quantuminformation.xml", inside the DB "ExemploBibtex"
I'm trying to extract the titles of all articles in the document, using the following query:
for $doc in collection('ExemploBibtex') where matches(document-uri($doc), 'quantuminformation.xml') return $doc/modsCollection/mods/titleInfo/title/text()
It doesn't matter if I use the text() or fn:string, the result is always empty.
What am I doing wrong?
Sorry for bothering and thank you for the attention.