> <descript> You are standing in front of a stump. A path leads north. </descript> > <exits> N </exits>
Probably more like: <description name=primary> <person>you</person> <location> <relation>in front of</relation> <object>stump</object> </location> <situation> <object>path</object> <action>leads NOrth</action> </situaytion> </description> And the XSL will join the bits together using XPathstyle references to "fill in the blanks": <p><xnm:description:person> are <xnm:description:location:relation> a <xnm:<xnm:description:location:object>. A <xnm:description:situation:object> <xnm:description:situation:action></p> > and you have a XSL that works like a CSS? > > descript {font:arial, align:center} > exits style:bolder And yes you can have that too. > Is that a good paraphrasing? How browser dependent would that be? Do > most browsers support XML & XSL? Very few do at present, only the latest generation. But given many folks are still using Netscape 4 and IE 4 and even the latest versions have haphasard XML support we are quite a long way away from unified presentationof XML via browsers. Fortunately theres another technology which can turn XML into HTML, called XSLT and it takes the XSL above and spits out normal HTML to the browser, which is what happens most of the time and the user is blissfully ignorant that XML is underneath the covers. > What's SAX DOM? I know what a DOM is, but what's the SAX? Both are parsers. DOM reads the whole structure into memory and accesses it like a tree. SAX parses the file as its being read and recognises key elements and activates a parsing function. THuis in the XML above you could instruct the parser to call one of your functions everytime it found a <situation> tag, passing in the whole content of that tag. Your function then handles only the data inside the tag that it is intersted in. Its faster and saves memory, but is strictly read-only, and read once - you can't change the data and you can't go back a step, you need to restart from the top. Both approaches have their advantages. > my Python docs when I was poking XMLParser. If/when I work with XML, > would you recommend Python's standard modules for it? Yes, Python has good XML support and can use DOM or SAX. Alan G. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor