posted 21 years ago
OK, I tried to give my co-worker good reasons why something is a parameter of a tag, versus making it an inner tag of that tag.
I went into the parameter being more of a configuration of the tag, whereas it would be a tag if the information stored is more data related.
In his example he had a <PRINTER> tag. He wanted to store Name, IP, Availability, Status, and Location. I used Location as an example.
So I told him that Name, IP, Availability, and Status where better as tags, and Location as a parameter. Since if you were converting this XML to HTML using XSLT, the first four values would be what you wanted displayed in an HTML Table, but Location is used as XSLT If statement conditions. Meaning like so
Location can be Local or Network. But where the location of the printer actually is makes no difference to the user of the HTML document, Now the HTML document and XSLT should handle the location of printers differently. Maybe local printers in Green and network printers in Red. SO since this is really just going to be used in an IF statement in the XSLT document, then it is better as a parameter.
Does this make sense. Am I smoking crack or something, or does someone else have a better answer for him. I know I had read something somewhere explaining this, but I can't remember where?
Thanks
Mark