Skip Navigation
Expand
  • Advanced SearchOpens new dialog
    Enter plus (+) or minus (-) signs in search terms to make a word required or excluded
    Search Tips
    Filter by product
    Filter by category
Error OKDOM-CONT0007 importing invalid HTML
Answer ID 12655   |   Last Review Date 07/07/2023

Why are we getting an error message like "Attribute contains invalid HTML: [Warning: missing </a> before <div>]."?

Environment:
 
  • Knowledge Advanced REST API v1
  • Oracle B2C Service sites with Knowledge Advanced, all versions
  • Creating/updating articles through POST or PUT /km/api/v1/content/import endpoints
Issue:
 
An implementer is trying to import content from an existing knowledge base and receives the following error details from the content import API:
 
Error code: OKDOM-CONT0007
Title: Attribute contains invalid HTML: [Warning: missing </a> before </div>].
Path: xml//CONTENT_TYPE_REFKEY[1]/NODE_REFKEY[1]
 
Resolution:
 
Any of the following:
 
  • Read the warning (in the example above, "missing </a> before </div>") and correct the invalid HTML in the source document. The XPath is given in error > errorDetails > errorPath. Retry the import.
  • Disable HTML validation for the content type. In Authoring, navigate to Repository > Content Types > List and click on the content type name. Uncheck the box, save, and retry the import. This is not recommended in production environments, or for any longer than necessary.
  • Use the create or update content endpoints instead, which do not validate HTML.
 
Notes:
 
Here is the full response from the API in the example used here. It had status code 400.
 
{
  "error": {
    "title": "An application error has occurred. Root Cause: Cannot perform operation because of invalid input.",
    "errorCode": "OK-GEN0003",
    "type": "APPLICATION"
  },
  "errorDetails": [
    {
      "title": "Attribute contains invalid HTML: [Warning: missing </a> before </div>].",
      "errorPath": "xml//FRUIT[1]/DESCRIPTION[1]",
      "errorCode": "OKDOM-CONT0007",
      "type": "VALIDATION"
    },
    {
      "title": "Cannot perform operation because of invalid input.",
      "errorCode": "OK-GEN0016",
      "type": "VALIDATION"
    }
  ]
}