I just downloaded MarkLogic Server 4.2 and have created a database and loaded 
some data.  I'm brand new to this, so I have a basic question on how to specify 
a document to query.

I followed this tutorial for setting up a new database with the Shakespeare 
data.  But I'll go through a simple scenario of creating everything from 
scratch.
        1. Create a new database called "people"
        2. Create a new forest called "people", no data directory specified
        3. Create a new HTTP App Server called "people", specify a root folder, 
port 
8012, selected database "people"
        4. Copy the cq folder from the samples folder
        5. Copy an xml file to the http server root called people.xml.  Here is 
the 
contents:
        6. <people>
<person name="bob" />
<person name="jim" />
<person name="bob" />
<person name="ryan" />
</people>
        7. I load the data using the load tab of the people database screen.
        8. In CQ->explore, I see:  /C/software/MarkLogic 
Server/db/people/people.xml – element people (properties)  (no collections)
        9. Now I can query this data:
xquery version "1.0-ml";
for $person in doc()/people/person 
return (
<div>
$person/@name
<a href="delete.xqy?path={ xdmp:path($person) }">delete</a>
</div>
)
 
There are some problems with this query that some research will help me to 
figure out--the results look like this:
 
$person/@name delete
$person/@name delete
$person/@name delete
$person/@name delete
 
--but I'm getting the right number of results.  My question is, how to I target 
a document by name?
 
If I change the doc() call above to read doc( "people.xml" ), I get an emtpy 
return set in response.  I need this to work because I have several xml files 
loaded into the database I'm trying to work with, and I want to be specific.
 
Thanks for helping out!
 
Scott  
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to