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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:28:28+00:00 2026-05-31T14:28:28+00:00

I have a complex structure which contains a list ofthe following form complex tree

  • 0

I have a complex structure which contains a list ofthe following form

complex tree here
...
<ns3:timestampList xmlns="myNameSpace">
            <timestampInfo>
                    <timestampID>START</timestampID>
                    <timestamp>2012-02-25T00:30:18.705+01:00</timestamp>                        
            </timestampInfo>
            <timestampInfo>
                    <timestampID>END</timestampID>
                    <timestamp>2012-02-25T00:30:23.675+01:00</timestamp>
            </timestampInfo>
            <timestampInfo>
                    <timestampID>RE_START</timestampID>
                    <timestamp>2012-02-25T00:30:18.705+01:00</timestamp>
            </timestampInfo>
</ns3:timestampList>

I would like to retain the whole try and only add a new timestampinfo block.
I know that I could traverse the tree and add to the output all the nodes using copy-of but I wonder if there is no better and elegant way to do this.

  • 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-05-31T14:28:29+00:00Added an answer on May 31, 2026 at 2:28 pm
    <xsl:param name="new-ts">
      <timestampInfo xmlns="myNameSpace">
        ...
      </timestampInfo>
    </xsl:param>
    
    <xsl:template match="@* | node()">
      <xsl:copy>
        <xsl:apply-templates select="@* | node()"/>
      </xsl:copy>
    </xsl:template>
    
    <xsl:template match="ns3:timestampList">
      <xsl:copy>
        <xsl:apply-templates select="@* | node()"/>
        <xsl:copy-of select="$new-ts"/>
      </xsl:copy>
    </xsl:template>
    

    might suffice to give you an idea although with different namespaces used but not completely given in your sample my code is also not complete.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a complex form in Ruby on Rails 2.3.5, here's the structure for
I have a complex object(tree structure) which I am flattening it out into a
I have a complex input form within a PHP based web application. To structure
I have two complex dictionaries in the form Dictionary<string, Dictionary<string, Dictionary<string, List<string>>>> So as
I have been working to build a complex data structure which would return a
I have a complex data structure (user-defined type) on which a large number of
I have a complex regex, which contains constructs like this one: ( + sectionPattern
I have a table with the following complex structure.... <table> <tr> // 1st row
I have a RuleTree data structure which represents a tree of rules that are
I have to transfer objects between activities. Objects are with complex structure. I'm not

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.