ids generated by plantuml are not xml compliant

0 votes
asked Aug 12, 2020 in Bug by baerrach2 (220 points)

https://forum.plantuml.net/9972/component-diagrams-please-direction-token-corresponding?show=9972#q9972 say that in 2019 the beta version changed the id to "a->b"

But < and> are not allowed as characters in id.

https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/id says they should be XML 1.0 compliant.

https://www.w3.org/TR/REC-xml/#id says they must match the Name production

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

The ASCII symbols and punctuation marks, along with a fairly large group of Unicode symbol characters, are excluded from names because they are more useful as delimiters in contexts where XML names are used outside XML documents; providing this group gives those contexts hard guarantees about what cannot be part of an XML name.

[4]   NameStartChar   ::=   ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
[4a]   NameChar   ::=   NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
[5]   Name   ::=   NameStartChar (NameChar)*

So this isn't a problem with display in a web browser, since they are so lenient.

But its an issue when I try to import the generated document in Inkscape, the lines are ignored.

My work around is to post process the file and replace "->" with "-to-".

1 Answer

0 votes
answered Aug 18, 2020 by plantuml (295,000 points)
Thanks for the feedback.

This is fixed in last beta http://beta.plantuml.net/plantuml.jar

Tell us if it's not working for you !
commented Aug 19, 2020 by baerrach2 (220 points)
Yes this changes it to "A-B" which is fine by me.

How do I find out what's in the beta?
...