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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:21:18+00:00 2026-06-18T10:21:18+00:00

file1.xml: <config> <version> <input00 version =1/> </version> </config> file2.xml: <config> <version> <input01 version =2/>

  • 0

file1.xml:

<config>
  <version>
     <input00 version ="1"/>
  </version>
</config>

file2.xml:

 <config>
  <version>
     <input01 version ="2"/>
  </version>
</config>

output.xml:

<config>
  <version>
     <input00 version ="1"/>
     <input01 version ="2"/>
  </version>
</config>

This is what I tried for generating a stylesheet:
merge.xslt

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="@*|node()">
    <xsl:copy>
        <xsl:apply-templates select="@*|node()" />
    </xsl:copy>
</xsl:template>


<xsl:template match="/config">
     <xsl:copy>
        <xsl:apply-templates select="config"/>
        <xsl:apply-templates select="document('./file1.xml')/config/version" />
     </xsl:copy>
</xsl:template>


</xsl:stylesheet>

& this is how I run the xslt processor:

 $xsltproc merge.xslt file2.xml

this is all I get:

<?xml version="1.0"?>
<config/>

Please help.

  • 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-18T10:21:19+00:00Added an answer on June 18, 2026 at 10:21 am

    Try this XSLT:

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output indent="yes"/>
    
      <xsl:template match="@*|node()">
        <xsl:copy>
          <xsl:apply-templates select="@*|node()" />
        </xsl:copy>
      </xsl:template>
    
      <xsl:template match="version">
        <xsl:copy>
          <xsl:apply-templates select="*"/>
          <xsl:apply-templates select="document('file1.xml')/config/version/*" />
        </xsl:copy>
      </xsl:template>
    
    </xsl:stylesheet>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my web.config file contents: <?xml version=1.0?> <configuration> <system.webServer> <httpErrors errorMode=Detailed /> <asp
file1.xml <config> <state version=10> <root value=100 group=5> <leaf number = 2/> </root> <root value=101
Looking in the android sdk folders, I've found a file called values/config.xml . This
This content of my module's config.xml. I want to change the onepage template file
In my config.xml I have: <config> <modules> <Test_Quickorder> <version>0.1.0</version> </Test_Quickorder> </modules> <global> <blocks> <quickorder>
I'm using an XML config file to populate my navigation using Zend_Navigation. I have
I've defined 2 preferences in the extension's config.xml file: <preference name=interval value=1800 readonly=false />
what does it means struts controller reads the struts-config.xml file when ever web application
is springdoclet use to generate bean defination xml files? servlet-config.xml..etc ? i trying to
I read a xml file ( myConfig.config ) and provide it as an input

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.