I would like to have some suggestion on how to transform a normal XML to PLMXML.
Since PLMXML uses references (cross reference xml) to its xml nodes its a bit tricky. I have following tools to use, preferable in the below order:
Is there a SDK or other APIs to use?
Any suggestion is appreciated.
I would like to have some suggestion on how to transform a normal SAP XML to PLMXML "scheduling". Since PLMXML uses references (cross reference xml) instead of grouping nodes together it's a bit tricky to get the attribute references correct.
On this URL you could see a sample of a PLMXML (not a scheduling, but it doesn't matter the principle is the same)
The example is the other way around, it creates a new formatX from PLMXML, which is easier. But how to create PLMXML from formatX (in my case an SAP XML which is a normal well formed xml)? The hard part is to get all attribute references corrct like, id, rootRefs, parentRef etc when creating the PLMXML.
Any suggestion is appreciated, like if there are any other APIs, SDKs (Siemens has one C++ SDK) to use. Out of the box I could use XSLT or C# for the transformation.
The end user will at first use Teamcenter import tool until we scheduling it.
Let me know if you need more info
NX 11.0.1.mp01 | SW 2016 | TcUA 11.2.3
I know litte bit about those tools / platforms. We have already an integration platform which we want to use to transform the data. To have other platforms to maintain, educate in etc is not our first choice and will probably cost quite much only for a transformation. The integration runs quite few times and is not critical so we want to use the integration platform as the first choice if possible.
So, is there a way to transform to PLMXML with normal standard interface, APIs, SDK or something else which makes it easier? If not, any suggestion where to look further? I guess we could write our own code to make it to work, but it is like re-invent something which should already be out there?
... should already be there ... funny. I'm not aware of any ITK/API's that perform this work for you. You have to remember that Teamcenter is proprietary and you are at the mercy of the vendor. The downloadable help documentation does include a tcrefs.jar and folders for: ITKFunction, services_reference, and TcServerInterfaces. The help docs also contain a DataModelReport.zip and Javadoc.zip. I do not see an XSD that explains the format for PLMXML.
However, if you export PLMXML and look at the header then you will see references like http://www.plmxml.org/Schemas/PLMXMLSchema
Navigating to that site could answer your questions ... or not, looks like a bunch of ads to me.
NX 11.0.1.mp01 | SW 2016 | TcUA 11.2.3
There is a PLMXML SDK available from SPLM but it needs a license, is not for C#, and does not help too much for your transformation.
You need a basic understanding of plmxml then you can read your xml with C# into DOM, do the transformation and write out a plmxml. I did something similiar with Java and read the xml with DOM into hashmaps of hashmaps to model the relation between e.g. ProductRevision, AssociatedDataset, Dataset, ExternalFile. If the xml contains a lot of information you may create separate classes for the major objects of your xml to store the information.
Thanks a lot!
Do you know if the order of the nodes in the PMLXML matters? Of course the PLMXML node and the header will be first. In my example plmxml i have a order like belov.
Is the below order possible since they are refering to each other anyway. What i want is to have i.e all ProductRevision after each other instead of spreading them around in the final PLMXML output.
If i could have the order above instead, it's eaiser to create an XSD. From that xsd i could generate classes which is serializable instead of using DOM. If that won´t work i could stick with DOM of course.
Is it possible for you to share little of the source code you made in Java, so i can get the idéa of using hashmap / Dictionary (similar C#). It will save some time of course. We could take it on email if you want.
Once again, thanks!
As the code was developed for a customer I am not allowed to publish it here but I try to give the idea.
First I read the xml into DOM then I developed a logic to put the nodes into a data structure according to their relation. To write the PLMXML I mapped the node types in Java. I am not that familiar with xslt but maybe the transformation can be done with xslt more effectively.
For some elements the order in PLMXML is important for others not, therefore, I cannot give a good answer to your question. If you already have a structure in Teamcenter export it and have a look at the PLMXML file. With a xml editor you can change the order import it back and get a better understanding of the PLMXML file.