Cancel
Showing results for 
Search instead for 
Did you mean: 

Ignoring locationRef during PLMXML Import

Valued Contributor
Valued Contributor

I am investigating the use of PLMXML for system consolidation. The target system has a number of templates including the templates deployed on the source system. The volume files need to remain in thier current location due to export control restrictions. The volume data will be accessed using a new Teamcenter volume which will point to the existing folder location.

 

Is it possible to import the ImanFile/ExternalFile plus the file_name, original_file_name, sd_path_name and volume_tag values while ignoring the locationRef?

 

Source: 9.1

Target: 11.4

4 REPLIES 4

Re: Ignoring locationRef during PLMXML Import

@roq4 I haven't tried what you need to do but I have successfully transformed PLMXML files to remove the LocationRefs and then imported the PLMXML files into another database.

Re: Ignoring locationRef during PLMXML Import

Valued Contributor
Valued Contributor

@CraigPoulson would you please, if you are able to, share a sample of the plmxml file / transform that successfully imported to TC without the locationRef? When I manually remove the attribute, or set it to blank, it cannot be imported as I assume I have violated the schema (ERROR 203355 Invalid xml element.)

Re: Ignoring locationRef during PLMXML Import

@roq4 the following should remove both the ApplicationRef nodes and the accessRefs attributes.

 

 

Put the following in a file named PLMXMLRemoveAccessAndApplicationRef.xsl

 

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:PLMXML="http://www.plmxml.org/Schemas/PLMXMLSchema" >
<!--empty template suppresses this attribute-->
<xsl:output method="xml" indent="yes"/>
<xsl:strip-space elements="*" />
<xsl:template match="@accessRefs" />
<xsl:template match="PLMXML:ApplicationRef" />
<!--identity template copies everything forward by default-->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>

 

 

 

And run something like:


java -classpath C:\Siemens\TCRoot\portal\plugins\org.apache.fop\xalan-2.7.2.jar";"C:\Siemens\TCRoot\portal\plugins\org.apache.fop\serializer-2.7.2.jar";"C:\Siemens\TCRoot\portal\plugins\org.apache.fop\xml-apis-1.3.04.jar";"C:\Siemens\TCRoot\portal\plugins\org.apache.fop\xercesImpl-2.9.1.jar org.apache.xalan.xslt.Process -IN foo.xml -XSL PLMXMLRemoveAccessAndApplicationRef.xsl -OUT foo.out

 

 

Re: Ignoring locationRef during PLMXML Import

Valued Contributor
Valued Contributor

@CraigPoulson thanks for the reply, we ended up going down the low level TCXML route which has worked well.