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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:43:09+00:00 2026-05-17T17:43:09+00:00

Is it possible to skip over nodes while processing a xml file? For example:

  • 0

Is it possible to skip over nodes while processing a xml file? For example: say I have the following xml code:

<mycase desc="">
  <caseid> id_1234 </caseid>
  <serid ref=""/>    
  ......
  ......
  ......  
</mycase>

and I want to make it look like this:

<mycase desc="" caseid="id_1234">
 .....
 .....
</mycase>

Currently I’m doing this:

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="2.0" exclude-result-prefixes="xs xdt err fn"
            xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
            xmlns:xs="http://www.w3.org/2001/XMLSchema"
            xmlns:fn="http://www.w3.org/2005/xpath-functions"
            xmlns:xdt="http://www.w3.org/2005/xpath-datatypes"
            xmlns:err="http://www.w3.org/2005/xqt-errors">

          <xsl:output method="xml" indent="yes"/>
          <xsl:template match="/">
            <xsl:apply-templates/> 
          </xsl:template>

         <xsl:template match="mycase">          
            <xsl:element name="mycase">
               <xsl:attribute name="desc"/>
               <xsl:attribute name="caseid">
                 <xsl:value-of select="caseid"/>
               </xsl:attribute>
              <xsl:apply-templates/>
            </xsl:element>
         </xsl:template>
         ......
         ......

This does create what I want it to but because of <xsl:apply-templates/> it processes all the node. while I want it to skip processing caseid and serid all together. This also applys for other nodes, which will not be available in the new XML structure.
So how can I skip the nodes that I don’t want to process using xslt.

  • 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-17T17:43:10+00:00Added an answer on May 17, 2026 at 5:43 pm

    You can use empty templates to suppress output of certain nodes in your input document:

    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method="xml" indent="yes"/>
    
      <xsl:template match="mycase">
        <mycase caseid="{caseid}">
          <xsl:apply-templates select="@*|node()"/>
        </mycase>
      </xsl:template>
    
      <xsl:template match="caseid|serid"/>
    
      <xsl:template match="@* | node()">
        <xsl:copy>
          <xsl:apply-templates select="@* | node()"/>
        </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

Possible Duplicate: Is it possible to skip parameters that have default values in a
I have this problem when I want to skip to a position while streaming
Is it possible to skip validations with a dynamic find/create by method? For example
Is it possible to skip the whole action method execution and return a specific
In C++ it is possible to skip method parameter identifier if it's unused: void
In paypal, is it possible to skip the Thanks for your order page and
Possible Duplicate: && operator in Javascript In the sample code of the ExtJS web
I have an Arduino mega communicating over Bluetooth (bluesmirf gold device) to a C#
We have a C# .Net client application that sends some commands via REST over
my question is simple. Is it possible skip the auth dialog that requesting for

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.