Hi Marv,
You can do an eval into the schema database by specifying the ID of the schema
database.
Something like:
xquery version "1.0-ml";
xdmp:eval('xdmp:save("c:/tmp/foo.xsd", doc("foo.xsd"))',
(), <options xmlns="xdmp:eval">
<database>{xdmp:schema-database()}</database>
</options>)
-Danny
From: [email protected]
[mailto:[email protected]] On Behalf Of cOre dUmPeR
Sent: Thursday, May 13, 2010 1:04 PM
To: [email protected]
Subject: [MarkLogic Dev General] How to query files from the schema database?
Question:
________________________________
How do you write a ML-XQuery program *searches* the the Schema database for a
schema of a particular name, lets say "foo.xsd", and writes it to disk?
I know if there was a doc named "foo.xml" in the document database, I could
just do:
doc("foo.xml")
but the file i'm interested in is in the schema database. Also, I only know the
base name of the file "foo.xsd"...and I dont know the path in the schema
database...for example, the schema file could be in /path/to/foo.xsd or if
could be in /foobar/foo.xsd. So I have to be able to *find* the schema file
first.
I have gone over the ML4.1 docs...and have had little luck finding out how to
do this.
I realize in CQ I can just change the "content-source"...but my little app will
of course exist outside of CQ.
Context:
________________________________
I have an install of MLS 4.1 at work. It is already populated with plenty of
XML docs and Schema files.
I am a MLS n00b...but have a good amount of experience with XML and programming
in General.
thanks in advance,
/marv
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general