Hi
I'm trying to understand how to use Yaxo and I cannot figure out what is the difference between the SAXDriver and SAXHandler. Of course there is no comment, no reference to the class SAXHandler.... Does anybody has an example?
Stef
PS: this is not a fatality, this is a state of mind!
stéphane ducasse wrote:
Hi
I'm trying to understand how to use Yaxo and I cannot figure out what is the difference between the SAXDriver and SAXHandler. Of course there is no comment, no reference to the class SAXHandler.... Does anybody has an example?
Stef
PS: this is not a fatality, this is a state of mind!
Stef,
SAX is an event drive API for processing XML documents. While java-based it is relatively standard across languages. There are several Java resources but here's one which helped me:
Most implementations of SAX (including the one included with the "full" 3.7 image) are mostly "2.0" compliant which seems to me including XML namespaces (someone correct me if I'm wrong here) so the sample code on these pages which specifically deals with namespaces also transfers well to Smalltalk. As for Smalltalk examples, well, look at the subclasses of SAXHandler...one of these uses SAX to build the somewhat standard DOM tree. So, one has two choices when dealing with XML: event drive with SAX (usually, but not always, building the tree yourself) or DOM where the XML tree gets build from generic components (XMLElements).
Sorry if this is not specific enough...I'm sure others will chime in with concrete examples but I think knowing SAX, per se, is as important as knowing the Smalltalk implementation since it ensures that the two don't get too far apart.
David
Am 02.02.2005 um 18:35 schrieb David Shaffer:
stéphane ducasse wrote:
Hi
I'm trying to understand how to use Yaxo and I cannot figure out what is the difference between the SAXDriver and SAXHandler. Of course there is no comment, no reference to the class SAXHandler.... Does anybody has an example?
Stef
PS: this is not a fatality, this is a state of mind!
Stef,
SAX is an event drive API for processing XML documents. While java-based it is relatively standard across languages. There are several Java resources but here's one which helped me:
Most implementations of SAX (including the one included with the "full" 3.7 image) are mostly "2.0" compliant which seems to me including XML namespaces (someone correct me if I'm wrong here) so the sample code on these pages which specifically deals with namespaces also transfers well to Smalltalk. As for Smalltalk examples, well, look at the subclasses of SAXHandler...one of these uses SAX to build the somewhat standard DOM tree. So, one has two choices when dealing with XML: event drive with SAX (usually, but not always, building the tree yourself) or DOM where the XML tree gets build from generic components (XMLElements).
For quick results I just use the XMLDOMParser. Open an explorer on this:
XMLDOMParser addressBookXMLWithDTD
Then you can traverse the resulting XMLDocument tree and extract whatever you need.
- Bert -
Hi,
Where does one download YAXO from.
The http://www.squeaklet.com/Yax/index.html URL referenced from SqueakMap does not respond ?
merci
Brent
Brent Pinkney wrote:
Hi,
Where does one download YAXO from.
The http://www.squeaklet.com/Yax/index.html URL referenced from SqueakMap does not respond ?
merci
Brent
I happened to have an old copy hanging around and used that. The URL for YAXO has been down for at least a week. I am attaching the version I have.
Brent Pinkney wrote:
Hi,
Where does one download YAXO from.
The http://www.squeaklet.com/Yax/index.html URL referenced from SqueakMap does not respond ?
It's now at http://kilana.unibe.ch:8888/XMLSupport/XML-Parser-mir.2.mcz
I need to update the SM entry, forgot my password and resetting doesn't work currently (probably a hickup in the new server con?)
TelnetProtocolError: 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)
Michael
Mike this is on my to do list to do a pass and try to add some comments to the classes. I will force me to understand SAX and the rest
Stef
On 8 févr. 05, at 8:17, Michael Rueger wrote:
Brent Pinkney wrote:
Hi, Where does one download YAXO from. The http://www.squeaklet.com/Yax/index.html URL referenced from SqueakMap does not respond ?
It's now at http://kilana.unibe.ch:8888/XMLSupport/XML-Parser-mir.2.mcz
I need to update the SM entry, forgot my password and resetting doesn't work currently (probably a hickup in the new server con?)
TelnetProtocolError: 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)
Michael
Hi!
Well the subject says all. It should work now.
regards, Göran
Thanks all
My point may have not be that clear> I had a vague knowledge about sax event and dom tree in memory. Then why I like Smalltalk is that with some comments and a bunch of examples I do not need a doc: I always remember the quote of Dan about the fact that one single person could learn it and this is the learning part that is important for me. I do not like comments or examples for the sake of them, I do because I want to let other learning.
So each time I learn something new I try yo write it as tests or as comments and yesterday my network connection was down so not browsing of internet resources the night.....only squeak classes without examples and comments.
Am 02.02.2005 um 18:35 schrieb David Shaffer:
stéphane ducasse wrote:
Hi
I'm trying to understand how to use Yaxo and I cannot figure out what is the difference between the SAXDriver and SAXHandler. Of course there is no comment, no reference to the class SAXHandler.... Does anybody has an example?
Stef
PS: this is not a fatality, this is a state of mind!
Stef,
SAX is an event drive API for processing XML documents. While java-based it is relatively standard across languages. There are several Java resources but here's one which helped me:
Most implementations of SAX (including the one included with the "full" 3.7 image) are mostly "2.0" compliant which seems to me including XML namespaces (someone correct me if I'm wrong here) so the sample code on these pages which specifically deals with namespaces also transfers well to Smalltalk. As for Smalltalk examples, well, look at the subclasses of SAXHandler...one of these uses SAX to build the somewhat standard DOM tree. So, one has two choices when dealing with XML: event drive with SAX (usually, but not always, building the tree yourself) or DOM where the XML tree gets build from generic components (XMLElements).
For quick results I just use the XMLDOMParser. Open an explorer on this:
XMLDOMParser addressBookXMLWithDTD
Then you can traverse the resulting XMLDocument tree and extract whatever you need.
- Bert -
stéphane ducasse wrote:
Thanks all
My point may have not be that clear> I had a vague knowledge about sax event and dom tree in memory. Then why I like Smalltalk is that with some comments and a bunch of examples I do not need a doc: I always remember the quote of Dan about the fact that one single person could learn it and this is the learning part that is important for me. I do not like comments or examples for the sake of them, I do because I want to let other learning.
So each time I learn something new I try yo write it as tests or as comments and yesterday my network connection was down so not browsing of internet resources the night.....only squeak classes without examples and comments.
Attached is another example for the XMLDOMParser.
tx may be this should be packaged with yaxo
On 3 févr. 05, at 15:36, Jason Rogers wrote:
stéphane ducasse wrote:
Thanks all
My point may have not be that clear> I had a vague knowledge about sax event and dom tree in memory. Then why I like Smalltalk is that with some comments and a bunch of examples I do not need a doc: I always remember the quote of Dan about the fact that one single person could learn it and this is the learning part that is important for me. I do not like comments or examples for the sake of them, I do because I want to let other learning.
So each time I learn something new I try yo write it as tests or as comments and yesterday my network connection was down so not browsing of internet resources the night.....only squeak classes without examples and comments.
Attached is another example for the XMLDOMParser.
-- Jason Rogers
"I am crucified with Christ: nevertheless I live; yet not I, but Christ liveth in me: and the life which I now live in the flesh I live by the faith of the Son of God, who loved me, and gave himself for me." Galatians 2:20
<YaxoExamples.1.cs.gz>
stéphane ducasse wrote:
tx may be this should be packaged with yaxo
Sure, but I don't know who the maintainer is. It would be nice to get some bigger examples as well and to integrate examples of the SAX usage.
squeak-dev@lists.squeakfoundation.org