On Tue, 04 Feb 2014 04:55:24 -0800, Whitby, Rob <[email protected]>  
wrote:

> Hi,
>
> I can’t seem to figure out how to use a schema without loading it into  
> the schemas db. Is something like this possible?
>
> let $xml := <foo>…
> let $schema := <xs:schema>…
> let $validate := ???
>
> Thanks
> Rob
>
>

There's a hacky way to do this via XSLT, which does support
embedded schema files.
Something like

let $xml = <foo>...
return
xdmp:xslt-eval(
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";  
version="2.0"
         xmlns:xs="http://www.w3.org/2001/XMLSchema";
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
         xmlns:my="http://exaple.com/xsd1/";
         exclude-result-prefixes="xsi">

<xsl:import-schema namespace="http://example.com/xsd1/";>
   <xs:schema targetNamespace="http://example.com/xsd1/";>
     <!-- your schema stuff here -->
   </xs:schema>
</xsl:import-schema>

<xsl:template match="/">
   <xsl:copy-of select="." validation="strict"/>
</xsl:template>

</xsl:stylesheet>, document {$xml} )

//Mary
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to