Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7742273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:14:05+00:00 2026-06-01T09:14:05+00:00

I have a following code , I want to display all the attributes of

  • 0

I have a following code , I want to display all the attributes of first UserData element of each Occurence corresponding to occurenceRefs ? Actually i want to display this in the HTML format and i am not able to loop through the attributes and display them individually
Thanks in advance …..

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" ?>
<!-- GENERATED BY: PLM XML SDK 7.0.2.173 -->
<PLMXML xmlns="http://www.plmxml.org/Schemas/PLMXMLSchema"
 schemaVersion="6" language="en-us" date="2012-03-23" languages="en-us" time="07:54:04" >
<Header id="id1" traverseRootRefs="#id7" transferContext="CRF_ITM_RPT_TMODE_INST"></Header>
<RevisionRule id="id2" name="Latest Working">
<Description>Latest Working else Latest Any Status</Description>
<ApplicationRef version="QQO9hJBI40bQ2C" application="Teamcenter" label="QQO9hJBI40bQ2C"></ApplicationRef></RevisionRule>
<ProductView id="id4" ruleRefs="#id2" rootRefs="id7" primaryOccurrenceRef="id7">
<ApplicationRef application="Teamcenter" label="BgE9Vysa40bQ2C/QQO9hJBI40bQ2C/AAAAAAAAAAAAAA/BOM"></ApplicationRef>
<UserData id="id3" type="TC Specific Properties">
<UserValue value="imprecise" title="BOM_precision_type"></UserValue></UserData>
<Occurrence id="id7" occurrenceRefs="id11 id15 ">
<ApplicationRef application="Teamcenter" label="BgE9Vysa40bQ2C/"></ApplicationRef>
<UserData id="id6">
<UserValue value="" title="rox9DesignItemID"></UserValue>
<UserValue value="" title="rox9CommrclDesignItemID"></UserValue>
<UserValue value="" title="rox9DesignRevision"></UserValue>
<UserValue value="" title="rox9CommrclDesignRevision"></UserValue></UserData>
<UserData id="id8" type="AttributesInContext">
<UserValue value="" title="AO_ID"></UserValue>
<UserValue value="" title="SequenceNumber"></UserValue>
<UserValue value="" title="OccurrenceName"></UserValue>
<UserValue value="" title="Quantity"></UserValue></UserData>
<Transform id="id5">1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1</Transform></Occurrence>
<Occurrence id="id11" parentRef="#id7">
<ApplicationRef application="Teamcenter" label="BgE9Vysa40bQ2C/BsC9Vysa40bQ2C/"></ApplicationRef>
<UserData id="id10">
<UserValue value="" title="rox9DesignItemID"></UserValue>
<UserValue value="ROXD00216480" title="rox9CommrclDesignItemID"></UserValue>
<UserValue value="" title="rox9DesignRevision"></UserValue>
<UserValue value="A" title="rox9CommrclDesignRevision"></UserValue></UserData>
<UserData id="id12" type="AttributesInContext">
<UserValue value="" title="AO_ID"></UserValue>
<UserValue value="10" title="SequenceNumber"></UserValue>
<UserValue value="" title="OccurrenceName"></UserValue>
<UserValue value="" title="Quantity"></UserValue></UserData>
<Transform id="id9">1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1</Transform></Occurrence>
<Occurrence id="id15" parentRef="#id7">
<ApplicationRef application="Teamcenter" label="BgE9Vysa40bQ2C/BsG9Vysa40bQ2C/"></ApplicationRef>
<UserData id="id14">
<UserValue value="ROXD00315587" title="rox9DesignItemID"></UserValue>
<UserValue value="" title="rox9CommrclDesignItemID"></UserValue>
<UserValue value="C" title="rox9DesignRevision"></UserValue>
<UserValue value="" title="rox9CommrclDesignRevision"></UserValue></UserData>
<UserData id="id16" type="AttributesInContext">
<UserValue value="" title="AO_ID"></UserValue>
<UserValue value="20" title="SequenceNumber"></UserValue>
<UserValue value="" title="OccurrenceName"></UserValue>
<UserValue value="" title="Quantity"></UserValue></UserData>
<Transform id="id13">1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1</Transform></Occurrence>

I have understood a lot and able to fetch and display them but i want to them to display as written below , So the problem is i dont know how to loop over them individually or we may have to use templates and call them repetitively …….
Any help is appreciated.Please refer to code above

Thanks in advance
The required output is:

rox9DesignItemID  rox9CommrclDesignItemID  rox9DesignRevision  rox9CommrclDesignRevision


                ROXD00216480                                        A 


 ROXD00315587                                 C

This below is the code for the above XML file . I am almost done with it , I am getting the occurenceRefs in a sequence in occid in the creCLext template and i have verified it by displaying it . The problem is the attributes of UserValue in the same template are not being displayed and i am not able to figure out whats the problem , is there anything wrong with xpath ? What is the correct Xpath to display attributes in creCLext template ?

Thanks in advance

    <?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
           xmlns:plm="http://www.plmxml.org/Schemas/PLMXMLSchema">

<xsl:output method="html" indent="yes"/>
<!-- inside createCL otherwise occStr <xsl:value-of select="$occStr"/> -->  
<xsl:variable name="trvrootref" select="/plm:PLMXML/plm:Header/@traverseRootRefs"/>
<xsl:variable name="roid" select="substring-after($trvrootref,'#')"/>
<xsl:variable name="roe" select="/plm:PLMXML/plm:ProductView/plm:Occurrence[@id=$roid]"/>
<xsl:variable name="roe1" select="$roe/@occurrenceRefs"/>
<xsl:variable name="rprid" select="substring-after($roe/@instancedRef,'#')"/>
<xsl:variable name="root" select="/plm:PLMXML/plm:ProductRevision[@id=$rprid]"/>
<!-- Reference to the Site element and last name attribute  -->    
<xsl:variable name="site" select="/plm:PLMXML/plm:Site"/>   
<xsl:variable name="site_name" select="$site/@name"/>
<!-- inside createCL otherwise occStr <xsl:value-of select="$occStr"/> -->  
<xsl:template match="/">
<html>
<head>
     <title>Global Teamcenter - BOM Report</title>
     <script type="text/javascript">
            function displayDate()
            {
             var d=new Date();
             var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
             var monthname=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
             document.write(monthname[d.getMonth()] + " ");
             document.write(d.getDate() + ", ");
             document.write(d.getFullYear() + " ");
             document.write(weekday[d.getDay()] + " ");
            }
      </script>
</head>
<body style="background-position: 21px 0px; font-size: 10pt; color: black; font-family: Verdana; background-color: white;" lang="en-us">
<div> </div>       
<div align="left"> </div>
<!-- inside createCL otherwise occStr <xsl:value-of select="$occStr"/> -->  
<div align="center">
<table style="table-layout: fixed; border-width: medium; border-style: none; border-color: -moz-use-text-color; font-size: 10pt; width: 653px; font-family: Verdana; border-collapse: collapse; word-wrap: break-word;" border="1" cellpadding="5">
    <colgroup>
        <col style="width: 271px;" width="271"></col>
        <col style="width: 24px;" width="24"></col>
        <col style="width: 358px;" width="358"></col>
    </colgroup>

<tbody valign="top"> 

<tr style="min-height: 42px;">
    <td colspan="3" style="border-width: 1pt 1pt 5pt; border-style: none none solid; border-color: rgb(153, 168, 172) rgb(153, 168, 172) rgb(81, 125, 191); color: rgb(235, 240, 249); background-color: rgb(30, 60, 123); text-align: left;" width="653">
        <h6 align="center" style="margin-top: 0px; font-weight: normal; margin-bottom: 0px; color: rgb(235, 240, 249);">
            <font face="Verdana" size="4">ISE GTc Monthly User Report</font>
        </h6>
    </td>
</tr>

<tr style="min-height: 42px;">
    <td colspan="3" style="border-width: 5pt 1pt 1pt; border-style: solid none none; border-color: rgb(81, 125, 191) rgb(153, 168, 172) rgb(153, 168, 172); color: black; background-color: rgb(235, 240, 249); text-align: left;" width="653">
        <div>
            <font face="Verdana" size="1">Generated by:</font>
        </div>
        <div>
            <span>
                <span title="Issue Title" id="L042502201095146C" style="border-right: 1pt none rgb(220, 220, 220); min-height: 18px; padding: 1px; border-width: 1pt; border-style: none; border-color: rgb(220, 220, 220); display: inline-block; margin: 1px; overflow: hidden; width: 100%; color: rgb(0, 0, 255); white-space: nowrap; text-overflow: ellipsis; background-color: rgb(255, 255, 255); text-align: left; word-wrap: normal;"> 
                  Atul Kumar
                </span>
            </span>
        </div>
    </td>
</tr>

<tr style="min-height: 42px;">
    <td style="border-width: 1pt; border-style: none; border-color: rgb(153, 168, 172); color: black; background-color: rgb(235, 240, 249); text-align: left;" width="271">
        <div>
            <font face="Verdana" size="1">Date:</font>
        </div>
        <div>
            <span>
                <span title="Opened By"  id="L042586E014BA9B4F" style="border-right: 1pt none rgb(220, 220, 220); min-height: 18px; padding: 1px; border-width: 1pt; border-style: none; border-color: rgb(220, 220, 220); display: inline-block; margin: 1px; overflow: hidden; width: 100%; color: rgb(0, 0, 255); white-space: nowrap; text-overflow: ellipsis; background-color: rgb(255, 255, 255); text-align: left; word-wrap: normal;">
                 <script type="text/javascript">
                  displayDate()
                 </script>
                </span>
            </span>
        </div>
    </td>
    <td style="border-width: 1pt; border-style: none; border-color: rgb(153, 168, 172); color: black; background-color: rgb(235, 240, 249);" width="24">
        <div>
            <font face="Verdana" size="2">   </font>
        </div>
    </td>
    <td style="border-width: 1pt; border-style: none; border-color: rgb(153, 168, 172); color: black; background-color: rgb(235, 240, 249); text-align: left;" width="358">
        <div>
            <font face="Verdana" size="1">Site Name:</font>
        </div>

        <div>
            <span>
                <span title="" id="L042587201D05A9D5" style="padding: 1px; display: inline-block; margin: 1px; overflow: hidden; width: 100%; color: rgb(0, 0, 255); white-space: normal; text-overflow: ellipsis; background-color: window; text-align: left; word-wrap: normal;">
                <xsl:value-of select="$site_name"/>
                </span>
            </span>
        </div>
    </td>   

</tr>

<tr style="min-height: 38px;">
    <td style="border-width: 1pt; border-style: none; border-color: rgb(153, 168, 172); color: black; background-color: rgb(235, 240, 249); text-align: left;" width="271">
        <div>
            <font face="Verdana" size="1">Author Licenses:</font>
        </div>
        <div>
        <span>
            <span title="Area Owner" id="L0425876018E022B2" style="padding: 1px; min-height: 18px; display: inline-block; margin: 1px; overflow: hidden; width: 100%; color: rgb(0, 0, 255); white-space: normal; text-overflow: ellipsis; background-color: rgb(255, 255, 255); text-align: left; word-wrap: normal;">
            <xsl:value-of select="count(//plm:UserValue[@title = 'license_level' and @value= '0' and @type='int'])"/>
            </span>
        </span>
        </div>
    </td>

    <td style="border-width: 1pt; border-style: none; border-color: rgb(153, 168, 172); color: black; background-color: rgb(235, 240, 249);" width="24">
        <div>
            <font face="Verdana" size="2">   </font>
        </div>
    </td>
<!-- inside createCL otherwise occStr <xsl:value-of select="$occStr"/> -->  
    <td style="border-width: 1pt; border-style: none; border-color: rgb(153, 168, 172); color: black; background-color: rgb(235, 240, 249); text-align: left;" width="358">
        <div>
            <font face="Verdana" size="1">Consumer Licenses:</font>
        </div>

        <div>
            <span>
                <span title="" id="L042587201D05A9D5" style="padding: 1px; display: inline-block; margin: 1px; overflow: hidden; width: 100%; color: rgb(0, 0, 255); white-space: normal; text-overflow: ellipsis; background-color: window; text-align: left; word-wrap: normal;">
                <xsl:value-of select="count(//plm:UserValue[@title = 'license_level' and @value= '1' and @type='int'])"/>
                </span>
            </span>
        </div>
    </td>   
</tr>
</tbody>
</table>
</div>
<div>
    <span title="" id="" style="padding: 1px; overflow-x: hidden; margin: 1px; width: 647px; text-overflow: ellipsis; word-wrap: break-word;">
    </span>
</div>

<div align="center">
    <table title="" style="table-layout: fixed; border-width: medium; border-style: none; border-color: -moz-use-text-color; font-size: 10pt; width: 651px; font-family: Verdana; border-collapse: collapse; word-wrap: break-word;" border="1">
        <colgroup>
            <col style="width: 200px;" width="200"></col>
            <col style="width: 160px;" width="160"></col>
            <col style="width: 100px;" width="100"></col>
            <col style="width: 185px;" width="185"></col>
        </colgroup>
    <tbody>
        <tr style="">
            <td style="color: black; background-color: rgb(235, 240, 249); border-width: 1pt; border-style: solid; border-color: rgb(81, 125, 191); vertical-align: top;" width="173">rox9DesignItemID</td>
            <td style="color: black; background-color: rgb(235, 240, 249); border-width: 1pt; border-style: solid; border-color: rgb(81, 125, 191); vertical-align: top;" width="253">rox9CommrclDesignItemID</td>
            <td style="color: black; background-color: rgb(235, 240, 249); border-width: 1pt; border-style: solid; border-color: rgb(81, 125, 191); vertical-align: top;" width="118">rox9DesignRevision</td>
            <td style="color: black; background-color: rgb(235, 240, 249); border-width: 1pt; border-style: solid; border-color: rgb(81, 125, 191); vertical-align: top;" width="173">rox9CommrclDesignRevision</td>    
        </tr>
    </tbody>
    <xsl:call-template name="createCL">
        <xsl:with-param name="occStr" select="$roe1"/>
    </xsl:call-template> 
    </table>
</div>
<br/>
</body>
</html>

</xsl:template>
<!-- inside createCL otherwise occStr <xsl:value-of select="$occStr"/> -->  
<xsl:template name="genData">
<xsl:param name="curPart"/>
<xsl:param name="occStr"/>
<xsl:param name="attStr"/>
</xsl:template>
<!-- inside createCL otherwise occStr <xsl:value-of select="$occStr"/> -->  
<xsl:template name="createCL">
<xsl:param name="occStr"/>
<xsl:if test="$occStr!=''">
<xsl:choose>
<xsl:when test="contains($occStr,' ')">
    <xsl:variable name="occid" select="substring-before($occStr,' ')"/>
            <xsl:call-template name="createCL">
                <xsl:with-param name="occStr" select="$occid"/>
            </xsl:call-template>

            <xsl:call-template name="createCL">
                <xsl:with-param name="occStr" select="substring-after($occStr,' ')"/>
            </xsl:call-template>
</xsl:when>
<xsl:otherwise>

        <xsl:call-template name="creCLext">
            <xsl:with-param name="occid" select="$occStr"/>
        </xsl:call-template>

</xsl:otherwise>

</xsl:choose>
</xsl:if>
</xsl:template>

<!-- Reference to the user element and user_id,status and license_level attribute  -->
<xsl:template name="creCLext">
<xsl:param name="occid"/>
    <!-- Reference to the user element and user_id,status and license_level attribute  -->
    <xsl:variable name="occname" select="/plm:PLMXML/plm:ProductView/plm:Occurence[@id=$occid]"/>
    <xsl:variable name="attribute1" select="$occname/plm:UserData[1]/plm:UserValue[1]/@title"/>
    <xsl:variable name="attribute2" select="$occname/plm:UserData[1]/plm:UserValue[2]/@title"/>
    <xsl:variable name="attribute3" select="$occname/plm:UserData[1]/plm:UserValue[3]/@value"/>
    <xsl:variable name="attribute4" select="$occname/plm:UserData[1]/plm:UserValue[4]/@value"/>
    <!-- Reference to the person element and last name attribute  -->             



   <!-- Displaying the values by row order -->
      <tr>
         <td>
         <xsl:value-of select="$attribute1"/></td>
         <td><xsl:value-of select="$attribute2"/></td>
         <td><xsl:value-of select="$attribute3"/>
         </td>
         <td><xsl:value-of select="$attribute4"/></td>
      </tr>           
</xsl:template>
</xsl:stylesheet>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:14:06+00:00Added an answer on June 1, 2026 at 9:14 am

    I am not sure what yoy mean by ‘corresponding to occurenceRefs?’. Here is an XSL that matches the first UserData of each Occurrence (XPath: plxml:Occurrence/plxml:UserData[1]) and outputs all its attributes (XPath: @*):

    <xsl:stylesheet 
      version="1.0" 
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:plxml="http://www.plmxml.org/Schemas/PLMXMLSchema">
    
      <xsl:output method="xml" indent="yes"/>
    
      <xsl:template match="text()">
      </xsl:template>
    
      <xsl:template match="plxml:Occurrence/plxml:UserData[1]">
        <xsl:for-each select="@*">
          <p>
            <xsl:value-of select="concat(local-name(),'=',.)"/>
          </p>
        </xsl:for-each>
      </xsl:template>
    
      <xsl:template match="/">
        <html>
          <body>
            <xsl:apply-templates/>
          </body>
        </html>
      </xsl:template>
    
    </xsl:stylesheet>
    

    Here is a variation of the same XSL that output each UserValue instead than each attribute:

    <xsl:stylesheet 
      version="1.0" 
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:plxml="http://www.plmxml.org/Schemas/PLMXMLSchema">
    
      <xsl:output method="xml" indent="yes"/>
    
      <xsl:template match="text()">
      </xsl:template>
    
      <xsl:template match="plxml:Occurrence/plxml:UserData[1]">
        <xsl:for-each select="plxml:UserValue">
          <p>
            <xsl:value-of select="concat(@title,'=',@value)"/>
          </p>
        </xsl:for-each>
      </xsl:template>
    
      <xsl:template match="/">
        <html>
          <body>
            <xsl:apply-templates/>
          </body>
        </html>
      </xsl:template>
    
    </xsl:stylesheet>
    

    EDIT

    Fix the template like this:

      <xsl:template name="creCLext">
        <xsl:param name="occid"/>
        <!-- Reference to the user element and user_id,status and license_level attribute  -->
        <xsl:variable name="occname" select="/plm:PLMXML/plm:ProductView/plm:Occurrence[@id=$occid]"/>
        <xsl:variable name="attribute1" select="$occname/plm:UserData[1]/plm:UserValue[1]/@value"/>
        <xsl:variable name="attribute2" select="$occname/plm:UserData[1]/plm:UserValue[2]/@value"/>
        <xsl:variable name="attribute3" select="$occname/plm:UserData[1]/plm:UserValue[3]/@value"/>
        <xsl:variable name="attribute4" select="$occname/plm:UserData[1]/plm:UserValue[4]/@value"/>
        <!-- Reference to the person element and last name attribute  -->
    
    
    
        <!-- Displaying the values by row order -->
        <tr>
          <td>
            <xsl:value-of select="$attribute1"/>
          </td>
          <td>
            <xsl:value-of select="$attribute2"/>
          </td>
          <td>
            <xsl:value-of select="$attribute3"/>
          </td>
          <td>
            <xsl:value-of select="$attribute4"/>
          </td>
        </tr>
      </xsl:template>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code, but it displays all attribute options. I want to
I have following code and i want to pass additional parameter in JSON.getJSONfromURL() method
I have the following code I want to run, but the problem is $this->type
I want to know is below code correct ? I have following code which
I have the following code, which I want to load values on a selection
I have the following code: foreach (var control in this.Controls) { } I want
I have the following code where after a bool is true I want to
I have the following code; I want to make sure that submit does not
I have the following code: The actual problem is the non-quoted code. I want
I have the following code which works perfectly, but I want to allow access

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.