{"success":true,"data":{"ext":"xhtml","name":"XHTML","description":"XHTML, or Extensible HyperText Markup Language, is an XML-based reformulation of HTML developed and maintained by the World Wide Web Consortium (W3C). It is used for web pages and documents that require strict markup rules, and it is supported by browsers, publishing systems, and content management tools. XHTML is generally safe, though it may inherit scripting and linking risks from embedded web content; its use has declined in favor of HTML5.","mime":["application/xhtml+xml"],"risk_level":"Safe","signatures":[{"hex":"3C 68 74 6D 6C 20 78 6D 6C 6E 73 3D","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]}],"related":["xht","xml","xsl","cfg","htm","html"],"usage":{"python":"def is_xhtml(file_path: str) -> bool:\n    \"\"\"Check if file is a valid XHTML by magic bytes.\"\"\"\n    signature = bytes([0x3C, 0x68, 0x74, 0x6D, 0x6C, 0x20, 0x78, 0x6D, 0x6C, 0x6E, 0x73, 0x3D])\n    with open(file_path, \"rb\") as f:\n        return f.read(12) == signature","node":"function isXHTML(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x3C, 0x68, 0x74, 0x6D, 0x6C, 0x20, 0x78, 0x6D, 0x6C, 0x6E, 0x73, 0x3D]);\n  return buffer.subarray(0, 12).equals(signature);\n}","go":"func IsXHTML(data []byte) bool {\n    signature := []byte{0x3C, 0x68, 0x74, 0x6D, 0x6C, 0x20, 0x78, 0x6D, 0x6C, 0x6E, 0x73, 0x3D}\n    if len(data) < 12 {\n        return false\n    }\n    return bytes.Equal(data[:12], signature)\n}"},"category":"Web & Config"}}