Skip to content

Cannot add a namespace to html tag #84

@isitinschi

Description

@isitinschi

When I am trying to add a namespace to an html tag I have an exception "java.lang.IllegalArgumentException: Tag html has invalid attribute name xmlns"

createHTML().html {
      attributes["xmlns"] = "http://www.w3.org/1999/xhtml"
      ...
}

According to w3c it is an absolutely valid scenario.

Also it is impossible to set a namespace like this:

createHTML().html {
      namespace = "http://www.w3.org/1999/xhtml"
      ...
}

because namespace is a val and cannot be reassigned.

Exception happens in stream.kt after attribute validation (isValidXmlAttributeName() method call). As I see, any attribute which starts with "xml" prefix is considered invalid (is there a reason for this?).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions