Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > xmp, what to use instead of.

Reply
Thread Tools

xmp, what to use instead of.

 
 
myphplists@yahoo.com
Guest
Posts: n/a
 
      04-19-2013
We use <xmp>, a quieter version of <pre>, a lot. However, it's
deprecated. It works great in FF and that's kinda all we care about,
BUT, we want to play ball. What is used instead <xmp> now?
 
Reply With Quote
 
 
 
 
Jonathan N. Little
Guest
Posts: n/a
 
      04-19-2013
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> We use <xmp>, a quieter version of <pre>, a lot. However, it's
> deprecated. It works great in FF and that's kinda all we care about,
> BUT, we want to play ball. What is used instead <xmp> now?
>


What do you mean by *quieter*? Just use PRE, XMP and been deprecated
forever, or nearly so...

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      04-19-2013
2013-04-19 5:32, (E-Mail Removed) wrote:

> We use <xmp>, a quieter version of <pre>, a lot. However, it's
> deprecated. It works great in FF and that's kinda all we care about,
> BUT, we want to play ball. What is used instead <xmp> now?


The very first HTML specification, HTML 2.0, said:

"Since CDATA declared content has a number of unfortunate interactions
with processing techniques and tends to be used and implemented
inconsistently, HTML documents should not contain XMP nor LISTING
elements -- the PRE tag is more expressive and more consistently supported."

http://www.w3.org/MarkUp/html-spec/h...tml#SEC5.5.2.1

The world around has changed in 17 years, but the HTML5 CR still plays
the same game, though it is more explicit:

"xmp

Use pre and code instead, and escape "<" and "&" characters as
"&lt;" and "&amp;" respectively."

http://www.w3.org/TR/html5/obsolete....rming-features

In reality, <pre> is not "more expressive" except in the sense that
markup and entities are recognized inside it, which is normally
something people do *not* want when considering the use of <xmp> (unless
they want some color coding). There is no evidence of more consistent
support.

HTML5 spells out the situation, but the reference to <code> should have
the condition "if you would be using <xmp> to present computer code, as
people mostly do".

<xmp> has been frowned upon because at some point, some people, trying
to retrofit the improvised tag soup system called "HTML" into SGML,
started thinking that CDATA declared content wasn't really in the spirit
of SGML. Later, nobody has really defended <xmp> against all the false
accusations or the discrimination based just on its being different.

<xmp> does its job well. It is true that it is anomalous, truly unique
in its nature (if we ignore <plaintext>, which was a real oddity): it is
the only element inside which no markup, not even character and entity
references, is recognized, except for the end tag of the element itself.
And this is exactly why it was invented and why it is used: to present
text without having any markup recognized but treated as plain text.

If you are generating HTML programmatically, it is a peace of cake to
escape "<" and "&". Doing that by hand tends to be error-prone, and the
only reason to bother is that some people may peek into your code and
declare <xmp>, and you, deprecated, obsolete, forbidden, cursed,
anathema, etc. That's often a very real risk - and it makes people look
for <table> as well, or anything that is "not semantic" in their book.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
 
Reply With Quote
 
Jan Clemens Faerber
Guest
Posts: n/a
 
      04-28-2013
On Friday, April 19, 2013 4:32:55 AM UTC+2, (E-Mail Removed) wrote:
> We use <xmp>, a quieter version of <pre>, a lot. However, it's
>
> deprecated. It works great in FF and that's kinda all we care about,
>
> BUT, we want to play ball. What is used instead <xmp> now?


I didn't test it now but I heard last week in my php course that you shouldbe very careful when you use a <textarea> in your code because php will take any white space as it is and then you see the curser not in the very beginnen of the box but somewhere in the middle.

maybe you can start a game with it
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      04-28-2013
2013-04-28 19:06, Jan Clemens Faerber wrote:

> I didn't test it now but I heard last week in my php course that you
> should be very careful when you use a <textarea>


Nobody mentioned or even alluded to <textarea> before this. So what is
your point?

> in your code because
> php will take any white space as it is


PHP does not do any such thing. Browsers that get HTML documents
containing <textarea> elements do so, by definition.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
 
Reply With Quote
 
Jan Clemens Faerber
Guest
Posts: n/a
 
      04-28-2013
On Sunday, April 28, 2013 6:38:02 PM UTC+2, Jukka K. Korpela wrote:
> 2013-04-28 19:06, Jan Clemens Faerber wrote:


> > I didn't test it now but I heard last week in my php course that you
> > should be very careful when you use a <textarea>


> Nobody mentioned or even alluded to <textarea> before this. So what is
> your point?


the point is that the result of some text between an opening and closing textarea-tag which you echo out with php into a final html file will be shownin a similar way like some text in a simple html file without using php.

The top poster wanted to know something about other things beside the depricated <xmp> tag - so...?

> > in your code because
> > php will take any white space as it is


> PHP does not do any such thing. Browsers that get HTML documents
> containing <textarea> elements do so, by definition.


what I heard is that if you have some code to echo out within some lines ofphp code like document.writeln in JS the php will watch out for the whitespaces inbetween opening and ending <textarea> tags - and it will result in an output like a value attribute of <textarea>.

So you will have <textarea value="www"> and "www" will contain all the whitespaces you simply filled into the line(s) until you reach the closing </textarea> tag. And so you may find some php generated forms where you jump from one <input> to the next <> active element and when you reach the textarea the curser in that box won't be in the beginning - because of the prefilled whitespaces -

I haven't noticed that yet - I just repeat what someone told me to be awareof.

 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      04-29-2013
2013-04-29 2:15, Jan Clemens Faerber wrote:

> The top poster wanted to know something about other things beside the depricated <xmp> tag - so...?


So you thought you think you should tell all you thought you know about
HTML tags?

> I just repeat what someone told me to be aware of.


.... or all you heard about them?

--
Yucca, http://www.cs.tut.fi/~jkorpela/
 
Reply With Quote
 
Jan Clemens Faerber
Guest
Posts: n/a
 
      04-29-2013
On Monday, April 29, 2013 6:38:33 AM UTC+2, Jukka K. Korpela wrote:
> 2013-04-29 2:15, Jan Clemens Faerber wrote:


> > The top poster wanted to know something about other things beside the depricated <xmp> tag - so...?



> So you thought you think you should tell all you thought you know about
> HTML tags?


sometimes it's much easier to draw on a piece of paper.

> > I just repeat what someone told me to be aware of.


> ... or all you heard about them?


"tag" is a wide definition.
you can tag your pictures or look at those price tags in this group:

Here you find one article "Jukka K. Korpela professional answer U$ 0.00"

I hope you got your thrill now and can shave your beard.
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      04-29-2013
Jan Clemens Faerber wrote:
> On Monday, April 29, 2013 6:38:33 AM UTC+2, Jukka K. Korpela wrote:
>> 2013-04-29 2:15, Jan Clemens Faerber wrote:

>
>>> The top poster wanted to know something about other things beside the depricated <xmp> tag - so...?

>
>
>> So you thought you think you should tell all you thought you know about
>> HTML tags?

>
> sometimes it's much easier to draw on a piece of paper.
>
>> > I just repeat what someone told me to be aware of.

>
>> ... or all you heard about them?

>
> "tag" is a wide definition.
> you can tag your pictures or look at those price tags in this group:
>
> Here you find one article "Jukka K. Korpela professional answer U$ 0.00"
>
> I hope you got your thrill now and can shave your beard.
>


The problem here is that you offered information unrelated to the OP's
original question which was about a long ago deprecated element and its
possible replacement AND what you did report was totally incorrect. A
textarea does not have a value attribute but uses the content between
the opening and closing tags for its initial value.

<http://www.w3.org/TR/html401/interact/forms.html#initial-value>

PHP does not have anything to do with whitespace in a form control. If
you have whitespace between tags in a textarea it will be its initial
value same as <input name="textbox" type="text" value=" ">. It's HTML
not PHP.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Chris F.A. Johnson
Guest
Posts: n/a
 
      04-29-2013
On 2013-04-29, Jan Clemens Faerber wrote:
....
> I hope you got your thrill now and can shave your beard.


Heretic!!

--
Chris F.A. Johnson
<http://torontowebdesign.cfaj.ca/>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what is the advantage of using maven for java standalone app mcheung63@gmail.com Java 13 04-16-2013 01:42 AM
What Linux freeware will blur faces & show all frames of a 30second AVI video? Danny D. Digital Photography 8 04-14-2013 10:18 PM
[Firefox] Use New Tab instead of New Window? paul j Firefox 7 04-07-2005 09:40 PM
Web link in Thunderbird email - how to I make it use IE instead ofMozilla? Steve Henderson Firefox 1 03-06-2005 05:25 AM
tell visual studio designer to use "em" instead of "px" (newbie)? louis nguyen ASP .Net 1 11-17-2003 09:56 PM



Advertisments