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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:44:48+00:00 2026-06-09T10:44:48+00:00

why do I get with that data: <A> <B>block 1</B> <B>block 2</B> <C> no

  • 0

why do I get with that data:

<A>
  <B>block 1</B>
  <B>block 2</B>
  <C>
    no
  </C>
  <B>block 3</B>
</A>

and this transformation:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method= "html" indent="yes"/>

<xsl:template match="A/B">
  <xsl:value-of select="."/> <br/>
</xsl:template>

</xsl:stylesheet>

the following output:

block 1
block 2
no block 3

I’d expect it to be:

block 1
block 2
block 3

So: Why does the C block getting included?

//EDIT
Tested with the thing here:
http://www.ladimolnar.com/JavaScriptTools/XSLTransform.aspx

  • 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-09T10:44:50+00:00Added an answer on June 9, 2026 at 10:44 am

    Because of the Default Template Rules.

    <xsl:template match="*|/">
      <xsl:apply-templates/>
    </xsl:template>
    
    <xsl:template match="text()|@*">
      <xsl:value-of select="."/>
    </xsl:template>
    

    The XSL processor examines each node in turn, looking for a matching template. If it doesn’t find one, it uses the default template, which just outputs the text. In your case the following happens (“no match” means no match in your stylesheet):

    /A         no match, apply-templates (default element template)
    /A/B       match, output text
    /A/B       match, output text
    /A/C       no match, apply-templates
    /A/C/text  no match, output text (default text template)
    /A/B       match, output text
    

    To skip the path /A/C just add an empty template

    <xsl:template match="A/C"/>
    

    This will match the unwanted element and suppress output.

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

Sidebar

Related Questions

I have a jquery widget that get data from a server in another domain
I want to create a html page that get data from a website table
I created a background thread that get's data and returns it to the main
I have an app that must get data from the Sqlite database in order
hi i have a function that get information from xml data and print markers
I am writting a stored procedure that will get data for a sales report.
I am trying to create a program that will get data directly from socket
I've built a data-driven google map with different icons that get assigned to the
I get data from a 3rd party API that just gives me back a
I found that PageProxy can be used to get data from page, but I

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.