Is there any documentation on how to use the XML parser? I want to
parse fairly simple strings, such as '<temperature name="Albuquerque, NM">95.7</temperature>' into DOM structures, and then step through it. I see Dolphin has an interface to Microsoft's IXMLHttpRequest COM component, but I have no idea of how to use it. Thanks, Brian |
Brian
You wrote in message news:[hidden email]... > Is there any documentation on how to use the XML parser? I want to > parse fairly simple strings, such as '<temperature name="Albuquerque, > NM">95.7</temperature>' into DOM structures, and then step through it. > > I see Dolphin has an interface to Microsoft's IXMLHttpRequest COM > component, but I have no idea of how to use it. That's probably not what you want (IXMLHttpRequest is to do with posting stuff to web servers, as mentioned in its class comment). Start with the 'XML DOM' package comment, and then go to http://msdn.microsoft.com/xml. and familiarize yourself with the XML DOM interfaces. doc := IXMLDOMDocument new. "Ctrl+E" doc loadText: '<?xml version="1.0"?><temperature name="Albuquerque, NM">95.7</temperature>'. "Ctrl+E" doc childNodes. "Ctrl+D" doc lastChild text. "Ctrl+D" doc lastChild attributes. "Ctrl+D" Regards Blair |
Thanks Blair, this put me on the right track. When playing with your
code at the first, I brought up inspectors on the DOM model (actually 'doc lastChild'). Sometimes Dolphin would freeze up. It finally dawned on me that 'doc' was a temporary variable in a method and was therefore getting garbage collected. So, even though I had an inspector open on a subnode, the document on the COM side had already been released--my inspector was pointing to vapor. Thanks again for the info, Brian. Blair McGlashan wrote: > > Brian > > You wrote in message news:[hidden email]... > > Is there any documentation on how to use the XML parser? I want to > > parse fairly simple strings, such as '<temperature name="Albuquerque, > > NM">95.7</temperature>' into DOM structures, and then step through it. > > > > I see Dolphin has an interface to Microsoft's IXMLHttpRequest COM > > component, but I have no idea of how to use it. > > That's probably not what you want (IXMLHttpRequest is to do with posting > stuff to web servers, as mentioned in its class comment). Start with the > 'XML DOM' package comment, and then go to http://msdn.microsoft.com/xml. > and familiarize yourself with the XML DOM interfaces. > > doc := IXMLDOMDocument new. "Ctrl+E" > doc loadText: '<?xml version="1.0"?><temperature name="Albuquerque, > NM">95.7</temperature>'. "Ctrl+E" > doc childNodes. "Ctrl+D" > doc lastChild text. "Ctrl+D" > doc lastChild attributes. "Ctrl+D" > > Regards > > Blair |
Hi Brian and Blair,
This message reminded me of a "freeze" when inspecting the IXMLDOM interfaces, which I tracked down to IXMLDOMNamedNodeMap>>printOn: method. When I added my own printOn: method to this class, which didnt send #value, the problem went away. Steve "Brian Murphy-Dye" <[hidden email]> wrote in message news:[hidden email]... > Thanks Blair, this put me on the right track. When playing with your > code at the first, I brought up inspectors on the DOM model (actually > 'doc lastChild'). Sometimes Dolphin would freeze up. It finally dawned > on me that 'doc' was a temporary variable in a method and was therefore > getting garbage collected. So, even though I had an inspector open on a > subnode, the document on the COM side had already been released--my > inspector was pointing to vapor. > > Thanks again for the info, Brian. > > Blair McGlashan wrote: > > > > Brian > > > > You wrote in message > > > Is there any documentation on how to use the XML parser? I want to > > > parse fairly simple strings, such as '<temperature name="Albuquerque, > > > NM">95.7</temperature>' into DOM structures, and then step through it. > > > > > > I see Dolphin has an interface to Microsoft's IXMLHttpRequest COM > > > component, but I have no idea of how to use it. > > > > That's probably not what you want (IXMLHttpRequest is to do with posting > > stuff to web servers, as mentioned in its class comment). Start with the > > 'XML DOM' package comment, and then go to > > and familiarize yourself with the XML DOM interfaces. > > > > doc := IXMLDOMDocument new. "Ctrl+E" > > doc loadText: '<?xml version="1.0"?><temperature name="Albuquerque, > > NM">95.7</temperature>'. "Ctrl+E" > > doc childNodes. "Ctrl+D" > > doc lastChild text. "Ctrl+D" > > doc lastChild attributes. "Ctrl+D" > > > > Regards > > > > Blair |
Free forum by Nabble | Edit this page |