Tuesday, July 05, 2005

Is this OK, or am I a XHTML-Terrorist

Working on converting a large content managment driven site to Valid XHTML and is trying to keep all Editorial functions as they are.

I'm parsing text from a textarea. I start by defining a paragraph and parse two or more newlines to end it and create a new paragraph. The Editors are allowed to put a picture with caption, a quote block, a fact box etc. wherever they want in the body text (and have been doing so in tens of thousands of articles that I have to keep).

Nesting a <div> inside a <p> ... </p> is not valid and I cant't force the image, qoute, factbox... to be placed outside the paragraph. The only easy solution I want to use is to put the elemts inside a inline-element such as a span, making it valid, but redefine the span to display: block;

<style type="text/css">
.float {
display: block;
float: right;
}
</style>

<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing
elit. Etiam vitae sapien. Quisque dictum. Nunc orci
<span class="float"><img src="lorem.jpg" width="100" height="150" border="0" alt="alttext" />
<br />Caption
</span>
lacus, rutrum eu, elementum quis, rhoncus iaculis, risus.
Pellentesque habitant morbi tristique senectus et netus
et malesuada fames ac turpis egestas.
</p>


Is fooling the validator like this OK? Or am I terrorising the quest for a valid marked-up internet! I think it's for a good cause. The Image in this example is inline, inside a pargraph where it actually belongs if that's where the Editor put it. The blockifying done with CSS is just for layout purposes!

4 Comments:

Blogger SnoboJohan said...

Comments on identical post on Tek-Tips:

Vragabond (Programmer)
5 Jul 05 10:31
It is basically defying the purpose but I do understand what you mean. I have used similar technique before and think that there is nothing really wrong with it. As long as it looks ok in the browsers. :)

tsdragon (Programmer)
5 Jul 05 12:33
They must have had something like that in mind when they decided to create the display:inline / display:block differentiation in the first place. They could have simply allowed you to display an element or not, much like visibility, and not given you the ability to change the display style from inline to block. The fact that they DID give you that ability says, to me, that's it is OK to use it.

Tracy Dryden
Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.

9:56 AM  
Blogger micheljones5314 said...

Hot Stock For Your Review!!



+++++++++++Current Profile+++++++++++

Faceprint Global Solutions (FCPG)

Current Price $0.15

A company with hot new identity solution products

and licenses with over 40 current governmental and

non-governmental contracts in negotiations.

+++++++++++++++++++++++++++++++++



FCPG is now offering the world's leading encryption software to IBM's North American clients.



Will It Still Go Higher?

Does It Sound New and Exciting To You?

Please Review Exactly What this Company Does.



BREAKING NEWS!!



Faceprint Global Solutions (FCPG) is pleased to announce that its European partner, Keyvelop, has teamed up with IBM's Partner World Industry Networks to deliver customer software requirement solutions for the international healthcare industry.

With FCPG owning the exclusive North American rights to distribute the worlds leading encryption and transmission software developed by Keyvelop, FCPG is poised to capture large volumes of sales generated by customers currently using IBM's software in the healthcare and other industries.

With traceability and security now deemed a serious business priority, companies are increasingly focused on employing procedures and controls designed to ensure the authenticity, integrity and confidentiality of electronic records.

\"This is a very positive move for FCPG and for Keyvelop,\" said FCPG CEO Pierre Cote. \"We are very happy about the decision to go with IBM. This is a continuation of the progress made by everyone associated with FCPG and its partners.\"

Buell Duncan, IBM's general manager of ISV & Developer Relations commented, \"Collaborating with Keyvelop will ensure that we develop open solutions that are easy to maintain and cost effective for our customers in the healthcare and life sciences industry.\"

Among other things, this new software technology which is currently being used by a number of European healthcare companies, is used to send any file, regardless of format or size. Encryption keys, evidence of transmission integrity with fingerprint calculation, time-stamping of all actions and status record updating, pre-checking sender and receiver identities, validating file opening dates are part of Keyvelop features.

About FacePrint Global Solutions, Inc.

FCPG operates a business, which develops and delivers a variety of technology solutions, including biometric software applications on smart cards and other support mediums (apometric solutions). FCPG's products provide biometric solutions for identity authentication and a host of smart card- and biometrics-related hardware peripherals and software applications. Apometrix, FCPG's wholly-owned subsidiary, combines on-card or in-chip multi-application management solutions with best-of-breed 'in-card matching' biometrics. Keyvelop's secure digital envelope solution and Apometrix's on-card biometrics work together to produce the winning combination in the fields of security, traceability and identity management.

Conclusion:



The examples above show the Awesome, Earning Potential of little known Companies That Explode onto Investor's Radar Screens. This stock will not be a Secret for long. Then You May Feel the Desire to Act Right Now! And Please Watch This One Trade!

GO FCPG!



All statements made are our express opinion only and should be treated as such. We may own, take position and sell any securities mentioned at any time. Any statements that express or involve discussions with respect to predictions, goals, expectations, beliefs, plans, projections, objectives, assumptions or future events or performance are not statements of historical fact and may be \"forward looking statements.\" Forward looking statements are based on expectations, estimates and projections at the time the statements are made that involve a number of risks and uncertainties which could cause actual results or events to differ materially from those presently anticipated. This profile is in no way affiliated with the featured company. We were compensated one thousand dollars from third party (IR Marketing) to distribute this report. Forward looking statements in this action may be identified through the use of words such as: \"projects\", \"foresee\", \"expects\". in compliance with Section 17(b), we disclose the holding of FGS shares prior to the publication of this report. Be aware of an inherent conflict of interest resulting from such holdings due to our intent to profit from the liquidation of these shares. Shares may be sold at any time, even after positive statements have been made regarding the above company. Since we own shares, there is an inherent conflict of interest in our statements and opinions. Readers of this publication are cautioned not to place undue reliance on forward-looking statements, which are based on certain assumptions and expectations involving various risks and uncertainties that could cause results to differ materially from those set forth in the forward- looking statements. This is not solicitation to buy or sell stocks, this text is for informational purpose only and you should seek professional advice from registered financial advisor before you do anything related with buying or selling stocks, penny stocks are very high risk and you can lose your entire investment.

12:46 PM  
Anonymous buy resell rights said...

Mighty Blogalicious Greetings to you and your blogging visitors!
I have a website for people searching for content management web. Pop over if your interested. Thanks, Chad.

8:56 AM  
Anonymous e-books with resell rights said...

Wanna make $ with your blog?
I have a website for people searching for content free site web. Pop over if your interested. Thanks, Chad.

10:19 PM  

Post a Comment |

« Home

Powered by Blogger Weblog Trackback by HaloScan.com