View Single Post
Join Date: Dec 2008
Posts: 2
Reputation: vbhatia.81 is an unknown quantity at this point 
Solved Threads: 0
vbhatia.81 vbhatia.81 is offline Offline
Newbie Poster

Re: PLMXML to generic xml

 
0
  #3
Dec 5th, 2008
Following is my new xsl and it am able to create the tags but i am not able to write the value of the newly created attributes.......

XML, XSLT and XPATH Syntax (Toggle Plain Text)
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:plm="http://www.plmxml.org/Schemas/PLMXMLSchema" exclude-result-prefixes="plm"
  4. >
  5. <xsl:output method="xml" indent="yes"/>
  6. <xsl:template match="/">
  7. <xsl:if test="/plm:PLMXML">
  8. <xsl:call-template name="PLMXML"/>
  9. </xsl:if>
  10. </xsl:template>
  11. <xsl:template name="PLMXML">
  12. <xsl:element name="GXML">
  13. <xsl:if test="/plm:PLMXML/plm:Product">
  14. <xsl:call-template name="Product">
  15. </xsl:call-template>
  16. </xsl:if>
  17. </xsl:element>
  18. </xsl:template>
  19.  
  20. <!--Start Of the Product Template-->
  21. <xsl:template name="Product">
  22. <xsl:param name="id"/>
  23. <xsl:element name="Item">
  24. <xsl:attribute name="id">
  25. <xsl:value-of select="./@productId"/>
  26. </xsl:attribute>
  27.  
  28. <xsl:for-each select="/plm:PLMXML/plm:ProductRevision">
  29. <xsl:call-template name="ProductRevision"/>
  30. </xsl:for-each>
  31. </xsl:element>
  32. </xsl:template>
  33.  
  34. <!--Start of the Product Revision Template-->
  35. <xsl:template name="ProductRevision">
  36. <xsl:element name="ItemRevision"></xsl:element>
  37. </xsl:template>
  38. </xsl:stylesheet>


If you will see in the Product Template I am not able to get the value of the attribute "id"
Reply With Quote