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 8096843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:34:24+00:00 2026-06-05T21:34:24+00:00

Can any one help in transforming my xml though XSLT. I am new to

  • 0

Can any one help in transforming my xml though XSLT.
I am new to this xslt and could not able to make it work.

Here is sample input xml file:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<TCXML xmlns="http://www.tcxml.org/Schemas/TCXMLSchema">
  <BOMLine bl_appearance_path_node="" bl_attachments="#id13 #id15 #id20 #id21 #id22 #id3" bl_bomview="" bl_bomview_rev="" bl_gde_bomview_rev="" bl_item="#id7" bl_real_occurrence="" bl_revision="#id8" elemId="id61">

    <GSIdentity elemId="id2" label="_RnrSUKuM1CaiD"/>

</BOMLine>
 <DrawingSheet creation_date="2012-06-05T09:27:19Z" date_released="2012-06-05T09:25:33Z" ead_paragraph="" elemId="id69" format_used="BINARY" gov_classification="" highest_rev_prop="1" ip_classification="" keep_limit_prop="3" last_mod_date="2012-06-05T09:27:20Z" license_list="" object_desc="" object_name="Sheet 1" owning_organization="">

    <GSIdentity elemId="id24" label="RoL9sTu6BT4jNA"/>

</DrawingSheet>
  <DrawingSheet creation_date="2012-06-05T09:28:44Z" date_released="2012-06-05T09:25:33Z" ead_paragraph="" elemId="id70" format_used="BINARY" gov_classification="" highest_rev_prop="1" ip_classification="" keep_limit_prop="3" last_mod_date="2012-06-05T09:28:45Z" license_list="" object_desc="" object_name="Sheet 1" owning_organization="">

    <GSIdentity elemId="id25" label="RoO9sTvgBT4jNA"/>

</DrawingSheet>
  <DrawingSheet creation_date="2012-06-05T09:29:29Z" date_released="2012-06-05T09:25:33Z" ead_paragraph="" elemId="id71" format_used="BINARY" gov_classification="" highest_rev_prop="1" ip_classification="" keep_limit_prop="3" last_mod_date="2012-06-05T09:29:29Z" license_list="" object_desc="" object_name="Sheet 1" owning_organization="">

    <GSIdentity elemId="id26" label="RoO9sTfVBT4jNA"/>

</DrawingSheet>
 <IMAN_Drawing elemId="id78" owning_site="#id4" primary_object="#id21" secondary_object="#id25" user_data="">

    <GSIdentity elemId="id50" label="R8D9sTvgBT4jNA"/>

</IMAN_Drawing>
  <IMAN_Drawing elemId="id79" owning_site="#id4" primary_object="#id22" secondary_object="#id26" user_data="">

    <GSIdentity elemId="id56" label="R8D9sTfVBT4jNA"/>

</IMAN_Drawing>
  <IMAN_Drawing elemId="id80" owning_site="#id4" primary_object="#id20" secondary_object="#id24" user_data="">

    <GSIdentity elemId="id44" label="R8A9sTu6BT4jNA"/>

</IMAN_Drawing>
<UGPART creation_date="2012-06-05T09:25:30Z" date_released="2012-06-05T09:25:33Z" ead_paragraph="" elemId="id117" format_used="PART" gov_classification="" highest_rev_prop="1" ip_classification="" keep_limit_prop="3" last_mod_date="2012-06-05T09:25:34Z" license_list="" object_desc="dwg3" object_name="dwg3" owning_organization="">

    <GSIdentity elemId="id21" label="RXM9sPifBT4jNA"/>

</UGPART>
  <UGPART creation_date="2012-06-05T09:25:30Z" date_released="2012-06-05T09:25:33Z" ead_paragraph="" elemId="id118" format_used="PART" gov_classification="" highest_rev_prop="1" ip_classification="" keep_limit_prop="3" last_mod_date="2012-06-05T09:25:33Z" license_list="" object_desc="dwg1" object_name="dwg1" owning_organization="">

    <GSIdentity elemId="id20" label="R3K9sPifBT4jNA"/>

</UGPART>
  <UGPART creation_date="2012-06-05T09:25:28Z" date_released="2012-06-05T09:25:33Z" ead_paragraph="" elemId="id119" format_used="PART" gov_classification="" highest_rev_prop="1" ip_classification="" keep_limit_prop="3" last_mod_date="2012-06-05T09:25:34Z" license_list="" object_desc="dwg2" object_name="dwg2" owning_organization="">

    <GSIdentity elemId="id22" label="xuO9sPifBT4jNA"/>

</UGPART>
</TCXML>

In this xml file there are 3 IMAN_Drawing ,3 Drawing Sheet and 3 UGPART tags.
For example ,

<IMAN_Drawing elemId="id78" owning_site="#id4" primary_object="#id21" secondary_object="#id25" user_data="">

    <GSIdentity elemId="id50" label="R8D9sTvgBT4jNA"/>

</IMAN_Drawing>

So i want to copy UGPART’s (primary_object id21 in this case) object_name and append to DrawingSheet’s (secondary_object id25 in this case) object_name. So finally DrawingSheet name will be UGPART’s object_name _ DrawingSheet’s object_name.
For this case DrawingSheet object_name willget updated as dwg3_Sheet 1

So finally i want output xml for my input.xml as follows.

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<TCXML xmlns="http://www.tcxml.org/Schemas/TCXMLSchema">
  <BOMLine bl_appearance_path_node="" bl_attachments="#id13 #id15 #id20 #id21 #id22 #id3" bl_bomview="" bl_bomview_rev="" bl_gde_bomview_rev="" bl_item="#id7" bl_real_occurrence="" bl_revision="#id8" elemId="id61">

    <GSIdentity elemId="id2" label="_RnrSUKuM1CaiD"/>

</BOMLine>
 <DrawingSheet creation_date="2012-06-05T09:27:19Z" date_released="2012-06-05T09:25:33Z" ead_paragraph="" elemId="id69" format_used="BINARY" gov_classification="" highest_rev_prop="1" ip_classification="" keep_limit_prop="3" last_mod_date="2012-06-05T09:27:20Z" license_list="" object_desc="" object_name="dwg1_Sheet 1" owning_organization="">

    <GSIdentity elemId="id24" label="RoL9sTu6BT4jNA"/>

</DrawingSheet>
  <DrawingSheet creation_date="2012-06-05T09:28:44Z" date_released="2012-06-05T09:25:33Z" ead_paragraph="" elemId="id70" format_used="BINARY" gov_classification="" highest_rev_prop="1" ip_classification="" keep_limit_prop="3" last_mod_date="2012-06-05T09:28:45Z" license_list="" object_desc="" object_name="dwg3_Sheet 1" owning_organization="">

    <GSIdentity elemId="id25" label="RoO9sTvgBT4jNA"/>

</DrawingSheet>
  <DrawingSheet creation_date="2012-06-05T09:29:29Z" date_released="2012-06-05T09:25:33Z" ead_paragraph="" elemId="id71" format_used="BINARY" gov_classification="" highest_rev_prop="1" ip_classification="" keep_limit_prop="3" last_mod_date="2012-06-05T09:29:29Z" license_list="" object_desc="" object_name="dwg2_Sheet 1" owning_organization="">

    <GSIdentity elemId="id26" label="RoO9sTfVBT4jNA"/>

</DrawingSheet>
 <IMAN_Drawing elemId="id78" owning_site="#id4" primary_object="#id21" secondary_object="#id25" user_data="">

    <GSIdentity elemId="id50" label="R8D9sTvgBT4jNA"/>

</IMAN_Drawing>
  <IMAN_Drawing elemId="id79" owning_site="#id4" primary_object="#id22" secondary_object="#id26" user_data="">

    <GSIdentity elemId="id56" label="R8D9sTfVBT4jNA"/>

</IMAN_Drawing>
  <IMAN_Drawing elemId="id80" owning_site="#id4" primary_object="#id20" secondary_object="#id24" user_data="">

    <GSIdentity elemId="id44" label="R8A9sTu6BT4jNA"/>

</IMAN_Drawing>
<UGPART creation_date="2012-06-05T09:25:30Z" date_released="2012-06-05T09:25:33Z" ead_paragraph="" elemId="id117" format_used="PART" gov_classification="" highest_rev_prop="1" ip_classification="" keep_limit_prop="3" last_mod_date="2012-06-05T09:25:34Z" license_list="" object_desc="dwg3" object_name="dwg3" owning_organization="">

    <GSIdentity elemId="id21" label="RXM9sPifBT4jNA"/>

</UGPART>
  <UGPART creation_date="2012-06-05T09:25:30Z" date_released="2012-06-05T09:25:33Z" ead_paragraph="" elemId="id118" format_used="PART" gov_classification="" highest_rev_prop="1" ip_classification="" keep_limit_prop="3" last_mod_date="2012-06-05T09:25:33Z" license_list="" object_desc="dwg1" object_name="dwg1" owning_organization="">

    <GSIdentity elemId="id20" label="R3K9sPifBT4jNA"/>

</UGPART>
  <UGPART creation_date="2012-06-05T09:25:28Z" date_released="2012-06-05T09:25:33Z" ead_paragraph="" elemId="id119" format_used="PART" gov_classification="" highest_rev_prop="1" ip_classification="" keep_limit_prop="3" last_mod_date="2012-06-05T09:25:34Z" license_list="" object_desc="dwg2" object_name="dwg2" owning_organization="">

    <GSIdentity elemId="id22" label="xuO9sPifBT4jNA"/>

</UGPART>
</TCXML>

I am looking for xslt 1.0 solution.

This is my xslt (i was trying to update UGPART attribute by passing value through parameter but it is going as empty value) with which i was trying but somehow it is not working. As i was not able to update attribute for UGPART i did not tried to update DrawingSheet name which is that i want to update.

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  xmlns:plm="http://www.tcxml.org/Schemas/TCXMLSchema" version="1.0">
  <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
<xsl:template match="/plm:TCXML/plm:IMAN_Drawing">  
<xsl:copy>
    <xsl:copy-of select="@*" />
    <xsl:for-each select="/plm:TCXML/plm:IMAN_Drawing">
        <xsl:variable name="currentSecObjectId" select="@secondary_object"/>
        <xsl:variable name="RefSecObjectId" select="substring($currentSecObjectId,2)"/>
        <xsl:variable name="currentPrimaryObjectId" select="/plm:TCXML/plm:IMAN_Drawing/@primary_object"/>
        <xsl:variable name="RefPrimaryObjectId" select="substring($currentPrimaryObjectId,2)"/>
        <xsl:call-template name="UGPart">
            <xsl:with-param name="PriId" select="$RefPrimaryObjectId"/>
        </xsl:call-template>
    </xsl:for-each>

    <xsl:apply-templates/>  

</xsl:copy> 
</xsl:template> 
    <xsl:template match="/plm:TCXML/plm:UGPART" name="UGPart">
    <xsl:param name="PriId"/>
    <xsl:copy>
    <xsl:if test="@object_name="'Test'">
        <xsl:attribute name="owning_organization">
            <xsl:value-of select="$PriId"/>
        </xsl:attribute>        
    </xsl:if>
      <xsl:copy-of select="@*[not(name()='owning_organization')]" /> 
    <xsl:apply-templates /> 
    </xsl:copy>

</xsl:template>

Thanks in advance.

  • 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-05T21:34:25+00:00Added an answer on June 5, 2026 at 9:34 pm

    I would use the following pattern, really light and clean:

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:output indent="yes"/>
    
        <!-- identity template to copy input xml as is --> 
        <xsl:template match="node()|@*">
            <xsl:copy>
                <xsl:apply-templates select="node()|@*"/>
            </xsl:copy>
        </xsl:template>
    
        <!-- specific template to update just DrawingSheet -->
        <xsl:template match="DrawingSheet">
    
            <!-- get UPGART id from IMAN_Drawing -->
            <!-- get UPGART object_name -->
            <!-- update Drawing Sheet obejct_name -->
    
        </xsl:template>
    
    </xsl:stylesheet>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can any one help me, i already checked resizing demo but this work through
Can Any one help me reading this XML and Looping through <MedicationDispensed> I get
I am new in Pocket PC and Smart phone. so can any one help
Can any one help me with this issues, I m using FrameLayout in design,
Can any one help me out how how this widget can be developed as
Can any one help me. I have this ‘unmanaged’ .NET code, which works on
can any one help me on this? I got a .aspx page designed with
Can any one help me to identify the error in this program using ADO.NET...
Can any one help me in this error here's the code :- CREATE OR
Can any one help me in sorting this out in sed/awk/perl Input file Start

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.