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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:22:34+00:00 2026-06-11T20:22:34+00:00

I have input like following snippet, Input Snippet : <div class=a> <table> <col width=4

  • 0

I have input like following snippet,

Input Snippet :

    <div class="a">
      <table>
        <col width="4" />
        <col width="8" />
        <col width="5" />
        <tbody>
          <tr>
            <td>ABC</td>
            <td>DEF </td>
            <td>GHI</td>
          </tr>
        </tbody>
      </table>
    </div>
    <div class="x">

    <table>
        <col width="5" />
        <col width="8" />
        <col width="8" />
    <tbody>
          <tr>
            <td>ABC</td>
            <td>DEF </td>
            <td>GHI</td>
          </tr>
        </tbody>

I am currently at table inside of the div class=”a” tag, and I would like check either the immediately following sibling that is div and it’s first child is table or nothing. I wrote the following XPath: ./../following-sibling::div[1]/node()[1] ) = 'table'.

I am getting expected output in altova XMLSpy, but in saxon parser not giving exact output becasue there is some space between the <div> and <table>, and that space is treated as a text node.

How can I avoid the space between the tags, or are there any other solutions?

snippet Code :

<xsl:choose>

<xsl:when local-name(./../following-sibling::div[1]/node()[1] ) = 'table' ">    
  loagic-1
</xsl:when>
<xsl:otherwise>
logic-2 
  </xsl:otherwise>

</xsl:choose>
  • 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-11T20:22:35+00:00Added an answer on June 11, 2026 at 8:22 pm

    Although Ian’s answer is correct, a cleaner solution is…

    <xsl:when test="../following-sibling::div[1]/*[1]/self::table">
    

    Also, if you didn’t care about any intervening elements between the div and its table child, you could simplify to …

    <xsl:when test="../following-sibling::div[1]/table">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some html like the following: <div class=control-group> <input type=text data-bind=value: $data.DealCode name=DealCode
I have something like the following <div id=container> <ul id=name_list> <li class=name> <input type=hidden
I have a HTML snippet like the following <tr class=new> <td> <input name=id type=checkbox/>
I have an input box like the following: <input type=text value= somethingSpecial=filename.txt id=myID class=box>
I have the following code: def bootstrap_form_field(f, method, text, &block) content_tag :div, :class =>
I have a html file like following: <form action=/2811457/follow?gsid=3_5bce9b871484d3af90c89f37 method=post> <div> <a href=/2811457/follow?page=2&amp;gsid=3_5bce9b871484d3af90c89f37>next_page</a> &nbsp;<input
I have code that looks like the following: <form id=MyForm name=MyForm method=post action=index.php> <input
I have a structure like the following: <form> <input type=text /> <input type=text />
Assume I have the following input in Pig: some And I would like to
Please consider following snippet: <div class=row> <div class=span12> <div class=control-group> <label class=control-label>Person Name</label> <div

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.