[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[[["\u003cp\u003eAPI proxy deployment fails if the XML to JSON policy lacks either the \u003ccode\u003e<Options>\u003c/code\u003e or \u003ccode\u003e<Format>\u003c/code\u003e element, as one of them is required.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003e<Format>\u003c/code\u003e element in the XML to JSON policy must contain one of the predefined formats: \u003ccode\u003exml.com\u003c/code\u003e, \u003ccode\u003eyahoo\u003c/code\u003e, \u003ccode\u003egoogle\u003c/code\u003e, or \u003ccode\u003ebadgerFish\u003c/code\u003e, or else the proxy deployment will fail.\u003c/p\u003e\n"],["\u003cp\u003eUsing both the \u003ccode\u003e<Format>\u003c/code\u003e and \u003ccode\u003e<Options>\u003c/code\u003e elements within the same XML to JSON policy is not allowed and will result in deployment failure.\u003c/p\u003e\n"],["\u003cp\u003eIf an unknown format is defined within the \u003ccode\u003e<Format>\u003c/code\u003e element of the XML to JSON policy, it will result in a proxy deployment failure with an "Unknown Format" error message.\u003c/p\u003e\n"],["\u003cp\u003eThe error message will contain the name of the policy as well as the format that caused the error.\u003c/p\u003e\n"]]],[],null,["# XML to JSON policy deployment error troubleshooting\n\n*You're viewing **Apigee** and **Apigee hybrid** documentation.\nView [Apigee Edge](https://docs.apigee.com/api-platform/troubleshoot/policies/deployment/xmltojson-deployment-errors) documentation.*\n| Was this troubleshooting playbook helpful? Please let us know by clicking [Send Feedback]().\n\nEitherOptionOrFormat\n--------------------\n\n### Error message\n\nDeployment of the API proxy through either the Apigee UI or API fails with this error message: \n\n```transact-sql\nError Saving Revision [revision_number]\nXMLToJSON[{0}]: Either Options or Format must be specified.\n```\n\n### Example error\n\n Error Saving Revision 1\n XMLToJSON[{0}]: Either Options or Format must be specified.\n\n### Example screenshot\n\n### Cause\n\nIf one of the elements `\u003cOptions\u003e` or `\u003cFormat\u003e` is not declared in the XML to JSON Policy, then the deployment of the API proxy fails.\n\n`\u003cOptions\u003e` is required if `\u003cFormat\u003e` isn't used.\n\nUse either the `\u003cFormat\u003e` element or `\u003cOptions\u003e` element group. You cannot use both `\u003cFormat\u003e` and `\u003cOptions\u003e`. Predefined formats include: `xml.com`, `yahoo`, `google`, and `badgerFish`.\n\n### Diagnosis\n\n1. Examine all the XML to JSON policies in the specific API proxy where the failure has occurred. If there is any XML to JSON policy in which either of the elements `\u003cOptions\u003e` or `\u003cFormat\u003e` is not declared, then that's the cause of the error.\n\n For example, the following policy does not have either of the elements declared: \n\n \u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?\u003e\n \u003cXMLToJSON async=\"false\" continueOnError=\"false\" enabled=\"true\" name=\"XMLToJSON\"\u003e\n \u003cDisplayName\u003eXMLToJSON\u003c/DisplayName\u003e\n \u003cProperties/\u003e\n \u003cOutputVariable\u003eresponse\u003c/OutputVariable\u003e\n \u003cSource\u003eresponse\u003c/Source\u003e\n \u003c/XMLToJSON\u003e\n\n### Resolution\n\nEnsure that the XML of the XML to JSON policy has one of the elements `\u003cOptions\u003e` or `\u003cFormat\u003e` declared in the policy.\n\nExample 1: \n\n \u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?\u003e\n \u003cXMLToJSON async=\"false\" continueOnError=\"false\" enabled=\"true\" name=\"XMLToJSON\"\u003e\n \u003cDisplayName\u003eXMLToJSON\u003c/DisplayName\u003e\n \u003cProperties/\u003e\n \u003cFormat\u003egoogle\u003c/Format\u003e\n \u003cOutputVariable\u003eresponse\u003c/OutputVariable\u003e\n \u003cSource\u003eresponse\u003c/Source\u003e\n \u003c/XMLToJSON\u003e\n\nExample 2: \n\n \u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?\u003e\n \u003cXMLToJSON async=\"false\" continueOnError=\"false\" enabled=\"true\" name=\"XMLToJSON\"\u003e\n \u003cDisplayName\u003eXMLToJSON\u003c/DisplayName\u003e\n \u003cProperties/\u003e\n \u003cOptions\u003e\n \u003cRecognizeNumber\u003etrue\u003c/RecognizeNumber\u003e\n \u003cRecognizeBoolean\u003etrue\u003c/RecognizeBoolean\u003e\n \u003cRecognizeNull\u003etrue\u003c/RecognizeNull\u003e\n \u003c/Options\u003e\n \u003cOutputVariable\u003eresponse\u003c/OutputVariable\u003e\n \u003cSource\u003eresponse\u003c/Source\u003e\n \u003c/XMLToJSON\u003e\n\nUnknownFormat\n-------------\n\n### Error message\n\nDeployment of the API proxy through either the Apigee UI or API fails with this error message: \n\n```transact-sql\nError Saving Revision [revision_number]\nXMLToJSON[policy_name]: Unknown Format [unknown_format].\n```\n\n### Example error\n\n Error Saving Revision 1\n XMLToJSON[WithFormat]: Unknown Format google.com.\n\n### Example screenshot\n\n### Cause\n\nIf the `\u003cFormat\u003e` element within the XML to JSON policy has an unknown format defined, then the deployment of the API proxy fails.\n\nPredefined formats include: `xml.com`, `yahoo`, `google`, and `badgerFish`.\n\n### Diagnosis\n\n1. Identify the XML to JSON policy where the error occurred and the unknown format. You can find this information from the error message. For example, in the following error, the policy name is `WithFormat` and the unknown format is `google.com`:\n\n Error Saving Revision 1\n XMLToJSON[WithFormat]: Unknown Format google.com.\n\n2. Verify that the unknown format specified in the failed XML to JSON policy matches with the value identified in the error message (step #1 above). For example, the following policy specifies the format as `google.com`, which matches what's in the error message:\n\n \u003cXMLToJSON async=\"false\" continueOnError=\"false\" enabled=\"true\" name=\"WithFormat\"\u003e\n \u003cDisplayName\u003eWithFormat\u003c/DisplayName\u003e\n \u003cProperties/\u003e\n \u003cFormat\u003egoogle.com\u003c/Format\u003e\n \u003cOutputVariable\u003eresponse\u003c/OutputVariable\u003e\n \u003cSource\u003eresponse\u003c/Source\u003e\n \u003c/XMLToJSON\u003e\n\n3. If the Format specified is not one among the predefined formats `xml.com`, `yahoo`, `google`, or `badgerFish`, then that's the cause of the error.\n\n In the example XML to JSON Policy shown above, the format is `google.com` which is invalid. Therefore, the deployment of the API Proxy fails with the error: \n\n XMLToJSON[WithFormat]: Unknown Format google.com.\n\n### Resolution\n\nEnsure that the format specified in the `\u003cFormat\u003e` element of the XML to JSON policy\nis valid. For example: \n\n \u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?\u003e\n \u003cXMLToJSON async=\"false\" continueOnError=\"false\" enabled=\"true\" name=\"WithFormat\"\u003e\n \u003cDisplayName\u003eWithFormat\u003c/DisplayName\u003e\n \u003cProperties/\u003e\n \u003cFormat\u003egoogle\u003c/Format\u003e\n \u003cOutputVariable\u003eresponse\u003c/OutputVariable\u003e\n \u003cSource\u003eresponse\u003c/Source\u003e\n \u003c/XMLToJSON\u003e"]]