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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:18:33+00:00 2026-05-31T18:18:33+00:00

I have an xml message that is in the older schema (xsd) format. My

  • 0

I have an xml message that is in the older schema (xsd) format. My new schema is exactly the same but I embedded an element inside the older one. For example :

My old schema had an element :

<exclude> MyRestriction </exclude>

but my new schema is like this :

<exclude> <restriction> MyRestriction </restriction> </exclude>

and the entire message is the same as before. Last time I used to do a copy-of but now
I need to have a template that copy-of everything but move the value of the exclude to the restriction tag. Anyone can help me please ?

Thanks

  • 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-31T18:18:34+00:00Added an answer on May 31, 2026 at 6:18 pm

    You could use a template to match the text in an exclude template

    <xsl:template match="exclude/text()">
       <restriction><xsl:value-of select="." /></restriction>
    </xsl:template>
    

    This way will keep any other child elements within exclude should they be required.

    So, given the following XSLT

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
       <xsl:output method="xml" indent="yes"/>
    
       <xsl:template match="exclude/text()">
          <restriction><xsl:value-of select="." /></restriction>
       </xsl:template>
    
       <xsl:template match="@*|node()">
          <xsl:copy>
             <xsl:apply-templates select="@*|node()"/>
          </xsl:copy>
       </xsl:template>
    </xsl:stylesheet>
    

    When applied to the following XML

    <exclude ex="1"> MyRestriction <test>Hello</test> </exclude>
    

    The following is output

    <exclude ex="1">
       <restriction> MyRestriction </restriction>
       <test>Hello</test>
    </exclude>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to make a schema for an XML format that's already being used.
I have an xml message that I need to parse (No control of format)
I have an XML file that is validated against an XSD file. When a
I have a wide-character XML message that I need to send over a Win32
I have a server that receives various xml messages from clients (one thread per
I have code like this: // Take the xml message and turn it into
I have a Java program in which I have to validate an XML message
in a C# project written with MVC1 I have to retrieve a XML message,
I have XML that looks like this: <Parameter Name=parameter name Value=parameter value /> which
I have XML that looks like this: <ROW ref=0005631 type=04 line=1 value=Australia/> <ROW ref=0005631

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.