MarkLogic 9 Product Documentation
pkg:valid

pkg:valid(
   $pkgname as xs:string
) as xs:boolean

Summary

[DEPRECATED: use cma:generate-config and cma:apply-config instead.]

Test a package for consistency. Returns true if the package is valid and false if the package is not valid.

Parameters
pkgname The name of the package to check for validity.

Usage Notes

This function returns true if the package is valid and false otherwise. Use pkg:errors to view a list of errors for an invalid package.

A package may be invalid for many reasons, including a violation of the package schema (Config/package.xsd), fields with erroneous values, or duplicate settings.

Example

xquery version "1.0-ml";
import module namespace pkg = "http://marklogic.com/manage/package" 
    at "/MarkLogic/manage/package/package.xqy";

pkg:valid("mypackage)
  
  => Returns 'true' if "mypackage" is valid.  Otherwise returns 'false.' 
  
Powered by MarkLogic Server | Terms of Use | Privacy Policy