# XML常规规则

### 通用规则 <a href="#general-rule" id="general-rule"></a>

以下是通过XML文件成功上传认证数据的通用规则：

<table data-header-hidden><thead><tr><th width="222"></th><th></th></tr></thead><tbody><tr><td><strong>文件格式</strong></td><td>文件格式必须为<code>.xml</code></td></tr><tr><td><strong>文件大小</strong></td><td>XML文件的最大文件大小为50MB。 如果您的XML文件大于50MB，则需要将其拆分并上传多个小于50MB的文件。</td></tr><tr><td><strong>文件名</strong></td><td>IAF CertSearch建议您使用以下格式命名文件：单个文件：<code>cb_certs.xml</code>多个文件：<code>cb_certs_1.xml</code>，<code>cb_certs_2.xml</code>，<code>cb_certs_3.xml</code></td></tr><tr><td><strong>XML标签</strong></td><td>XML标签必须与模板中的标签相同。 如果更改，IAF CertSearcg将无法识别字段数据，并且将不会被上传。</td></tr><tr><td><strong>XML标签顺序</strong></td><td>标签应按顺序排列，并且必须与模板中的标签相同。 如果更改，IAF CertSearch将无法识别制表符，并且将不会上传其中的数据。</td></tr></tbody></table>

## 了解XML文件格式

### 重要说明

1. **XML文档必须包含一个根元素，该元素是所有其他元素的父元素：**\
   对于证书上传，根元素是`<client_certs></client_certs>`\\
2. 这一行称为**XML prolog**：`<?xml version="1.0" encoding="UTF-8?">`\
   XML prolog是可选的。 如果存在，则必须首先出现在文档中。 XML文档可以包含国际字符，如挪威语的øæå或法语的êèé。 为了避免错误，您应该指定使用的编码，或将XML文件保存为UTF-8。 UTF-8是XML文档的默认字符编码。\\
3. **所有XML元素都必须有一个闭合标签**\
   XML标签对大小写敏感。 标签与标签不同。 开始和结束标签必须使用相同的大小写编写：\
   \
   任何未闭合的标签都将导致错误：**上传的XML文件无效**\ <mark style="color:red;">**错误：**</mark> <mark style="color:red;">\<certification\_body\_identity\_number>%VALUE GOES HERE</mark><mark style="color:red;">`</mark>\ \ <mark style="color:green;">**正确：**</mark> <mark style="color:green;"><certification_body_identity_number>%VALUE GOES HERE</certification_body_identity_number>`</mark>\
   \\
4. **XML元素必须正确嵌套**

   在XML中，所有元素都必须正确嵌套在彼此之内：\
   \ <mark style="color:red;">**错误：**</mark>\ <mark style="color:red;">\<certification\_identity\_number></mark>\ <mark style="color:red;">CERT-0001\</certification\_identity\_number></mark>\
   \
   \ <mark style="color:green;">**正确：**</mark>\
   \ <mark style="color:green;">\<certification\_identity\_number>CERT-0001\</certification\_identity\_number></mark>\
   \\
5. **标签不能包含空格**\
   **例如**\
   系统将不识别此语法并抛出错误：**上传的XML文件无效**\\
6. **上传XML文件时，应包含所有父标签**，如果缺少父标签，系统将抛出错误：**上传的XML文件无效**\\
7. **如果certification\_standard\_and\_scheme及其子级为空**，系统将抛出错误：**上传的XML文件无效**\\
8. **可选字段的无效标签不会触发错误**，但添加到标签中的数据将不会在系统中显示\
   \ <mark style="color:green;">**正确：**</mark><mark style="color:green;">\<original\_issue\_date>01/20/2021\</original\_issue\_date></mark>\ <mark style="color:red;">**错误（来自文件）：**</mark> <mark style="color:red;">\<orig\_issued\_date>01/20/2021\</orig\_issued\_date></mark>\
   \
   **系统中显示的数据**\
   原始发行日期：*(空白)*

### 在XML中格式化数据时的注意事项

将数据填充到XML文件中时请记住以下事项。

### <mark style="color:green;">**注意事项**</mark>

1. **每个标签只能输入单个数据值**

   确保每个标签中只输入单个数据值。 当上传多个数据值时，请不要在一个标签中包含多个数据值。
2. **保持数据格式一致**

   空格、大小写和其他类型的格式不匹配将导致错误，数据将无法匹配
3. **将语法保持与模板提供的类似**

### <mark style="color:red;">**注意事项**</mark>

1. **不要将强制字段留空或空白**
2. **不要向一个标签中添加多个数据**
3. **不要将多个数据合并到一个标签中**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.iafcertsearch.org/accreditation-bodies/ab-zh/data-management/import-certification/certification-file-templates/xml-general-rules.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
