Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 1 Jahr, 11 Monaten
Letzter Beitrag:
vor 1 Jahr, 10 Monaten
Beteiligte Autoren:

WD21 xml ( audit file Holland )

Startbeitrag von Allard am 13.08.2016 13:28


In version 20 I made an export for this file . For the one s that do not know what I mean . An audit file is an xml file that contains almoast everthing of the applicaion.

Now I want to make an import of this file in version 21. Al went great till the point where I get a bit stuck this is inthe transacions section

the nodes are as follows


So I need All the trLine ( transactionlines )

This is what I did and for the journal and the transaction this works . Not for the lines:

auditImport is xmlDocument
auditImport = XMLOpen(gsbestadPadnaam)

//gsbestadPadnaam = the path to the xml

IF bTransactiesimport = True THEN

j is int = 0
t is int = 0
l is int = 0
journal is an xmlNode = auditImport.auditfile.company.transactions.journal
transaction is an xmlNode = auditImport.auditfile.company.transactions.journal.transaction
transactionline is an xmlNode = auditImport.auditfile.company.transactions.journal.transaction.trLine
FOR EACH journal OF auditImport.auditfile.company.transactions on journal
FOR EACH transaction OF journal on transaction
FOR EACH transactionline OF transaction on transactionline
Trace(t+ " "+ auditImport.auditfile.company.transactions.journal[j].transaction[t].trLine[l].amnt)

Trace(t+ " "+ auditImport.auditfile.company.transactions.journal[t].jrnTp)



Anyone an I dea whe the fault generated is : transactionline is not an xml node ?



Hi did some investigation and there is a function that seems to be doing what I need

journal is xpathResult = XMLExecuteXPath("/ root")

-------------------------------------------------------------new info ---------------

Ok I did some investigation and itseems that xpath querie is a standard in xml . Yes indeed pcsoft is following standards!!

This works

c = XMLExecuteXPath(auditImport, "/auditfile/company/transactions/journal/transaction/trLine")

if gives the node of trline

/ auditfile
gives the root
transactions without / gives all the transactions in the xml

On w3 school on the net there is a whole exlination on syntax of this xpathquery.

In the pcsoft documentaion I read the result can be analysed by the xml seek functions so have to look into that.

looping works with this syntax:

z is int = 0
FOR EACH node OF c..Node
Trace ( c.Node[z]..NoeudFils[2])


I need to do some conditional stuff on this and that is quite a challange

I can get all the amounts of all transactions ( with the loop above

But I need onely the ones of the trline that have a amounttype of debet. ??

Anyone using this xml stuff?


von Allard - am 14.08.2016 11:06

I havenot had mutch response on this but I have found out how it works. A view weeks ago but you still might like to know the xml stuff works.

ok here is how you can loop through:

FOR EACH journalnode OF transnode on journal

journalnode ==> an xml node
transnode ==> an xml node

And whats this ====> journal is not declared at all! Yep windev knows what it is.

journal is in the path the next node.
( auditImport.auditfile.company.transactions.journal )

This is important because if you donnot specify this then it runs into errors.

So use this syntax and you have control over everything. Donnot try to use the xpath stuff for it gives you a position of a node not the note by name.

Hope this is clear to you all. windev is great on big xml stuff . Import export It just works great. ( The documentation is not that mutch but It was enough for me to figger out this syntax )



This xml stuff is great . I think I will change my backup system form native windev back up to xml as well . It is verry fast and can contain everything . Cool yeh windev rocks !!

von Allard - am 25.08.2016 21:12
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.