Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
I have a customer that wishes to use the character "&" in an attribute of an SGML tag, such as <tag name="Test I&R package">.
That is how they would like to see it during edit but when the file is opened the string gets a semicolon added after the R so it displays as "I&R;" - as if it is being change to an &R; entity. I cannot get the Arbortext editor to stop changing the display to show the semicolon after the R.
I can control display of CDATA content correctly so I&R displays correctly rendered as "I&R" but cannot get the attribute text to behave similarly to show I&R as without the appended semicolon. Also, using I&R in the name attribute does not render it correctly as it then shows "I&R". Any ideas out there?
Solved! Go to Solution.
FWIW: Eve Maler's book Developing SGML DTDs (page 357) has this to say about the content of CDATA attributes:
"If string contains any character not allowed in NAME, surround with quotes. String cannot contain element markup, but can contain entity references if it is quoted."
FWIW: Eve Maler's book Developing SGML DTDs (page 357) has this to say about the content of CDATA attributes:
"If string contains any character not allowed in NAME, surround with quotes. String cannot contain element markup, but can contain entity references if it is quoted."
The issue I am having is the view the author sees while editing SGML.
If I read your response correctly, the attribute text with & cannot be displayed
to the author within AE without seeing entity coding.
Example:
If the string, as stored in the sgml file, is
<tag name="Test I&R package">Test I&R package</tag>
it will display to the author with an added semicolon to create an attribute but
will correctly render the & entity in the data to show only the "&" character.
The author will see (note new semicolon in attribute)
<tag name="Test I&R; package">Test I&R package</tag>
If the string, as stored in the sgml file, uses an entity code in the attribute
<tag name="Test I&R package">Test I&R package</tag>
it will display to the author without rendering the attribute & entity.
The author will see
<tag name="Test I&R package">Test I&R package</tag>
Is there any setting that will allow the user to use "I&R" in an attribute
that does not try to "fix" the "&" (as if it was an entity code) or allow
"I&R" in the sgml file and have it show to the user as "I&R"?
As it turns out the string "I&R" cannot be used in the name attribute without it being "fixed".
I have directed my user to enter "I & R" (spaces) in this case. Thanks Susan.