Ok, TA-Lib indeed uses a different formula:

DX = 100*abs(+DI - -DI)/(+DI + -DI)

With this formula it's not possible to determine which crosses which. You're encouraged to write your own version of the +DI and -DI indicators if you need them. If you encounter any problems, post in the script forum and I'll help.