Wednesday, November 8, 2017

XQuery to save source code from all tables and classes

You can use this XQuery, with for example BaseX, to save all your source code from table and classes to an XML file:
  for $t in AxClass | AxTable  
  order by $t/local-name(.), $t/Name ascending

  for $y in ($t/SourceCode/Methods/Method)

  return <Code Type='{$t/local-name(.)}' Parent="{$t/Name/text()}" MethodName="{$y/Name/text()}" Source="{$y/Source/text()}"/>