IRIS 2024.1发布了矢量查询和矢量索引。现在IRIS上,可以无需将自己的数据转移到别的矢量数据库上,就可以借助语言矢量化模型(例如all-MiniLM-L12-v2)和大语言内容生成模型(例如llama2),在本地构建自己的基于大语言模型和检索增强生成的解决方案了。

你是要遍历XML DOM树?可以如下使用:

ClassMethod Test()
{
    Set x="<?xml version=""1.0"" ?><root xmlns=""test"" xmlns:mc=""test1"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:schemaLocation=""test2""><!--this is a test--><id code=""test3""/></root>"

    try
    {

    $$$ThrowOnError(##class(%XML.XPATH.Document).CreateFromString(x, .doc))
    Set doc.PrefixMappings="s test"
    $$$ThrowOnError(doc.EvaluateExpression("/s:root", ".", .field))
    #dim obj As %XML.XPATH.DOMResult = field.GetAt(1)
    
    while obj.Read() 
    {
      if obj.HasValue 
      {
        write obj.Path,": ",obj.Value,!
      }
      if obj.HasAttributes
      {
          for i=1:1:obj.AttributeCount
          {
            d obj.MoveToAttributeIndex(i)
            w obj.Name,":",obj.Value,!
          }
      }
    }
    
  }catch(ex)
  {
    write "Error ", ex.DisplayString(),!
  }
}

输出:
xmlns:xml:http://www.w3.org/XML/1998/namespace
xmlns:test
xmlns:mc:test1
xmlns:xsi:http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation:test2
root\: this is a test
code:test3