For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/api/genui/lynx-xml/functions/normalizeLynxXmlArtifact.md.
Lynx
  • 简体中文
  • 函数: normalizeLynxXmlArtifact()

    normalizeLynxXmlArtifact(value: string): string

    提取并规范化 Lynx XML 产物,校验其文档级约定。

    要求 Lynx 根元素带有引擎版本且已闭合,恰好包含一个闭合的主线程脚本, 并且不含 CDATA 区块。此函数不会执行代码,也不会校验 JavaScript、CSS、 Element PAPI 语义或渲染结果。校验最终产物前,请先编译 Template 或 ScriptReuse 中间文档。

    参数

    参数类型
    valuestring

    返回

    string

    抛出

    文档不符合文档级约定时抛出 Error。

    示例

    const source = normalizeLynxXmlArtifact(modelResponse);
    // Pass the normalized source to the renderer.
    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。