L'espace de noms de Xml Query est xmlns:xpath=http://www.w3.org/2005/xquery-local-functions".
Xml Query est une extension de Xml Path.
xquery version ChaineXml EncodingOption ;encoding ChaineXmlmodule namespace NomModule = URI ;Prologue :
module namespace NomModule = URI ;declare base-uri URI ;declare boundary-space preserve ;declare boundary-space strip ;declare construction preserve ;declare construction strip ;declare copy-namespaces ModePreservation , ModeHeritage ;declare default collation URI ;declare default element namespace URI ;declare default function namespace URI ;declare default order empty greatest ;declare default order empty least ;declare namespace NomEspaceNoms = URI ;declare ordering ordered ;declare ordering unordered ;import module PrefixeModuleOption URI at ListeDUris ;import schema PrefixeSchemaOption URI at ListeDUris ;preserveno-preserveinheritno-inheritnamespace NomEspaceDeNoms =, URInamespace NomEspaceDeNoms =default element namespacedeclare function NomFonction ( ListeDeParametresOption ) TypeSequenceOption SuiteFonction ;declare option NomOption ChaineXml ;declare variable $ NomVariable TypeVariable SuiteVariable ;$ NomParametre as TypeSequence
;
as TypeSequence{ ListeDExpressions }external:= ListeDExpressionsexternalattribute NomAttribut { ListeDExpressionsOption }comment { ListeDExpressions }document { ListeDExpressions }element NomObjet { ListeDExpressionsOption }processing-instruction NomObjet { ListeDExpressionsOption }text { ListeDExpressions }NomObjet :
{ ListeDExpressions }return Expressionsatisfies Expressiontypeswitch ( ListeDExpressions ) ListeDeCas default NomVariableOption return Expressionif ( ListeDExpressions ) then Expression else Expressionvalidate ModeValidationOption { ListeDExpressions }(# Pragma ContenuPragma #) Expressionfor ListeDAffectationslet ListeDAffectations2, Affectation$ NomDUneVariable TypeVariableOption PositionVariableOption in Expressionas TypeSequence$ NomDUneVariable, Affectation2$ NomDUneVariable TypeVariableOption := Expressionwhere Expressionorder by ListeDeTrisstable order by ListeDeTris, TriTri :
SuiteTri :
ascendingdescendingempty greatestempty leastcollation URIEquivalencesLinguistiques, Affectation3$ NomDUneVariable TypeVariableOption in ExpressioneverysomeCas :
case NomDuCasOption TypeSequence return Expression$ NomVariable as $ NomVariablelaxstrict$ NomDUneVariableordered { ListeDExpressions }unordered { ListeDExpressions }