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

    normalizeLynxXmlArtifact(value: string): string

    Extract, normalize, and validate the document-level contract of a Lynx XML artifact.

    Requires a closing Lynx root with an engine version, exactly one closed main-thread script, and no CDATA sections. Does not execute code or validate JavaScript, CSS, Element PAPI semantics, or rendering. Compile intermediate Template or ScriptReuse documents before validating the final artifact.

    Parameters

    ParameterType
    valuestring

    Returns

    string

    Throws

    Error when the document-level contract is invalid.

    Example

    const source = normalizeLynxXmlArtifact(modelResponse);
    // Pass the normalized source to the renderer.
    Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.