Skip to content

XML tag ending in a colon #182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ashawley opened this issue Jan 23, 2018 · 1 comment
Closed

XML tag ending in a colon #182

ashawley opened this issue Jan 23, 2018 · 1 comment

Comments

@ashawley
Copy link
Member

@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:/>
@ashawley
Copy link
Member Author

Like #94, there's no big need to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant