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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:48:20+00:00 2026-06-05T06:48:20+00:00

Why doesn’t this line: apply-templates select=*/* (under the shop element in the XSLT file)

  • 0

Why doesn’t this line:

apply-templates select="*/* (under the “shop” element in the XSLT file)

apply bold formatting to Blake2? The output looks like this:

Start of root in XSLT

“Step 1 start” Alexis (Task: Sales )
Employee2 (Task: ) Blake2 “Step 1 done”

End of root in XSLT

My question is, why isn’t Blake2 also in bold? It’s under the <employee> element.

Changing that line to *apply-templates select="*" causes Blake2 to be in bold. What makes this different?

Here’s the XML file:

<?xml version="1.0"?> 
<?xml-stylesheet type="text/xsl" href="2.xsl" ?>

<root>
    <shop>
        <person> 
            <employee> 
                <name> Alexis </name> 
                <role> Manager </role> 
                <task> Sales </task> 
            </employee> 

            <employee>
                <name> Employee2 </name>
            </employee>
        </person>

        <employee>
            <name> Blake2 </name>
        </employee>

    </shop>

</root>

Here’s the XSLT file:

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

<xsl:template match="root"> 
<html><head></head> 
<body>
Start of root in XSLT <p/> <xsl:apply-templates /> <p/>

End of root in XSLT

</body> 
</html> 
</xsl:template> 

<xsl:template match="shop">
"Step 1 start"
<xsl:apply-templates select="*/*"/>
"Step 1 done" <p/>
</xsl:template> 

<xsl:template match="employee"> 
<b> <xsl:apply-templates select="name"/> </b> 
(Task: <xsl:apply-templates select="task"/>) 
<br></br> 
</xsl:template> 

</xsl:stylesheet>
  • 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-05T06:48:21+00:00Added an answer on June 5, 2026 at 6:48 am

    Your third template does not select any <employee> elements in your document. It just selects <employee> elements that are direct child nodes of the current element. On the root level, this does not apply to any elements, but as the second template is invoked by the <apply-templates> in the first element, and the second template applies templates with the (relative!) path */* (i.e. templates for any elements that are children of the children of the current element), the <employee> element in the <person> element gets selected.

    The second <employee> element is not a child of a child of the <shop> element, but a direct child of the <shop> element, and hence doesn’t get selected by */* starting at <shop>.

    When you change */* to *, both <employee> elements get selected: The second one gets selected because it directly matches * (a direct child of <shop>). * also selects <person>, and as there is no template specified for that element, the default behavior will be executed, meaning that templates will be applied to the children of <person>, which includes the first <employee> element.

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

Sidebar

Related Questions

Why doesn't the file input element show up at all??? see code and screen
Why doesn't the CAST work in this MySQL query? SELECT MAX(Signups) AS Max, MIN(Signups)
This doesn't have to be Java, but it's what I'm dealing with. Also, not
Doesn't matter what I do, I simply can't get this to play a sound
Why doesn't this work: <Style TargetType=s:Substance> <Setter Property=Template> <Setter.Value> <DataTemplate> <StackPanel> <TextBlock Text={TemplateBinding Name}/>
This doesn't work: $to = 'myemail@gmail.com'; $from = 'test@test.com'; $subj = 'test'; $message =
Why doesn't this code work? I'am using FF. <head> <script type=text/javascript> document.getElementById(someID).onclick = function(){
There doesn't seem to be a question for this, and it seems strange that
This doesn't make sense to me yet. So the first while loop runs and
Why doesn't this work? type RetryBuilder(max) = member x.Return(a) = a // Enable 'return'

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.