xmp, what to use instead of.

Discussion in 'HTML' started by myphplists@yahoo.com, Apr 19, 2013.

  1. Guest

    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?
    , Apr 19, 2013
    #1
    1. Advertising

  2. 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
    Jonathan N. Little, Apr 19, 2013
    #2
    1. Advertising

  3. 2013-04-19 5:32, 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/html-spec_5.html#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.html#non-conforming-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/
    Jukka K. Korpela, Apr 19, 2013
    #3
  4. On Friday, April 19, 2013 4:32:55 AM UTC+2, 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
    Jan Clemens Faerber, Apr 28, 2013
    #4
  5. 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/
    Jukka K. Korpela, Apr 28, 2013
    #5
  6. 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.
    Jan Clemens Faerber, Apr 29, 2013
    #6
  7. 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/
    Jukka K. Korpela, Apr 29, 2013
    #7
  8. 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.
    Jan Clemens Faerber, Apr 29, 2013
    #8
  9. 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
    Jonathan N. Little, Apr 29, 2013
    #9
  10. 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/>
    Chris F.A. Johnson, Apr 29, 2013
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. WJ

    XMP content and POST ?

    WJ, Mar 3, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    420
    Joerg Jooss
    Mar 5, 2005
  2. Arnoud Oortwijk

    Wrapping text between <xmp>

    Arnoud Oortwijk, Oct 23, 2003, in forum: HTML
    Replies:
    1
    Views:
    1,185
    Steve Pugh
    Oct 23, 2003
  3. AspProgrammer

    xmp in asp or in asp.net

    AspProgrammer, May 9, 2005, in forum: XML
    Replies:
    1
    Views:
    458
    Martin Honnen
    May 10, 2005
  4. Davide

    Adobe XMP in Java

    Davide, May 23, 2006, in forum: Java
    Replies:
    0
    Views:
    585
    Davide
    May 23, 2006
  5. Ivan Herman

    XMP in Python

    Ivan Herman, May 28, 2004, in forum: Python
    Replies:
    0
    Views:
    431
    Ivan Herman
    May 28, 2004
Loading...

Share This Page