PDA

View Full Version : Custom tags and attributes (sigh)


krycek
12-18-2002, 11:12 PM
OK, despite a lot of (much appreciated!) help from jkd, and helpful code, I am still struggling here.

I am trying to basically add my own tags, and also add attributes to existing tags. However, I keep messing up and so far nothing has worked properly.

A week of searching on the net has turned up a couple or articles about XUL and XBL as well as IE behaviours, however I was unable to grasp what was actually happening with the binding.

I think my main problem is with the DTD... hence I am posting in the XML forum. My JavaScripting is fine (aside from anything extra I need to do for this task) and currently I am trying to sonvert one of my custom elements into tag form.

Does anyone know of a resource where I could learn exactly what I need for this task? So far everything is either a long-winded intro to XML (which I don't need) or else way above my head talking about DTDs, XBL, XUL etc. and I need a tutorial aimed at programmers like myself who are just not familiar with the language and bindings.

Or, even if someone could step through some code to show me how to set up a very simple custom tag and attribute... I can pick it up from there :) I am sure it must be some simple, but key concept that I haven't quite got the hang of yet!

Cheers to anyone who can lend a hand

::] krycek [::

jkd
12-18-2002, 11:49 PM
The problem is not your DTD, like I said earlier.

Custom tags and attributes are no problem with XML, but giving them meaning and action is where the trouble is at. If you're using them in tandem with XHTML, you'll need to modfy the doctype to keep it valid, but that is beside the point.

What exactly don't you understand about my <rdhtml:slider> example?

There aren't any tutorials about doing this sort of thing, because it requires extensive background to be able to do it.
Take things one at a time. Learn IE's behaviors. Work with them. Learn XBL. Work it it. Continue bugging me on MSN. You'll get the hang of it eventually.

Check out WebFX's <marquee> in Mozilla, check out my <layer> in Mozilla @ layeremu.mozdev.org... look at the slider example I gave you some more... this is really one of things you gotta learn on your own, until someone actually writes a tutorial on it...

krycek
12-19-2002, 12:12 AM
sorry jkd if I bug you too much :o heheh

I have read all the stuff you mentioned, at least a dozen times, and I am sure that the problem must somehow be in my DTD (I am not trying to disagree with you but rather trying to describe what I am having difficulty with).

You see, I am not sure why I should have to use behaviours and XBL in the first place... or maybe I am just getting confused about exactly what they are in my head (so it may not be the DTD)

In beetle's post a little while ago he added a custom element to his DTD yet I did not think he used behaviours or XBL...? I thought he bound 'ordinary' JS somehow.

You are wrong about the tutorials about XBL, just check out the following links:

http://books.mozdev.org/
http://www.oreillynet.com/pub/a/mozilla/2002/12/17/app_dev.html

However both of these are purely for Mozilla, and they don't address what I want in the way I want so in that respect you are correct.

Ah well I guess I will have to plod on... Once I get the hang of it I will make a short intro and post it here (don't hold your breath! :rolleyes: )

::] krycek [::

jkd
12-19-2002, 01:12 AM
Originally posted by krycek
You are wrong about the tutorials about XBL, just check out the following links:

Doesn't contradict me at all. I said that there wasn't a tutorial for adding tags. XBL is XBL, and as more uses.

But anyway, this is the reason you need behaviors/XBL:

Hey, look at me! <myTag/>! Ha! I implemented a custom tag!

Wait, it isn't doing anything.... just renders as an inline, unstyled element. <myTag/> should be a template for some widget.

*after writing some ViewLink Behaviors and <content/> in XBL*
Yay, it now renders in its own way. But it just sits there... <select/> boxes open when I click on them! I now <myTag/> to fly around the screen onmouseover!

*edits behaviors and XBL to includes actions* There! :)

<ajv:tsk emotion="amused">Jason should really learn to write his examples properly, closing his XML tags. :p </ajv:tsk>

krycek
12-19-2002, 02:19 AM
heheh well put :D

sorry - didn't mean to contradict you but I misunderstood about the tutorials. When you said "this sort of thing" I thought, the whole sort of thing... DOH! :rolleyes:

well yeah I sort of understand where you are coming from with the whole approach to doing this, however... however... hmmm (me thinks) I guess all I can say is I have a lot to learn about this :o

::] krycek [::