Agregar base de datos BaseX en Java

I am quite new to developing using the BaseX api, and I keep running into some trouble with one of the methods. I have a database created and opened, but when I try to use the Add method it throws an exception. See consulta en esta página for an example from BaseX.

I have created the Database in another section of the code, and the file I am trying to add also exists on my computer. My snippet of code looks like this:

//Opens the database
new Open(databaseName).execute(context);

//adds file to database
new Add("", directoryPath + indexName + "/" + catalog.getInternalID() + ".Catalog.xml").execute(context);

El error que recibo es este:

org.basex.core.BaseXException: "~/cdsp.Catalog.xml" (Line 1): whitespace expected, attribute name found.

I do not really know what this means, when I try to add other xml files to the database they work and I have not found much googleing this exception. Any help would be much appreciated. Thanks!

preguntado el 09 de marzo de 12 a las 16:03

1 Respuestas

I am not sure if you are still running in this problem. Anyway it looks like your XML file contains an attribute where white space is expected. You could try opening cdsp.Catalog.xml in an editor of your choice and see what is there at line 1.

Hope this helps, Michael

respondido 31 mar '12, 09:03

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.