mhaack / helix-importer

Foundation tools for importing website content into that can be consumed in an Helix project.
Apache License 2.0
0 stars 3 forks source link

[JCR Importer] generated xml triggers a SAXParseException #9

Closed jckautzmann closed 5 months ago

jckautzmann commented 5 months ago

The following generated xml triggers an xml Exception when the package is installed in AEM:

keywords=\"[Automation,mRNA,Precision & Genomic Medicine,Monoclonal Antibodies]\" topics=\"Automation,mRNA,Precision & Genomic Medicine,Monoclonal Antibodies\"

Error in AEM:

Caused by: org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference.
    at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:204)

'& ' should be escaped: replacing '& ' with '& ' fixes the error.

Using following page metadata config:

  {
    "id": "page-metadata",
    "fields": [
      {
        "component": "container",
        "label": "Fieldset",
        "fields": [
          {
            "component": "text",
            "valueType": "string",
            "name": "jcr:title",
            "label": "Title"
          },
          {
            "component": "text",
            "valueType": "string",
            "name": "jcr:description",
            "label": "Description"
          },
          {
            "component": "text",
            "valueType": "string",
            "name": "cq:canonicalUrl",
            "label": "Canonical"
          },
          {
            "component": "aem-tag",
            "valueType": "string",
            "name": "cq:tags",
            "multi": true,
            "label": "AEM Tag Picker"
          },
          {
            "component": "text",
            "valueType": "string",
            "name": "keywords",
            "multi": true,
            "label": "Keywords"
          },
          {
            "component": "text",
            "valueType": "string",
            "name": "topics",
            "multi": true,
            "label": "Topics"
          },
          {
            "component": "text",
            "valueType": "string",
            "name": "authorName",
            "label": "Author Name"
          },
          {
            "component": "text",
            "valueType": "string",
            "name": "authorTitle",
            "label": "Author Title"
          },
          {
            "component": "text",
            "valueType": "string",
            "name": "brand",
            "label": "Brand"
          },
          {
            "component": "text",
            "valueType": "number",
            "name": "readingTime",
            "label": "Reading Time"
          },
          {
            "component": "date-time",
            "valueType": "date",
            "name": "publishDate",
            "label": "Publish Date",
            "placeholder": "YYYY-MM-DD",
            "displayFormat": null,
            "valueFormat": null
          },
          {
            "component": "text",
            "valueType": "string",
            "name": "navTitle",
            "label": "Navigation Title"
          }
        ]
      }
    ]
  },
bpauli commented 5 months ago

fixed in #10