View Single Post
Join Date: Oct 2008
Posts: 20
Reputation: mlohokare is an unknown quantity at this point 
Solved Threads: 0
mlohokare mlohokare is offline Offline
Newbie Poster

Re: PLMXML to generic xml

 
0
  #2
Dec 4th, 2008
Hi,

I am having 1 solution for you pls check if that work for you.

Rewriting ur xml as below

<PLMXML date="2008-12-02" time="15:33:22" author="Teamcenter V2007.1.3.20080417.00 - PLM@TCLICSRV(498908465)">
<Product id="id2" name="Test" accessRefs="#id3" subType="Item" productId="000019">TEST</Product>
</PLMXML>

Rewriting your xslt as below;
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:strip-space elements="*" />


<xsl:template match="/">
	<xsl:apply-templates />
</xsl:template>

<xsl:template match="//PLMXML">
<GXML>
	<xsl:apply-templates />
</GXML>
</xsl:template>

<xsl:template match="Product">
<Item>
 <xsl:apply-templates />
</Item>
</xsl:template>
</xsl:stylesheet>

Output I get as below;

<?xml version="1.0" encoding="UTF-8"?>
<GXML>
<Item>TEST</Item>
</GXML>

*********
In above example if you want to display the values of <Product> element as text you can use <xsl:value-of select="@" />. Please check
*********

I think your assumption for namespace is correct but that can be changed in xml as well as xslt.
*********

Cheers,
Mahesh
Reply With Quote