Quote:
Originally Posted by Hitch
I guess my next question, Dale, would be, why does this occur? Wolf asserts that it's happening with "perfectly legal styles," but this doesn't happen to us with the usual p tags with italic or bold tags wrapped around text contained within the p element (taking this as the simplest exemplar). So: what causes the SGC styles to show up as an internal stylesheet in your or Wolf's xhtml file, while it doesn't in ours? (This isn't disparagement--I'm trying to understand what actually causes it to occur). Is it the lack of an external stylesheet, or...?
Hitch
|
Here are the styles Tidy put in one of the XML files.
Code:
/*<![CDATA[*/
div.sgc-2 {font-style: italic; font-weight: bold}
div.sgc-1 {font-weight: bold}
/*]]>*/
</style>
Here is the original code.
Code:
<div class="ct"><b>CHAPTER ONE</b></div>
<div class="cst"><b><i>June 22, 1911</i></b></div>
Here is the code after Tidy changed things.
Code:
<body>
<div class="ct sgc-1">
CHAPTER ONE
</div>
<div class="cst sgc-2">
June 22, 1911
</div>
The first code to style change gets to be SGC-1, the second gets to be SGC-2 and so on. It just goes in order creating the styles. That is why the SGC styles are not always the same. It depends on the top down order of the code Tidy is changing to styles. Tidy is changing paragraph level code that is not in a style. It's not allowing the free form code to exist in the XML file. It wants all the free form codes to be styles. But the free form styles are legitimate.
I have found a bug in Tidy's styling. I went into the CSS and changed the styles .ct to include bold and .cst to include both bold and italic. Tidy still created styles instead of seeing that the styles it created are not actually needed ad just deleting the bold and italic codes for .ct and .cst.