cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! 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">.

rpaisley
12-Amethyst

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">.

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&amp;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&amp;R in the name attribute does not render it correctly as it then shows "I&amp;R". Any ideas out there?

ACCEPTED SOLUTION

Accepted Solutions

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."

View solution in original post

3 REPLIES 3

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&amp;R package</tag>

it will display to the author with an added semicolon to create an attribute but
will correctly render the &amp; 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&amp;R package">Test I&amp;R package</tag>

it will display to the author without rendering the attribute  &amp; entity.
The author will see

   <tag name="Test I&amp;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&amp;R" in the sgml file and have it show to the user as "I&R"?

rpaisley
12-Amethyst
(To:rpaisley)

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.

Announcements

Top Tags