SitePoint Sponsor

User Tag List

Page 2 of 3 FirstFirst 123 LastLast
Results 26 to 50 of 61

Thread: What is XML?

  1. #26
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,290
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    From what I understand, the purpose is to make the validation easier. IE allows for bad coding styles because it allows you to forget to close tags(<P> seems to be the big culprit, though table tags come a close second) or mix and match the order of the tags and it will still figure out what you mean. Other products like Netscape and Opera are more scrutinous about coding standards.

    Good coding with closing tags make it easier to figure out where something starts and stops, thus making it faster to render. Also one less issue to try and allow for cross compatibility for.

    I think a big part of it is to force people to go back to the good coding standards of the past. Just MHO though.
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style
    Learn how to be ready for The Forums' Move to Discourse

  2. #27
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's not what I mean exactly - closing ALL tags is just fine and dandy, but why with the new format, IE: <br />? Why not </br>? Just doesn't make much sense to me.

  3. #28
    midnight coder
    Join Date
    Dec 2000
    Location
    The flat edge of the world
    Posts
    838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well if you have a document like:

    Hello
    <br></br>
    Welcome

    The second tag is quite useless, so the guys creating XML/XHTML decided a shortcut would be <br/> which sort of merge the two tags to one.

    But for XHTML docs, some older browser might not have a clue what <br/> is, so they put a space in it , like <br />, which makes it work.

  4. #29
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ohhhhhhhhhhhhh, I thought it was like this:

    Hello
    <br><br />
    Welcome

    Makes more sense now...thanks!

  5. #30
    SitePoint Zealot Website Rob's Avatar
    Join Date
    Aug 2000
    Location
    Alberta, Canada
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You are correct Dave, in stating that: "(ie <br></br> ), though I believe this might cause more problems" as there are no such tags.

    The easiest way to remember is to know that in XML, every starting tag must be paired with a closing tag. Since XHTML is a hybrid of XML & HTML—and there are some tags in HTML that are not pairs and do not have a closing tag—the /> is used as an identifier for a single closed tag.

    i.e. META, BR, HR, INPUT, IMAGE, LINK, etc.

    In other cases, tags that had "optional" closing tags are no longer optional and must closed.

    i.e. P, LI, OPTION

    And perhaps most confusing of all, since all attributes must be in quotes, is when to use the quotes.

    i.e. <hr noshade="noshade" /> <input type="text" name="name" maxlength="30" checked="checked" />

    Like most things, the best way to get familiar with XHTML is to start using it.


    TIP: the above is also legal code using an HTML 4.x DOCTYPE "if" you do not use the /> within the <head> </head> tag, and only use the /> within the <body> </body> tag. This allows for learning XHTML code without having to recode all previous pages. And if your HTML Validator gives you error messages, you will know it's time to either use the Validator links previously mentioned, or get a new Validator.


    <Edited by Website Rob on 12-04-2000 at 08:18 PM>

  6. #31
    SitePoint Wizard jumpthru's Avatar
    Join Date
    Apr 2000
    Location
    Los Angeles, California
    Posts
    1,008
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Let me get this straight.

    Hello,<br />
    World!

    or

    Hello, <br></br>
    World!

    Why not just make a standard. All tags are now <whatever><whatever /> (of for 'one tag' tag's <br />) or all tags are now <whatever></whatever>. But why mix and match. That will only confuse people, and the goal should be to standardise the system...

  7. #32
    midnight coder
    Join Date
    Dec 2000
    Location
    The flat edge of the world
    Posts
    838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well it's pretty pointless to do <br></br> everytime you wanna make a new line, and also, <br /> will valid as normal HTML and XHTML, so the new tag's actually backward compatible.

  8. #33
    SitePoint Zealot Website Rob's Avatar
    Join Date
    Aug 2000
    Location
    Alberta, Canada
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not sure where the confusion came in, but <br></br> is not a valid tag.

  9. #34
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think Nate was proposing it as valid in the next version of HTML.

    Now that It's been explained to me, I think I see the point here: it's a pain to use a closing tag for BR, HR, etc. So instead, the starting tag and closing tag become one. <br /> is both tags, since the BR tags are not something you want to enclose other things in anyway.

    Now that I "get it", it makes sense.

  10. #35
    SitePoint Zealot Website Rob's Avatar
    Join Date
    Aug 2000
    Location
    Alberta, Canada
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cool. *

  11. #36
    SitePoint Wizard jumpthru's Avatar
    Join Date
    Apr 2000
    Location
    Los Angeles, California
    Posts
    1,008
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i think i get it. so in the next version of html/xhtml or whatever, will <br></br> be valid, since they want you to close every single tag? and then a shortcut for that would be <br />? why not make the shortcut <br>...

  12. #37
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,290
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Because the slash signifies a closing tag. The point is to make sure there is a closing tag for every open tag. Allowing the /> at the end of the tag makes it a closing and an opening tag.
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style
    Learn how to be ready for The Forums' Move to Discourse

  13. #38
    will code HTML for food Michel V's Avatar
    Join Date
    Sep 2000
    Location
    Corsica
    Posts
    552
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What's the point in closing a <br> ? Would you type this:
    Line 1 <br><br />
    Line 2

    ?

    And if <img> has a closing tag, can you place something between <img> and <img />

    ...Just being curious.

    (as for the <br /> i'll get used to it because it looks like the <br/> in WML)
    [blogger: zengun] [blogware contributor: wordpress]

  14. #39
    midnight coder
    Join Date
    Dec 2000
    Location
    The flat edge of the world
    Posts
    838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's the whole point, you would NOT type <br><br />

    You would type:

    Line 1<br />
    Line 2


    Same goes for image, you would simply type:

    <img src="blah.jpg" />

    Not:

    <img src="blah.jpg"></img>

  15. #40
    Fluffy Kitten Programmer~ Elledan's Avatar
    Join Date
    Jun 2000
    Location
    Netherlands
    Posts
    1,356
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So tags that are in HTML 4 single (like the img and br tag) will always look like this:

    <sometag />

    and tags who come in pairs like this:

    <sometag>somethingelse<sometag />

    am I right?
    www.nyanko.ws - My web-, software- and game development company.
    www.mayaposch.com - My personal site and blog.

  16. #41
    SitePoint Zealot Website Rob's Avatar
    Join Date
    Aug 2000
    Location
    Alberta, Canada
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Elledan
    So tags that are in HTML 4 single (like the img and br tag) will always look like this:

    <sometag />

    and tags who come in pairs like this:

    <sometag>somethingelse<sometag />

    am I right?

    Almost

    <sometag>somethingelse</sometag>

  17. #42
    SitePoint Wizard jumpthru's Avatar
    Join Date
    Apr 2000
    Location
    Los Angeles, California
    Posts
    1,008
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Website Rob
    Originally posted by Elledan
    So tags that are in HTML 4 single (like the img and br tag) will always look like this:

    <sometag />

    and tags who come in pairs like this:

    <sometag>somethingelse<sometag />

    am I right?

    Almost

    <sometag>somethingelse</sometag>
    Okay, thats my excact point. They are trying to make a standard, but they aren't. The way website rob, said should be the way they do it.

  18. #43
    Fluffy Kitten Programmer~ Elledan's Avatar
    Join Date
    Jun 2000
    Location
    Netherlands
    Posts
    1,356
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yup, I'm lost as well

    This isn't a really logical standard...
    www.nyanko.ws - My web-, software- and game development company.
    www.mayaposch.com - My personal site and blog.

  19. #44
    SitePoint Zealot Website Rob's Avatar
    Join Date
    Aug 2000
    Location
    Alberta, Canada
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    May I suggest a re-reading of this page (specifically my post of: 12-04-2000 06:07 PM) and see if that helps clear up any confusion.

  20. #45
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't see why all tags need to be closed. In tags like <br> that need to be closed right away anyway, why not just make "<br>" both an opening and closing tag, instead of "<br />"? It serves no purpose.

    And BTW: I think it's best to keep HTML as much like it is now as possible. Change is pointless unless it improves things - changing the format of closing tags is odd, and, in the case of some tags, seems pointless.

  21. #46
    SitePoint Wizard jumpthru's Avatar
    Join Date
    Apr 2000
    Location
    Los Angeles, California
    Posts
    1,008
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by TWTCommish
    I don't see why all tags need to be closed. In tags like <br> that need to be closed right away anyway, why not just make "<br>" both an opening and closing tag, instead of "<br />"? It serves no purpose.

    And BTW: I think it's best to keep HTML as much like it is now as possible. Change is pointless unless it improves things - changing the format of closing tags is odd, and, in the case of some tags, seems pointless.
    That was excactly what I was trying to say in a earlier post, I think I lost my point as I got confused later on...but anyway. That was my excact point...why not just make <br> the opening and closing tag, rather than <br />? And then have double tags be <a></a> and single tags be <br>?

  22. #47
    SitePoint Zealot Website Rob's Avatar
    Join Date
    Aug 2000
    Location
    Alberta, Canada
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I do believe you are starting to see the value & beauty of XML - unfortunately you are looking at it from the other side of the fence.

    On this side of the fence we are jumping for joy because no longer will there be three different ways of coding a page. Theoretically there is "one" Standard for HTML. In reality there is the Standard which some Browsers understand, the Standard the some Browsers don't understand, and Browser specific code. XHTML is just the in-between stage for jumping to XML, where improper code will not display. What could be more simpler.

    Right now, Browser specific code is a bit easier to figure out but the first two, give most people a headache when creating Web pages. Trying to figure out what Browser doesn't understand what code is the most difficult thing of all. Some coders take the short route and code for a specific Browser and to heck with the rest. Well in the business world, an attitude like that won't fly. Image how much business a Shopping Mall would lose, if all the parking spaces were made for small cars only!

    Business Web sites are geared for maximum return and U.S. Goverment Web sites are now required to be handicap accessable - just like parking lots. You say why learn the new stuff? I say who codes in HTML 2.0? The computer world changes very quickly and people who design Web sites either constantly learn or fall behind. The choice is ours to make.

  23. #48
    SitePoint Wizard jumpthru's Avatar
    Join Date
    Apr 2000
    Location
    Los Angeles, California
    Posts
    1,008
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Who codes in 2.0? People trying to not be browser specific...there are still people using old browsers that use 2.0...

    I think though that this is good. They should make a standard on lowercase or caps, not closing tags, no quotes/quotes (which is right?). And if something doesn't work, then the page doesn't show. Just like programming in C++, or php...

  24. #49
    ComDude CryingWolf's Avatar
    Join Date
    Dec 2000
    Location
    I don't know the cat drug it in!!!
    Posts
    247
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by jumpthru
    Originally posted by TWTCommish
    I don't see why all tags need to be closed. In tags like <br> that need to be closed right away anyway, why not just make "<br>" both an opening and closing tag, instead of "<br />"? It serves no purpose.

    And BTW: I think it's best to keep HTML as much like it is now as possible. Change is pointless unless it improves things - changing the format of closing tags is odd, and, in the case of some tags, seems pointless.
    That was excactly what I was trying to say in a earlier post, I think I lost my point as I got confused later on...but anyway. That was my excact point...why not just make <br> the opening and closing tag, rather than <br />? And then have double tags be <a></a> and single tags be <br>?
    I would think that is because <br /> would still be compatable with older browsers unlike <br></br> which might confuse older browsers into thinking two line breaks???

    (correct me if I am wrong cuz I haven't really been studying any of this in a few years.)

    </br> might still confuse older browsers but <br /> might only mean line break in older browsers and in xml were all tags need a closing tag -- </br> would mean a closing tag with no opening tag; <br></br> could work but older browsers my break two lines or other wierd effects; <br /> has an opening tag and a closer, older browsers will probably just treat it as a <br>, xml is happy cuz you open then close,,,

    My question would then be would xml allow other tags to be opened and closed on the same line with again wierd effects???

    ie <HTML "that is all folkes" /> ok a really stupid use that would make alot of browers choke but still a point

  25. #50
    ComDude CryingWolf's Avatar
    Join Date
    Dec 2000
    Location
    I don't know the cat drug it in!!!
    Posts
    247
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh and one more point

    it seems to me that:

    <br> in XML would mean opening tag with no closer there fore you don't fulfill the closing tag for every opening tag

    P.S. I have always tried to keep my hand coding tight with always useing closing tags even when they are optional like

    <p> some text </p>

    to me this is the proper way I learned how to code and just a <p> with no close seems like I am breaking a rule

    I know it seems weird but really how many tags are we talking here???

    for the ones that I use the most really just <img /> <br /> <hr /> etc... really without looking maybe 5 at the most???


Bookmarks

Posting Permissions

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