From: James C. M. <jm...@qn...> - 2001-05-03 22:21:35
|
I'm pretty sure you are not allowed to use semicolons. My xml is a little rusty, though. > I'm by no means an XML expert, so this may be a stupid > question, but I was wondering why the TclXML parser > chokes on something like this: > > <foo bar='Black & White'/> > > The & is giving ParseCommand fits. If I take out > the & then things work fine. > > The trace I'm getting looks like this: > > {invalid attribute list} around line 0 > while executing > "::sgml::Error {invalid attribute list} around line 0" > ("uplevel" body line 1) > invoked from within > "uplevel #0 $options(-errorcommand) [list $attr around line $state(line)]" > (procedure "ParseEvent:ElementOpen" line 21) > invoked from within > "ParseEvent:ElementOpen $tag $param options -empty 1" > ("*,0,,/" arm line 5) > invoked from within > "switch -glob -- [string length $tag],[regexp {^\?|!.*} $tag],$close,$empty > { > > 0,0,, { > # Ignore empty tag - dealt with non-normal mode above > ..." > (procedure "::sgml::parseEvent" line 118) > > > > Possibly relevant version numbers from xml.tcl: > > package provide xml 1.9 > > package require sgml 1.7 > > > > Todd. > ---- > Todd Bradley - Director, Support Services - Jabber.com > tbr...@ja... - 303-308-3666 > > See you at JabberCon August 20 and 21 - www.jabbercon.com > > _______________________________________________ > Tclxml-users mailing list > Tcl...@li... > http://lists.sourceforge.net/lists/listinfo/tclxml-users > > -- James C. Moore, Ph.D. |
From: Todd B. <TBr...@ja...> - 2001-05-03 22:31:26
|
The semicolon is necessary. "&" is what's called a "predefined entity" and is the XML of representing the "&" character. The other four predefined entities are: < which means < > which means > ' which means ' " which means " So, I THINK this is valid XML, but TclXML doesn't like it at all! Todd. > -----Original Message----- > From: James C. Moore [mailto:jm...@qn...] > Sent: Thursday, May 03, 2001 4:17 PM > To: Todd Bradley; 'tcl...@li...' > Subject: Re: [Tclxml-users] why won't TclXML parse this? > > > I'm pretty sure you are not allowed to use semicolons. My > xml is a little > rusty, though. > > > I'm by no means an XML expert, so this may be a stupid > > question, but I was wondering why the TclXML parser > > chokes on something like this: > > > > <foo bar='Black & White'/> > > > > The & is giving ParseCommand fits. If I take out > > the & then things work fine. > > > > The trace I'm getting looks like this: > > > > {invalid attribute list} around line 0 > > while executing > > "::sgml::Error {invalid attribute list} around line 0" > > ("uplevel" body line 1) > > invoked from within > > "uplevel #0 $options(-errorcommand) [list $attr around line > $state(line)]" > > (procedure "ParseEvent:ElementOpen" line 21) > > invoked from within > > "ParseEvent:ElementOpen $tag $param options -empty 1" > > ("*,0,,/" arm line 5) > > invoked from within > > "switch -glob -- [string length $tag],[regexp {^\?|!.*} > $tag],$close,$empty > > { > > > > 0,0,, { > > # Ignore empty tag - dealt with non-normal > mode above > > ..." > > (procedure "::sgml::parseEvent" line 118) > > > > > > > > Possibly relevant version numbers from xml.tcl: > > > > package provide xml 1.9 > > > > package require sgml 1.7 > > > > > > > > Todd. > > ---- > > Todd Bradley - Director, Support Services - Jabber.com > > tbr...@ja... - 303-308-3666 > > > > See you at JabberCon August 20 and 21 - www.jabbercon.com > > > > _______________________________________________ > > Tclxml-users mailing list > > Tcl...@li... > > http://lists.sourceforge.net/lists/listinfo/tclxml-users > > > > > > -- > James C. Moore, Ph.D. > > |
From: Peter F. <pet...@zv...> - 2001-05-04 15:26:04
|
Tom, Your correct that it is valid XML . Entities are allowed in attributes, though I'd personally steer clear of them. One of the reasons I do (apart from never having needed to use them ) is that TclXML doesnt support them yet 8-). Its not a bug, its a _missing_ feature .... At the moment I dont know when it will added. It depends on how much demand for it there is and how much time we can make to work on it. Some paying clients have our almost undivided attention at the moment 8-). And the tclxml list has been awfully quite , it seems there's not much interest . It would be nice to know if anyone's using it seriously - it cant be that good that no-one finds fault or lack with it 8-). Peter Todd Bradley wrote > > The semicolon is necessary. "&" is what's called > a "predefined entity" and is the XML of representing > the "&" character. The other four predefined entities > are: > > < which means < > > which means > > ' which means ' > " which means " > > So, I THINK this is valid XML, but TclXML doesn't like > it at all! > > Todd. > > > -----Original Message----- > > From: James C. Moore [mailto:jm...@qn...] > > Sent: Thursday, May 03, 2001 4:17 PM > > To: Todd Bradley; 'tcl...@li...' > > Subject: Re: [Tclxml-users] why won't TclXML parse this? > > > > > > I'm pretty sure you are not allowed to use semicolons. My > > xml is a little > > rusty, though. > > > > > I'm by no means an XML expert, so this may be a stupid > > > question, but I was wondering why the TclXML parser > > > chokes on something like this: > > > > > > <foo bar='Black & White'/> > > > > > > The & is giving ParseCommand fits. If I take out > > > the & then things work fine. > > > > > > The trace I'm getting looks like this: > > > > > > {invalid attribute list} around line 0 > > > while executing > > > "::sgml::Error {invalid attribute list} around line 0" > > > ("uplevel" body line 1) > > > invoked from within > > > "uplevel #0 $options(-errorcommand) [list $attr around line > > $state(line)]" > > > (procedure "ParseEvent:ElementOpen" line 21) > > > invoked from within > > > "ParseEvent:ElementOpen $tag $param options -empty 1" > > > ("*,0,,/" arm line 5) > > > invoked from within > > > "switch -glob -- [string length $tag],[regexp {^\?|!.*} > > $tag],$close,$empty > > > { > > > > > > 0,0,, { > > > # Ignore empty tag - dealt with non-normal > > mode above > > > ..." > > > (procedure "::sgml::parseEvent" line 118) > > > > > > > > > > > > Possibly relevant version numbers from xml.tcl: > > > > > > package provide xml 1.9 > > > > > > package require sgml 1.7 > > > > > > > > > -- Peter Farmer | Custom XML software | Internet Engineering Zveno Pty Ltd | Website XML Solutions | Training & Seminars http://www.zveno.com/ | Open Source Tools | - XML XSL Tcl Pet...@zv... +------------------------+--------------------- Ph. +61 8 92434146 | Mobile +61 417 906 851 | Fax +61 2 6242 4099 |
From: Todd B. <TBr...@ja...> - 2001-05-04 19:44:11
|
Peter Farmer wrote: > Your correct that it is valid XML . Entities are allowed in > attributes, > though I'd personally steer clear of them. Unfortunately, I have no control over that, as I'll explain below. > One of the reasons I do (apart from never having needed to use them ) > is that TclXML doesnt support them yet 8-). Its not a bug, its a > _missing_ feature .... At the moment I dont know when it > will added. It > depends on how much demand for it there is and how much time > we can make > to work on it. Some paying clients have our almost undivided attention > at the moment 8-). Fair enough, I suppose. > And the tclxml list has been awfully quite , it seems there's not much > interest . It would be nice to know if anyone's using it > seriously - it > cant be that good that no-one finds fault or lack with it 8-). I'm using it fairly seriously. Here's what I do with TclXML. First, some background. In case you have never heard of it, there's an open source instant messaging system called Jabber (www.jabber.org). The Jabber movement has been gaining a great deal of momentum over the past few months and there are now some- thing like 50,000 independent Jabber servers around the world. I work at Jabber.com, which exists to provide commercial software and services to add to the Jabber network. Other than the facts that Jabber is open source, is instant messaging independent of Microsoft, Yahoo!, and AOL, the coolest thing about Jabber is that the protocol is all XML. Before I got involved in Jabber, someone wrote a Tcl/Tk Jabber client called zABBER, which I have since taken over maintenance of (what little maintenance there is--the client is best described as "alpha" quality and hardly anybody uses it, so I haven't been adding new features or fixing bugs). Recently, though, I have written several utilities in Tcl (using Expect) to act as specialized Jabber client programs and server side components. Two of the most used Tcl programs I've written are called "Jabberbot" and "updateagent". The first is a chat bot for use at Jabber.com's public Jabber server. It receives and automat- ically responds to instant messages from users, including handling some very basic tech support issues on its very own! The second is a service that also runs on Jabber.com's public Jabber server and tells Jabber clients when there is a new version of themselves available for download. Both of these programs are Expect scripts and both use TclXML to parse the XML data stream coming from Jabber clients and server compon- ents. The Jabber protocol says that each user in the Jabber network will have a unique Jabber ID. This ID looks a lot like an email address. For instance, my Jabber ID right now is: "tbr...@ja.../WorkJIM" As with email, the tbr...@ja... means that my username is tbradley and I use the jabber.com Jabber server. The stuff after the slash ("/WorkJIM") is called a "resource" and is user configurable to give a unique description of where you're connecting from. So, unlike ICQ and other IM systems, you can actually be connected to the Jabber network multiple times. For instance, I might be con- nected on my work PC and on my cell phone and on my home PC all at the same time. So, I might be simultaneously using JIDs of: "tbr...@ja.../Work PC" "tbr...@ja.../Nokia 5900" "tbr...@ja.../Home PC" So, given this Resource field to play with, some users inevitably decide to put funky things like ampersands in there, such as "bu...@ja.../Black & White" The ampersand gets converted to "&" in the XML data stream, and then that has to be parsed correctly by the client program on the receiving end. See here for more: http://docs.jabber.org/jpg/html/main.html#CH-ENTITY-TIER-RESOURCE Right now, any user who tries to get update information from our Jabber server or who tries to chat with Jabberbot and has a re- source with an ampersand generates XML which cannot be parsed by the TclXML parser. I've gotten around the problem by just ignoring those users for now, which isn't very polite, but at least my Expect script doesn't crash. I could do something hokey like scan the XML for something that looks like a resource, chop it off, pass the XML to the parser, and then re-insert the resource afterwards. But I'm sure you'll agree that isn't a very elegant solution. So, there you go. That's what I use TclXML for. Todd. |
From: Peter F. <pet...@zv...> - 2001-05-05 15:13:15
|
Todd, I have tried to write this three time and lost it when almost finished, when Netscrape crashed. urk. So my tries at reply have been getting briefer .. > > > One of the reasons I do (apart from never having needed to use them ) > > is that TclXML doesnt support them yet 8-). Its not a bug, its a > > _missing_ feature .... At the moment I dont know when it > > will added. It > > depends on how much demand for it there is and how much time > > we can make > > to work on it. Some paying clients have our almost undivided attention > > at the moment 8-). > > Fair enough, I suppose. No, its not really. Its not good having to admit that a basic compliance feature is missing . But we seem to be short handed at the moment. .. Todd's nicely done briefing on Jabber and its workings omitted here ... > > So, given this Resource field to play with, > some users inevitably decide to put funky > things like ampersands in there, such as > > "bu...@ja.../Black & White" > doh! users! $@&%$!#@! > The ampersand gets converted to "&" in > the XML data stream, and then that has to > be parsed correctly by the client program > on the receiving end. > > See here for more: > http://docs.jabber.org/jpg/html/main.html#CH-ENTITY-TIER-RESOURCE > > Right now, any user who tries to get update > information from our Jabber server or who > tries to chat with Jabberbot and has a re- > source with an ampersand generates XML which > cannot be parsed by the TclXML parser. > > I've gotten around the problem by just ignoring > those users for now, which isn't very polite, > but at least my Expect script doesn't crash. > I could do something hokey like scan the XML > for something that looks like a resource, chop > it off, pass the XML to the parser, and then > re-insert the resource afterwards. But I'm > sure you'll agree that isn't a very elegant > solution. > agreed ;-) > So, there you go. That's what I use TclXML > for. > > Todd. Thanks for the feedback Todd. Jabber is cool, and for some of our favourite reasons (OS, XML, TCL). I hope we'll be able to get this fixed for you as soon as we can. Its interesting how Tcl does seem to have found a real niche in the IRC/Chat/Instant Messaging world. -- Peter Farmer | Custom XML software | Internet Engineering Zveno Pty Ltd | Website XML Solutions | Training & Seminars http://www.zveno.com/ | Open Source Tools | - XML XSL Tcl Pet...@zv... +------------------------+--------------------- Ph. +61 8 92434146 | Mobile +61 417 906 851 | Fax +61 2 6242 4099 |
From: Mats B. <ma...@pr...> - 2001-05-05 06:47:00
|
Peter Farmer wrote > And the tclxml list has been awfully quite , it seems there's not much > interest . It would be nice to know if anyone's using it seriously - it > cant be that good that no-one finds fault or lack with it 8-). Just to tell you that there is interest in TclXML. Using it to learn my whiteboard ("http://hem.fyristorg.com/matben") to talk XML to the jabber IM server system (jabber.org). So, keep up the good work! The sad(?) thing is that if things are working well, you never hear from anyone; it's first when there are problems people take contact. This thread is an example of that. Mats Bengtsson |
From: Peter F. <pet...@zv...> - 2001-05-05 15:44:46
|
Mats Bengtsson wrote: > > Peter Farmer wrote > > And the tclxml list has been awfully quite , it seems there's not much > > interest . It would be nice to know if anyone's using it seriously - it > > cant be that good that no-one finds fault or lack with it 8-). > > Just to tell you that there is interest in TclXML. Using it to learn > my whiteboard ("http://hem.fyristorg.com/matben") to talk XML to the > jabber IM server system (jabber.org). So, keep up the good work! Thanks. We will try to 8-) Jabber again. I'm amazed how keen are to talk to each other 8-). I must say I'm looking forward to realtime s/w dvelopment collaboration on SF projects with jabber whiteboards and the like 8-) > The sad(?) thing is that if things are working well, you never hear > from anyone; it's first when there are problems people take contact. > This thread is an example of that. > Well I know a few things that need work. And I guess I've got enough w/o asking for more 8-) -- Peter Farmer | Custom XML software | Internet Engineering Zveno Pty Ltd | Website XML Solutions | Training & Seminars http://www.zveno.com/ | Open Source Tools | - XML XSL Tcl Pet...@zv... +------------------------+--------------------- Ph. +61 8 92434146 | Mobile +61 417 906 851 | Fax +61 2 6242 4099 |