开发者控制台
感谢您的访问。此页面目前仅提供英语版本。我们正在开发中文版本。谢谢您的理解。

Step 2: Validate the Catalog File

After you create your catalog file, you must ensure that it is well formed XML and validates against the CDF schema. An incorrectly formatted or invalid catalog file will be rejected by the catalog ingestion service. Validating your file locally can help catch errors that would prevent the file from being successfully ingested.

Tools to Validate Your Catalog File

You can validate your catalog against the CDF schema in a number of different ways. For example, on Mac or Linux systems, you can use xmllint to validate your file (xmllint is pre-installed on Mac and Linux). On Windows, a number of free XML validation tools are available for download.

If you created or edited your catalog file using an Integrated Development Environment (IDE), such as Eclipse or Intellij, your IDE might have a built-in XML validation tool to validate your catalog against the schema. For more information, see:

The Scope of What Validation Tools Can Check

XML validation tools can only check that your XML is well-formed (for example, no broken or missing tags) and valid against the CDF schema (for example, no incorrectly nested elements). While XML validation should catch the most common errors in your catalog file, your catalog file could still contain errors that are not caught until the file is uploaded to AWS.

Use xmllint to Validate Your Catalog File

To use xmllint to validate your catalog file:

  1. Download the CDF XSD file and copy or move this file to the same directory as your catalog file (which you created in Step 1: Create Your Catalog File).
  2. Open a terminal window (or a command window in Windows) to access your computer's command line interface. Browse to the same directory that contains the catalog.xsd schema and your catalog file.
  3. At the shell prompt, type the following command:

    xmllint --schema catalog.xsd --noout <cdf_file_name>.xml
    

    Replace <cdf_file_name> with the actual name of your catalog file. The --noout option suppresses extra output as xmllint traverses your XML file. When finished, xmllint will report any errors that it found in your file or will report that your XML file is valid against the specified schema.

Validation FAQ

Q: How do I validate my XML? Do you provide any utility that I can use to check my file before uploading?
A: Amazon does not provide a utility for validating catalog files; however, many of these utilities are easily available. If you are on a Mac or Linux, use xmllint to validate your catalog file. This utility should be pre-installed with your OS. (If you are on a Windows machine, you can use the Google project version of xmllint.) See Use xmllint to Validate Your Catalog File for more details.

Next Steps

After you create your catalog file, move on to Step 3: Set Up Your AWS Account.