This content has been marked as final. Show 14 replies
I hope I did not confuse you with my post. If you find it difficult to understand, I would gladly try to elaborate if any of you need it to help out.
Thank you in advance
Kim you can use xPath to do that. Let's say you have two XML variables XML1 and XML2 with the following content.
then you can use the following xPath to copy the value from one XML to the other:
/process_data/XML1/Data/Node1 = /process_data/XML2/Data/Node1/*
The /* is to copy the children node so you don't end up with Node1 under Node1.
Hi again Jasmin and thankyou for your help,
However what you suggest does not seem to work.
If I try to do as you suggest and if I assign a string variable to the value of /process_data/XML1/Data/Node 1 in the same "Set Value" task I get a null value when I check in a variablelogger.
I set the following under the set value:
However when the variable logger writes out the xml in XML1 it shows that there *is* data in the field.
I feel stupid as I do not get what I am doing wrong...
When you put /*, it copies all the child node underneath Node1 under XML1/Data/Node1. If you don't have child noded then you should just be able to do XML1/Data/Node1 = XML2/Data/Node1.
What I think is happening is because the /*, copies all nodes under XML2/Data/Node1 and the /process_data/XML2/Data/Node1 refers to a node and not a value.
If Node1 only contains a value a not child node the use XML1/Data/Node1 = XML2/Data/Node1 instead.
Let me know if I don't understand your structure right.
I'm going to let you and Jasmin continue forward with the SetValue approach, but I'm going to suggest a couple of other approaches.
1. Why not use the more complex XML in both cases. If you use an xml document in a form, it will simply ignore any fields that are not bound, so it doesn't really do any harm.
2. You could use an XSLT transformation to do the transform. One of the advantages of this is that there are several tools that will help you to write the transform. eg XMLSpy. The Adobe XSLT component will allow you to test your transform on sample data.
3. Avoka have a newly developed XQuery component (currently in beta). If you're interested in trying this, please email: firstname.lastname@example.org
Hi again Jasmin,
I can't get it right. No matter if I use the expression with the slash star (/*) or without I get no values in the xml-node. I will test it out some more and try some of Howards suggestions aswell.
If you have other ideas of achieving the wanted result you are welcome to elaborate.
Thanks in advance
Can you post the content of you two XML variables and I give it a try.
Hi Jasmin..just wanted to thank you.
I found this post and your advices really helped me :)
I have the same problem.
I work with xml schema. If I map field one by one I have no problem but it's very boring.
An example what my xml look like :
If I do this (I have two variables formInit and formStape2):
and the same for all my fields under New and the other nodes, it works but not very well to do.
If I do this :
All my fields stay empty
If I do this :
I have all my information (login and the other field ) in the first field under New IE login
If i do this :
All my fields stay empty
Can you help me ?
Thanks a lot :).
Are you using Livecycle Server Sp2? Or just the no-sp version?
Cause it changes how it implements xdatapath expressions...
If you tell me the version I can solve your problem
For now, I work on the evaluate version and I don't know if it's the sp2 version or not. I download and install the jboss turnkey version a few days ago, less than a week if it could help to know the version.
Ok...so it's not the sp version.
Ok..try it like this.
It should work.
Basically you set the father in the location and the branch you want to attach in the expression.
With sp2 it changes a little.
Hope it helps.
OK, It works fine.
Thank you very much for the help :)
You're welcome :)