tdom overwrites error messages 
Author Message
 tdom overwrites error messages

Hi,

Why does the tdom package overwrite error messages?

     % A.B
     invalid command name "A.B"
     % puts $errorInfo
     invalid command name "A.B"
         while executing
     "A.B"
     % package require tdom
     0.5
     % A.B
     invalid command name "A"
     % puts $errorInfo
     invalid command name "A"
         while executing
     "unknown_tdom A B"
         invoked from within
     "A B"
         invoked from within
     "A.B"
     %

It can be rather confusing at times when the real error message is
messed up.

Christian



Sat, 31 Jul 2004 16:04:15 GMT  
 tdom overwrites error messages
Hello,

Quote:

> Why does the tdom package overwrite error messages?
>      % A.B
>      invalid command name "A.B"
>      % package require tdom
>      0.5
>      % A.B
>      invalid command name "A"

And this is even harmless. Look at this:
  $ wish8.4
  % package require tdom
  ==> 0.5
  % unknown.command
  ==> invalid command name "command"
  % destroy .
  % UpdateStringProc should not be invoked for type cmdName
  Killed

I once exchanged some emails about this with Jochen Loewer,
and he replied, that this was an effort to implement old style
XPointer expressions (where method names are assembled with dots).

And he noticed also, that you can switch off this "feature" by
using the define TDOM_NO_UNKNOWN_CMD. So currently I'm always
using the following Bourne shell command before compiling tDOM:
  CC="cc -DTDOM_NO_UNKNOWN_CMD"; export CC

I hope this will help,
Krischan
--
Christian Krone



Sat, 31 Jul 2004 17:22:41 GMT  
 tdom overwrites error messages

Quote:
> Hello,


> > Why does the tdom package overwrite error messages?
> >      % A.B
> >      invalid command name "A.B"
> >      % package require tdom
> >      0.5
> >      % A.B
> >      invalid command name "A"
> I once exchanged some emails about this with Jochen Loewer,
> and he replied, that this was an effort to implement old style
> XPointer expressions (where method names are assembled with dots).

> And he noticed also, that you can switch off this "feature" by
> using the define TDOM_NO_UNKNOWN_CMD. So currently I'm always
> using the following Bourne shell command before compiling tDOM:
>   CC="cc -DTDOM_NO_UNKNOWN_CMD"; export CC

Christian is absolutely correct. tDOM uses Tcl's 'meta-language-
capabilites' to allow standard IDL/DOM/Java/XPointer syntax
using an overwritten 'unknown'-command. With that you could
write:

    puts [$root.descendant(1,DIVISION).asXML]
    puts [$root.descendant(1,DIVISION).firstChild]  

    foreach division [$root.desc(all,DIVISION)] {
       puts [$division.child(1,DIVISION_NAME).text]
    }

  set a [[[$root firstChild] firstChild] nodeName]  
 vs.
  set a [$root.firstChild.firstChild.nodeName]

The original unknown command is being renamed to 'unknown_tdom'.
Hence you'll get the expection+traceback from it, invoked
from the new unknown. This leads to this one additionaly
layer in the traceback.

BTW those old XPointer function had been in tDOM since
the first (internal) release and allow greater expresiveness
than the plain DOM method.  For sure now they could
be rewritten into XPath, but still they are much faster, since
they represent rather simple operations and don't need
XPath parser step:

    $root.descendant(1,DIVISION).firstChild]  
   -->
     $root selectNods .//DIVISION\[1\]/*

    foreach division [$root.desc(all,DIVISION)] {
       puts [$division.child(1,DIVISION_NAME).text]
    }
  -->
    foreach division [$root selectNods .//DIVISION] {
        puts [$division selectNodes string(DIVISION_NAME\[1\])
    }

Quote:
>   % unknown.command
>   ==> invalid command name "command"
>   % destroy .
>   % UpdateStringProc should not be invoked for type cmdName
>   Killed  

Huh, that's ugly and shouldn't occur.Probably we should
think about making TDOM_NO_UNKNOWN_CMD as default.

--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG



Sat, 31 Jul 2004 20:16:55 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Serial Error 0x4002 (Error 16386, character was lost by overwrite / serial port overrun error)

2. threaded tcl with tdom error

3. TclPro prodebug "overwriting procs" error

4. ERROR MESSAGE: Internal Error: tpsbt.cpp line 2172

5. Network error Message Error 50

6. Error message dbcommital internal error 19

7. Error message Ordlistadd (0) Internal error 1010

8. Error message Internal error 1010

9. spelling error in [scan] error message :)

10. Stubs problem with Tdom and MinGW

11. tDOM or XLST

12. tdom/xpath case insensitive search

 

 
Powered by phpBB® Forum Software