Skip to content

Bug: Adding comments at lowest hierarchy level #460

Closed

Description

@ChristianScholtKSOL

I think I found a bug in XML-Notepad when trying to add a comment at the lowest hierarch level in a nested XML-Structure.
I get the following Error-Message from a Validator: ERROR_XML_CONFIG:: Error Message: no character data is allowed by content model.
See the following examples:

Allowed:

<catalog>
    <book id = "Book_1" author ="Writer_A" title = "title_A" ></book>
</catalog>

Also Allowed:

<catalog>
    <book id = "Book_1" author ="Writer_A" title = "title_A" ><!-- Just a comment like it is allowed to do --></book>
</catalog>

Not Allowed (and already fixed I think):

<catalog>
    <book id = "Book_1" author ="Writer_A" title = "title_A" >  </book>
</catalog>

Also Not Allowed:

<catalog>
    <book id = "Book_1" author ="Writer_A" title = "title_A" >  <!-- Just a comment like it is allowed to do -->    </book>
</catalog>

What XML Notepad does:

<catalog>
  <book id="Book_1" author="Writer_A" title="title_A">
    <!--test-->
  </book>
</catalog>

from XSD (if it is from interest)

...
<xs:element name = book>
    <xs:complexType>
        <xs:attribute type = "xs:string" name = "id">
        <xs:attribute type = "xs:string" name = "author">
        <xs:attribute type = "xs:string" name = "title">
    </xs:complexType>
</xs:element>
...

Activity

  1. added a commit that references this issue on Nov 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions