I think you might get more detailed answers... but two parts:
1) in order to hit the Schemas database, or any database that is not the
main db of your app, you should do an xdmp:eval() or xdmp:invoke(), of
which one of the options is which database to target the query to.
2) if you have no idea about your schema uris, only doc file names, I
think you could use
cts:uri-match("*/foo. <http://*.html> xsd")
...IF you have the uri lexicon turned on in the schemas db config.
~Shane
________________________________
From: [email protected]
[mailto:[email protected]] On Behalf Of cOre
dUmPeR
Sent: Thursday, May 13, 2010 4: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