From: Randy J. <rj...@ak...> - 2000-12-08 17:51:51
|
Hi, I'm using TclXML-1.2 to parse a XML file which among other things contains some C source code generated from a user interface specification tool. Character data in the C source code appears to have been properly processed so that C special characters do not collide with XML special characters (e.g. "&" is converted to "amp"). This XML file is parsed cleanly by TclXML _without_ the C code in it. With the C code in it, it can be parsed cleanly by XMLSpy editor. There is a TclXML "Highlight.tcl" example I pulled off the web, it has the same problem with the XML file in question that my script does. When my script parses the XML file, I keep getting the error indicated in the partial stack trace below. I've also included a fragment of the XML file below. I've attempted to modify the sgml.tcl Entity and parseEvent routines to work around this problem but without any success. Any suggestions are greatly appreciated! Thanks in Advance, Randy Jones Fragment of XML file where problem occurs. --------------- ... <handler_list> <hd type="0" req_param_mask="0x00000001" opt_param_mask="0x00000000" func="RCC_show_alarm_status"> extern RLSTATUS RCC_show_alarm_status(cli_env *pCliEnv, paramList *pParams, sbyte *pAuxBuf) { RLSTATUS status = OK; sbyte *pVal; paramDescr *pParamDescr; sbyte *pOutputBuf; Length outputLen; /* get required parameter */ status = RCC_DB_RetrieveParam(pParams, NULL, mShowAlarmStatus_NULL1, &pParamDescr ); the problem occurs when the parser processes the & field in the line above. if ( OK != status ) { ... A partial stack trace is; ------------- can't read "options(-statevariable)": no such variable while executing "upvar #0 $options(-statevariable) state" (procedure "Entity" line 3) invoked from within "Entity options {} ::::sgml::noop ::sgml::EntityPredef amp" (in namespace inscope "::sgml" script line 1) invoked from within "namespace inscope ::sgml {Entity options {} ::::sgml::noop ::sgml::EntityPredef} {amp} " ("uplevel" body line 12) invoked from within "uplevel #0 ::::sgml::noop {{ extern RLSTATUS RCC_show_alarm_status(cli_env *pCliEnv, paramList *pParams, sbyte *pAuxBuf) \\{ RLSTATUS status =..." ("eval" body line 1) invoked from within "eval $text" (procedure "::sgml::parseEvent" line 326) invoked from within "::sgml::parseEvent {?xml {} { version="1.0"?} { .....End of Partial Stack Trace. -------------------- |
From: Steve B. <Ste...@zv...> - 2000-12-08 22:43:07
|
Randy Jones wrote: > I'm using TclXML-1.2 to parse a XML file which among other things > contains some C source code generated from a user interface > specification tool. Character data in the C source code appears to > have been properly processed so that C special characters do not > collide with XML special characters (e.g. "&" is converted to "amp"). > This XML file is parsed cleanly by TclXML _without_ the C code in it. > With the C code in it, it can be parsed cleanly by XMLSpy editor. > There is a TclXML "Highlight.tcl" example I pulled off the web, it has > the same problem with the XML file in question that my script does. [...snip...] I'd suggest grabbing a copy of TclXML v2.0, preferably via NetCVS from the SourceForge repository. V2.0 has various fixes for handling entities (pre-defined and otherwise). It is not surprising that 'highlight.tcl' encounters the same problem, since it is using the same underlying parser. If you have further problems, then please let me know. Cheers, Steve Ball -- Steve Ball | waX Me Lyrical XML Editor | Training & Seminars Zveno Pty Ltd | Web Tcl Complete | XML XSL http://www.zveno.com/ | TclXML TclDOM | Tcl, Web Development Ste...@zv... +---------------------------+--------------------- Ph. +61 2 6242 4099 | Mobile (0413) 594 462 | Fax +61 2 6242 4099 |
From: Randy J. <rj...@ak...> - 2000-12-10 19:01:16
|
Hi Steve, Thanks for your prompt reply! I downloaded TclXML-2.0 and it worked much better for me (in this application) than did TclXML-1.2. There were still problems (different ones which may have been related to my script), but I was able to work around them by using the "continue" Callback Return Code to ignore the element which was giving me trouble. Thanks Again, Randy Jones > -----Original Message----- > From: Steve Ball [mailto:Ste...@zv...] > Sent: Friday, December 08, 2000 5:49 PM > To: rj...@ak... > Cc: tcl...@li... > Subject: Re: [Tclxml-users] Problem with CharacterData > > > Randy Jones wrote: > > I'm using TclXML-1.2 to parse a XML file which among other things > > contains some C source code generated from a user interface > > specification tool. Character data in the C source code appears to > > have been properly processed so that C special characters do not > > collide with XML special characters (e.g. "&" is converted > to "amp"). > > This XML file is parsed cleanly by TclXML _without_ the C > code in it. > > With the C code in it, it can be parsed cleanly by XMLSpy editor. > > There is a TclXML "Highlight.tcl" example I pulled off the > web, it has > > the same problem with the XML file in question that my script does. > [...snip...] > > I'd suggest grabbing a copy of TclXML v2.0, preferably via NetCVS > from the SourceForge repository. V2.0 has various fixes for handling > entities (pre-defined and otherwise). > > It is not surprising that 'highlight.tcl' encounters the same problem, > since it is using the same underlying parser. > > If you have further problems, then please let me know. > > Cheers, > Steve Ball > > -- > Steve Ball | waX Me Lyrical XML Editor | Training > & Seminars > Zveno Pty Ltd | Web Tcl Complete | XML XSL > http://www.zveno.com/ | TclXML TclDOM | Tcl, Web > Development > Ste...@zv... > +---------------------------+--------------------- > Ph. +61 2 6242 4099 | Mobile (0413) 594 462 | Fax +61 2 > 6242 4099 > _______________________________________________ > Tclxml-users mailing list > Tcl...@li... > http://lists.sourceforge.net/mailman/listinfo/tclxml-users > |