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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:18:51+00:00 2026-06-02T17:18:51+00:00

I have a source html looks like: <p class=heading-8>Emergency Care<span class=char-style-override-68>, if not already

  • 0

I have a source html looks like:

<p class="heading-8">Emergency Care<span class="char-style-override-68">, if not already done:</span></p>
<p class="List-Bullet-CHAM1-CHAM-1-List-Bullet-1 para-style-override-3"><span>  </span><span class="char-style-override-25">1.</span><span> Do Initial Assessment (p. 72).</span></p>

Now I create a template match for p:

<xsl:template match="x:p">
<xsl:choose>
 <xsl:when test="contains(@class,'heading-8')">
   <xsl:variable name="current-name" select="generate-id(.)"/>
   <xsl:variable name="noTable" select="count(preceding-sibling::x:table)"/>
   <p>
    <b>
        <xsl:apply-templates/>
    </b>
   </p>
            <xsl:if test="following-sibling::*[1][self::x:p][contains(@class,'List-Bullet-CHAM1-CHAM-1')][generate-id(preceding-sibling::x:p[contains(@class,'heading-8 ')][1]) = $current-name]">
                <ol>
                    <xsl:apply-templates select="following-sibling::x:p[contains(@class,'List-Bullet-CHAM1-CHAM-1')][count(preceding-sibling::x:table)=$noTable][generate-id(preceding-sibling::x:p[contains(@class,'heading-8 ')][1]) = $current-name]" mode="bullet"/>
                </ol>
            </xsl:if>
 </xsl:when>

The issue I am having now is that it seems that I could never get in to that inner if branch. But I think the source html matches perfectly with it, just don’t know where I could be wrong.

PS, I used generate-id() function to determine the identity of a preceding sibling node.

  • 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-02T17:18:56+00:00Added an answer on June 2, 2026 at 5:18 pm

    As far as I can see, the test condition of the xsl:if statement looks fine, except the trailing space in contains(@class,'heading-8 '). There’s no class attribute that contains the string “heading-8 “. Removing the space in both the xsl:if and xsl:apply-templates elements should fix the issue.

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

Sidebar

Related Questions

If I have a model named Client and controller that looks like this class
Suppose we have this example: http://techdroid.kbeanie.com/2009/07/custom-listview-for-android.html with source code available here: http://code.google.com/p/myandroidwidgets/source/browse/trunk/Phonebook/src/com/abeanie/ How can
I have some HTML errors in my output source code, coming from one of
I have a peice of HTML I took from the source of my Twitter
I ran across some unique css class attribute:value pairings in HTML tags. It looks
I am using helpers like the following: @Html.TextBoxFor(m => m.Login.UserName, new { @class =
I have got this button: <input type=button value=Rep id=rep name=rep class=rep style=width:50px onclick=triggerLabel(1);this.disabled=true;addRep(<?php echo
I have a string of raw text which looks something like this: 1 .
I have written a simple class that wraps the JQUeryUI Dialog. It basically looks
I have a Django template that contains a Javascript function, like so: <a class

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.