Re: Standalone Attributes?

Subject: Re: Standalone Attributes?
From: Tony Graham <tgraham@xxxxxxxxxxxxxxxx>
Date: Tue, 6 Jun 2000 11:06:31 -0400 (EST)
At 6 Jun 2000 09:02 -0400, Carlson, Thor wrote:
 > To render the following HTML:
 >         <TD NOWRAP BGCOLOR="white">
 > I know how to set the BGCOLOR name/value with xsl:attribute.  Does anyone
 > know how to describe "NOWRAP", a standalone attribute?

There is no such thing as a standalone attribute.  HTML takes
advantage of SGML's minimization techniques, including the ability to
omit everything about an attribute but its value if the value is a
predefined token.

What you have is the minimized form of:

         <TD NOWRAP="NOWRAP" BGCOLOR="white">

When you look at the HTML 3.2 declaration for the attribute list of
<th> and <td>:

<!ATTLIST (th|td)                  -- header or data cell --
        nowrap (nowrap)  #IMPLIED  -- suppress word wrap --
        rowspan NUMBER   1         -- number of rows spanned by cell --
        colspan NUMBER   1         -- number of cols spanned by cell --
        %cell.halign;              -- horizontal alignment in cells --
        %cell.valign;              -- vertical alignment in cells --

you see that the "nowrap" attribute can have the single value
"nowrap" (or the attribute can be omitted).  SGML's rule let you get
away with providing the "nowrap" value since an SGML parser (and
certainly a hard-wired HTML parser) can infer the attribute name
associated with the value that you use.

XML, however, doesn't support any minimization of markup (because that
makes XML software more complex), so for XML, you have to provide the
attribute name and its value.  Since the HTML form of the output of
your XSLT is just a quirk of how you write out the result of your
transformation, you need to provide both the name and value in the
result tree.

The short answer, therefore, is to set the NOWRAP name/value the same
way that you set the BGCOLOR name/value, remembering that you only
have one option for the value of NOWRAP if its present.


Tony Graham
Tony Graham                            mailto:tgraham@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.      
17 West Jefferson Street                    Direct Phone: 301/315-9632
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
  Mulberry Technologies: A Consultancy Specializing in SGML and XML

 XSL-List info and archive:

Current Thread