Created
January 6, 2015 19:44
-
-
Save ableasdale/1246d3bb4917ace851d5 to your computer and use it in GitHub Desktop.
Parse a MarkLogic support dump and XPath to a specific node
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
(: | |
: Example for locally loading a MarkLogic support dump as a sequence | |
: of document-node() elements for reporting and analysis | |
:) | |
declare variable $path as xs:string := 'C:\Users\ableasdale\Desktop\dump.txt'; | |
declare variable $support as document-node()* := xdmp:document-get ( | |
$path, | |
<options xmlns="xdmp:document-get"> | |
<format>xml</format> | |
<repair>full</repair> | |
</options> | |
); | |
(: Get the Support Dump as a document-node()* :) | |
<databases xmlns="http://marklogic.com/xdmp/database"> | |
{$support//*:databases/*:database[*:database-name eq "Meters"]} | |
</databases> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment