Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts

    My own DTD for XHTML?

    Hey folks. I've got a page that uses ONE extra attribute for LI elements, and I'd like it to validate (it's the ONLY error on my page). I downloaded the XHTML1 DTD from the W3C and added this
    Code:
    <!ELEMENT li %Flow;>
    <!ATTLIST li
      %attrs;
      ignore      CDATA          #IMPLIED
      >
    Then saved the DTD and pointed my DOCTYPE at this DTD. However, the page still doesn't validate. Did I do this incorrectly? Or can this not be done?
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #2
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,459
    Thanks
    1
    Thanked 23 Times in 21 Posts
    Did you save the DTD locally or to a website? Remember, the W3C Validator can't really read your hard drive.
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog

  • #3
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    C'mon d00d, gimme a bit more credit than that! You could have at least checked the source for yourself....I provided a link

    http://www.peterbailey.net/nm/nm.dtd
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #4
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,459
    Thanks
    1
    Thanked 23 Times in 21 Posts
    Try this DOCTYPE tag:
    Code:
    <!DOCTYPE html 
         PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
    [
    <!ATTLIST li
      ignore      CDATA          #IMPLIED
      >
    ]>
    Your DTD was correctly written, I believe.
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey wow - can you really just add to an exisiting DTD ...? that's way cool

  • #6
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,459
    Thanks
    1
    Thanked 23 Times in 21 Posts
    Sure you can, XML 1.0 specification.

    Moderators gotta know something about what their forum discusses.
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog

  • #7
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Originally posted by Alex Vincent
    Moderators gotta know something about what their forum discusses.
    They sure gotta know something .

  • #8
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Alex, it validates perfectly, but...

    Tha last ]> shows up on my page as text. Some tiny syntactical oversight perhaps? Or just stoopid IE? I tried a couple variations but either the text kept showing up, or the page didn't validate. Thanks for the help!
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #9
    Regular Coder
    Join Date
    Nov 2002
    Location
    Bristol, UK
    Posts
    932
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi beetle, I don't want to interrupt your thread (well I already have so tough! ) but it seems like an ideal place to post the following questions:

    1. Could someone who knows post an example of how to extend the DTD with any property? Just quickly? I mean, it appears to me that there are two main extensions that can be done (excluding events) - adding a new tag, such as <mytag>, and adding an attribute <div myattr>. It would be nice to have a simple guideline on how to do this so that it would be syntatically correct, and also work ok

    2. Events - is it possible to simply add an event to the defined events list? Like, how would that work? I mean, if you added your own event and then captured it, how would it ever be triggered? How would the browser know when to trigger it? Or is this just not possible.

    It would also be nice to know what browser support there is for the above

    I know that beetle has covered part of that but his request is quite specific, mine is more general as I have the same problem as beetle atm but in a different way. It may also be an idea to make this thread sticky once answered, because I could not find this info elsewhere in the forum (I guess beetle couldn't either)

    Cheers people!

    ::] krycek [::
    ithium | SOAPI | SDP | PTPScript manual
    "ithium is a non-profit webhost, which is pretty much unique. The mission of ithium is to provide free hosting resources for worthwhile and needy non-profit projects, which otherwise may not be able to obtain such facilities. The money from commercial customers goes to maintain ithium's servers and further development."

  • #10
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Originally posted by krycek
    2. Events - is it possible to simply add an event to the defined events list? Like, how would that work? I mean, if you added your own event and then captured it, how would it ever be triggered? How would the browser know when to trigger it? Or is this just not possible.
    In Mozilla, you can fire any event you want, even custom events via:

    var evt = document.createEvent('Events');
    evt.initEvent('mycustomEvent', false, false);
    someEventTarget.dispatchEvent(evt);

    IE only allows the firing of custom events on scriptlets, which makes it pretty much worthless.

  • #11
    Regular Coder
    Join Date
    Nov 2002
    Location
    Bristol, UK
    Posts
    932
    Thanks
    0
    Thanked 0 Times in 0 Posts
    but surely those 'custom' events can only be chosen from a bigger list of pre-defined events? Coz let's say you wanted to make a new event, called, say, onReachLeft which will fire whenever an animated object reaches the left side of the screen, how would you attach this? So that the event fires, I mean? I don't get that bit

    ::] krycek [::
    ithium | SOAPI | SDP | PTPScript manual
    "ithium is a non-profit webhost, which is pretty much unique. The mission of ithium is to provide free hosting resources for worthwhile and needy non-profit projects, which otherwise may not be able to obtain such facilities. The money from commercial customers goes to maintain ithium's servers and further development."

  • #12
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Through some crafty scripting.

    See here for an example on Moz:
    http://www.webfx.eae.net/dhtml/xblma...blmarquee.html

  • #13
    Regular Coder
    Join Date
    Nov 2002
    Location
    Bristol, UK
    Posts
    932
    Thanks
    0
    Thanked 0 Times in 0 Posts
    that is a very, very cool link!

    do you think IE will ever support this XBL stuff etc. etc.

    ::] krycek [::
    ithium | SOAPI | SDP | PTPScript manual
    "ithium is a non-profit webhost, which is pretty much unique. The mission of ithium is to provide free hosting resources for worthwhile and needy non-profit projects, which otherwise may not be able to obtain such facilities. The money from commercial customers goes to maintain ithium's servers and further development."

  • #14
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Originally posted by krycek
    do you think IE will ever support this XBL stuff etc. etc.
    IE supports Element and ViewLink behaviors. Not quite as powerful as XBL, but it also doesn't suffer from the same, near-crippling global namespace issue Javascript has in XBL.

    Behaviors are a little easier, but I find XBL to be cleaner. I used to have examples of widgets I wrote using "custom tags" and behaviors/xbl to make then do stuff. Not sure if I still do, but I once had a:
    <rdhtml:window/> widget which created a draggable DOM window that could be added by simple markup instead of Javascript that polluted the global namespace of the webpage (pure encapsubility)

  • #15
    Regular Coder
    Join Date
    Nov 2002
    Location
    Bristol, UK
    Posts
    932
    Thanks
    0
    Thanked 0 Times in 0 Posts
    so it would be possible to do this x-browser? I mean, make an encapsulated custom element, using both methods, one for each browser? that would be very cool... do you have any links to articles about doing this x-browser, or are you willing to share any of the code you have? (Just how to construct the element etc.)

    it sounds very very interesting!

    ::] krycek [::
    ithium | SOAPI | SDP | PTPScript manual
    "ithium is a non-profit webhost, which is pretty much unique. The mission of ithium is to provide free hosting resources for worthwhile and needy non-profit projects, which otherwise may not be able to obtain such facilities. The money from commercial customers goes to maintain ithium's servers and further development."


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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