www.webdeveloper.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 19

Thread: ENTITY specification

  1. #1
    Join Date
    Mar 2006
    Posts
    46

    Cool ENTITY specification

    I need some help on just how I can specify these ENTITIES within my code and use them. I am new and cannot figure out to do this. I found these specifications (just what I need), but am lost as to how to use them.

    Thanks in advance for your help.

    <!-- Character entity set. Typical invocation:
    <!ENTITY % HTMLlat1 PUBLIC
    "-//W3C//ENTITIES Latin 1//EN//HTML">
    %HTMLlat1;
    <!ENTITY sup0 SDATA "[sup0 ]" --Superscript 0 -->
    <!ENTITY sup4 SDATA "[sup4 ]" --Superscript 4 -->
    <!ENTITY sup5 SDATA "[sup5 ]" --Superscript 5 -->
    <!ENTITY sup6 SDATA "[sup6 ]" --Superscript 6 -->
    <!ENTITY sup7 SDATA "[sup7 ]" --Superscript 7 -->
    <!ENTITY sup8 SDATA "[sup8 ]" --Superscript 8 -->
    <!ENTITY sup9 SDATA "[sup9 ]" --Superscript 9 -->
    -->


    // <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"[<!ENTITY sup4 "&#x2074;"> ]>
    <html xmlns="http://www.w3.org/1999/xhtml">

    <!ENTITY sup0 SDATA "[sup0 ]" --Superscript 0 -->
    <!ENTITY sup4 SDATA "[sup4 ]" --Superscript 4 -->
    <!ENTITY sup5 SDATA "[sup5 ]" --Superscript 5 -->
    <!ENTITY sup6 SDATA "[sup6 ]" --Superscript 6 -->
    <!ENTITY sup7 SDATA "[sup7 ]" --Superscript 7 -->
    <!ENTITY sup8 SDATA "[sup8 ]" --Superscript 8 -->
    <!ENTITY sup9 SDATA "[sup9 ]" --Superscript 9 -->

  2. #2
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    You've got things a bit confused and you are trying to use SGML entities with XML. What exactly are you trying to accomplish?
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  3. #3
    Join Date
    Mar 2006
    Posts
    46
    I am trying to layout some numbers where I need 'superscripts' like &sup1. etc. thru 9. If I use ... 9<sup>8</sup> then the number 8 is positioned above the 9 and my row is 'doubled'. In essence, I need to have numbers '1/2' the size of the 9. I hope I have explained what I am trying to accomplish.

  4. #4
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    Well, that has nothing to do with entities, it's just CSS. Decrease the font size of your numbers and increase the line height of the container.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  5. #5
    Join Date
    Mar 2006
    Posts
    46
    Perhaps I do not understand how I can decrease the size of my font and get the numeric to line up where I would like to have it. Let us say that I wanted a smaller 3 in this example: W3C, how would one specify this? .. W<font size - 1>3</font>?. I have tried ".. 2 <small> <sup> 1/2</sup></small> " but it does not give me what I want. Using the example from your quote -- Tim Berners-Lee, W3C, instead of having the '3' at the bottom, I would like it to appear at the top and no higher than the top of the W. I know '&sup1' would give me what I want for a '1', however I need it for all numerics 0 thru 9 including fractionals. Not just 1/4, 1/2, 3/4. If I can solve it for one, then I can build it for all others which I need.

    Rather difficult to explain.

  6. #6
    Join Date
    Mar 2006
    Posts
    46
    Here are three different attempts I have tried:
    if( value ) { value = value.replace( '990' , '4' +'<small>'+'1/2'+'</small>') }
    ? Should this be ('<small>'+'4 1/2'+'</small>') ?

    if( value ) {value = value.replace( n+'.25', n+'&frac14')}
    ? Should this be ('<small>'+n+'</small>'+'&frac14') ?

    if( value ) { value = value.replace( '2420', '<b>'+'1 3/8'+'</b>' ) }

    Will they line up ?

  7. #7
    Join Date
    Aug 2003
    Location
    In my house
    Posts
    4,004
    Why can't you use &sup2;, &sup3;, &sup4;, &sup5;, and so on and so forth? I tried it; works for me.
    Thousand different paths
    So many sterile ends
    I chose the Devil's path

    Never shall the sun kiss my face
    And caress me with it's burning light
    For I dwell in the shadows
    And sleep side by side with death

  8. #8
    Join Date
    Mar 2006
    Posts
    46
    I have tried that and it is not being translated. I am testing my code using OPERA. (I am also learning as I go along). Perhaps you could give me an example of how you specified same and in what environment you tested. If I can get pass tis hurdle then I can continue, and complete my layout.

    Maybe my prolog specifications are not complete: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

    Should I replace it with this, or append it? "-//W3C//ENTITIES Latin 1//EN//HTML">
    Your help is appreciated.

  9. #9
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    What you are trying to do has absolutely nothing to do with entities. Stop looking for the solution there.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  10. #10
    Join Date
    Mar 2006
    Posts
    46
    What I am looking for is help. I am teaching myself and am stuck. If you could just point me in the right direction I will try and decipher it myself. I have absolutely no idea where to look next.

    Thanks in advance for your help.

  11. #11
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    Your solution, like all solutions, is to get the mark up right and then use CSS to tweak the display.
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
     "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta name="Content-Script-Type" content="text/javascript">
    <meta name="Content-Style-Type" content="text/css">
    <title>Example</title>
    
    <style type="text/css">
    body {line-height:125%}
    .fractional-part {font-size:75%}
    </style>
    
    </head>
    <body>
    <p>Lorem ipsum dolor sit amet, 3 <span class="fractional-part"><sup>1</sup>/<sub>4</sub></span> consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>
    </body>
    </html>
    Last edited by Charles; 12-28-2006 at 05:55 AM.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  12. #12
    Join Date
    Mar 2006
    Posts
    46
    If I had the knowledge to understand what you are saying I would not be asking for this level of help. I ask only for a basic example and some help. I have taught myself what I know with minimal help by readin these forums, then researching, reading and trying. I am certain the answer is obvious to those who know, but for me it is monumental. All I ask for is a little help.

  13. #13
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    Take another look at my post closest above.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  14. #14
    Join Date
    Mar 2006
    Posts
    46
    Thanks for the example. I will try it. My knowledge in programming was at the machine level where I interpreted what was specified in the higher language and translated that to execute the 'machine language code'. For example: To run one of your loops I may produce code of this tpe:
    ic (reg1,1) // you initial loop value
    sll (reg1,4) // develop # iterations
    bct (*-1) // and run your loop

    Note the code may not be syntactically correct.

  15. #15
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    This is the HTML forum. We don't care how you get there just output things properly marked-up and then tweak the CSS.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles