Header problems and xmlns
Saturday, 20 February 2016 · 2 messages
AL
Ana Victória Ladeira20 Feb 2016 16:56 #
Good afternoon!
I currently have a dataset with some files that use the following header (I will call it Header1):
<?xml version="1.0" encoding="ISO-8859-1"?><CURRICULO-VITAE
SISTEMA-ORIGEM-XML="LATTES_OFFLINE" xmlns:lattes="
http://www.cnpq.br/2001/XSL/Lattes" NUMERO-IDENTIFICADOR="X" DATA-ATUALIZACAO="07122015" HORA-ATUALIZACAO="010008" xsi:schemaLocation=" http://www.cnpq.br/2014/XSD/Lattes/Versao1 CurriculoLattes.xsd" xmlns=" http://www.cnpq.br/2014/XSD/Lattes/Versao1" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance">
Other files use this other header (Header2):
<?xml version="1.0" encoding="UTF-8"?><CURRICULO-VITAE
SISTEMA-ORIGEM-XML="LATTES_OFFLINE" DATA-ATUALIZACAO="13072015"
HORA-ATUALIZACAO="145233" NUMERO-IDENTIFICADOR="X" xmlns:lattes="
http://www.cnpq.br/2001/XSL/Lattes">Using the same query, I can extract data from files with Header2, but now with Header1.
I'm only using FLWOR expressions, and the queries are very simple. I've tried with multiple queries, and the result is always the same: I'm able to extract the information I want from files with Header2, but not from the ones with Header1.
I think its a problem with the namespace, but I don't know how to solve it.
Can anyone please help me with that?
Thank you in advance,
Ana Victória Ladeira
MG
Maximilian Gärber20 Feb 2016 21:13 #
Hi,
you need to handle the default nsmespace e.g.
http://stackoverflow.com/questions/5261204/xquery-on-xml-file-with-namespace
Or try querying with the * wildcard like
//*:MY-ELEM
Br, Max
Quoted text · Ana Victória Ladeira · 43 lines
Am 20.02.2016 15:56 schrieb "Ana Victória Ladeira" <ladeira.ana at gmail.com>: > > > > Good afternoon! > > I currently have a dataset with some files that use the following header > (I will call it Header1): > > <?xml version="1.0" encoding="ISO-8859-1"?><CURRICULO-VITAE > SISTEMA-ORIGEM-XML="LATTES_OFFLINE" xmlns:lattes=" > http://www.cnpq.br/2001/XSL/Lattes" NUMERO-IDENTIFICADOR="X" > DATA-ATUALIZACAO="07122015" HORA-ATUALIZACAO="010008" xsi:schemaLocation=" > http://www.cnpq.br/2014/XSD/Lattes/Versao1 CurriculoLattes.xsd" xmlns=" > http://www.cnpq.br/2014/XSD/Lattes/Versao1" xmlns:xsi=" > http://www.w3.org/2001/XMLSchema-instance"> > > Other files use this other header (Header2): > > <?xml version="1.0" encoding="UTF-8"?><CURRICULO-VITAE > SISTEMA-ORIGEM-XML="LATTES_OFFLINE" DATA-ATUALIZACAO="13072015" > HORA-ATUALIZACAO="145233" NUMERO-IDENTIFICADOR="X" xmlns:lattes=" > http://www.cnpq.br/2001/XSL/Lattes"> > > Using the same query, I can extract data from files with Header2, but now > with Header1. > > I'm only using FLWOR expressions, and the queries are very simple. I've > tried with multiple queries, and the result is always the same: I'm able to > extract the information I want from files with Header2, but not from the > ones with Header1. > > I think its a problem with the namespace, but I don't know how to solve it. > > Can anyone please help me with that? > > > > > Thank you in advance, > Ana Victória Ladeira > >
Written for BaseX 8.4. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery