Skip to content

XML tag ending in a colon #182

@ashawley

Description

@ashawley

@hosamaly noted in #94 that tags ending in colon aren't understood by the Scala compiler.

scala> <x:></x:>
<x:></x:>
<console>:1: error: in XML literal: name cannot end in ':'
       <x:></x:>
          ^
<console>:1: error: in XML literal: '>' expected instead of '<'
       <x:></x:>
scala> <x:/>                    
<x:/>
<console>:1: error: in XML literal: name cannot end in ':'
       <x:/>

From my reading of the XML standard, it seems like colon should be allowed as an ending character.

https://www.w3.org/TR/2008/REC-xml-20081126/#NT-Name

Unlike #94, the parser in Java has no problem accepting them.

scala> scala.xml.XML.loadString("<x:/>")
scala.xml.XML.loadString("<x:/>")
res0: scala.xml.Elem = <x:/>

scala> scala.xml.XML.loadString("<x:></x:>")
scala.xml.XML.loadString("<x:></x:>")
res2: scala.xml.Elem = <x:/>

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