Changes

Jump to navigation Jump to search
261 bytes added ,  18:59, 13 October 2011
no edit summary
==Create Databases==In BaseX, a single database contains an arbitrary number of '''resources'''. By default, resources are '''XML documents'''. Since {{Version|7.0}},'''raw files''' (binaries) can be stored as well.
In BaseX, a single database contains one or more XML documents and raw (binary) files.New databases can either be created within the GUI or in the console version of BaseX: * [[Startup#BaseX GUI|GUI]]: Go to ''==Create Database'' → ''New'', press ''Browse'' to choose a file or directory, and press ''OK''* [[Startup#BaseX Standalone|Console]]: enter <code>basex -c "CREATE DB dbname /path/to/resources"</code><br/>==
New databases can either be created in the GUI or on the command line. Optionally, initial database XML input can be specified: * [[Startup#BaseX GUI|GUI]]: Go to ''Database'' → ''New'', press ''Browse'' to choose an initial file or directory, and press ''OK''* [[Startup#BaseX Standalone|Console]]: enter <code>basex -c "CREATE DB dbname /path/to/resources"</code>.<br/> Various [[Parsers]] are available to convert different formats to XML,  ==Manage CollectionsResources==
Once you have created a database, additional commands exist to modify its contents:
Last but not least, XML documents can also be added via the GUI and the ''Database'' menu.
==Access DocumentsResources==
Various XQuery functions exist to access the XML documents in databases and other locations:
* <code>db:open("dbname", "/path/to/docs")</code>: returns documents that are found in the specified database.* <code>collection("path/to/docs")</code>: returns the documents that are either found in the database specified database in the argument, or file paththe specified location.
* <code>doc("path/to/document.xml")</code>: returns a single document found at the specified location. If a database exists for the specified file, it is opened instead.
[[Category:Beginner]]
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu