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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:00:59+00:00 2026-06-12T12:00:59+00:00

I have an XML file which stores content which is displayed using a Java

  • 0

I have an XML file which stores content which is displayed using a Java Hashtable contained in a JSP Page (Its currently useing scriplets which I now know are bad practice)

As the amount of XML content has increased I need to start displaying this in batches of e.g. 5 <sliceContent> divs and then give the user the option of clicking next. I have the “Next” div at the end. I will of course also have to add a ‘previous’ option.

I am not sure what i am looking for, i have found a few posts such as this post but i cant really follow. Can this be done by CSS alone or do i need to implement it in Java?

Thanks again for any suggestions.

EDIT I have retagged this with CSS and Javascript as i have been told this is what i need.

My XML (content can extend to several paragraphs)

<slice><sliceContent> Content element 1 </sliceContent></slice>
<slice><sliceContent> Content element 2 </sliceContent></slice>
<slice><sliceContent> Content element 3 </sliceContent></slice>

My Java (contained in a JSP page)

<div class='result-container'>
<ul class="menu menu-style">
 <li>
    <a href="javascript:;">Concept for <%=keywords%></a>
            <ul xmlns:sparql-results="http://www.w3.org/2005/sparql-results#" class="menu menu-style">      
      <li>
        <a href="javascript:;">
            <span>Show Concept</span>
        </a>
<ul class="wer">
<%

    String testContent = contentPara;
    String startTag = "sliceXML\">"; 
    String endTag = "<";
    String xmlMatch = null; 
    String hashMatch = null;        

    int startPosition = testContent.indexOf(startTag);              
    if(startPosition >1)
    {               
        int subStringIndex = startPosition + startTag.length(); 
        int endPosition = testContent.indexOf(endTag, subStringIndex);      
        if(endPosition >= startPosition)
        {
            xmlMatch = testContent.substring(subStringIndex, endPosition);
        }   

        if(xmlMatch == null)
        {
        out.println("No concept matches for your query!" );     
        }
        else
        {

Hashtable<String, String> table = new Hashtable<String, String>();
(hash table links here)

        try{    
            FileInputStream fstream = new FileInputStream(table.get(xmlMatch));                 

            // Get the object of DataInputStream
            DataInputStream in = new DataInputStream(fstream);
            BufferedReader br = new BufferedReader(new InputStreamReader(in));
            String strLine;

        //Read File Line By Line
            while ((strLine = br.readLine()) != null)   
            {
                out.println (strLine);
            }               

        //Close the input stream
            in.close();
        }
            catch (Exception e)
            {
                //Catch exception if any
                System.err.println("Error: " + e.getMessage());
            }
        }

   }
      <li>
      <div class="next-div">
      <a class="next">Next<img height="10px" src="images/more.png" />
      </a>
    </div>
  </li>
  </ul>
  </li>
  </li>
  </ul>

  </div>
  • 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-12T12:01:00+00:00Added an answer on June 12, 2026 at 12:01 pm

    You can do this with javascript:

    <script type="text/javascript" language="JavaScript">
    function showContent(){
    document.getElementById('showContent').innerHTML = "Here is the text we want to show";
    }
    </script>
    

    HTML:

    <a href="#" onclick="showContent()">showContent</a>
    <div id="showContent"></div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML file which I need to parse using PHP and send
I have an XML file which has to be transformed using XSLT, I am
Im using c# .net , windows form application. I have a XML file which
I have dialog layout xml file which stores button, and I have set android:onClick=doSomething
I have the following XML file with page nodes which I want to read
I am building a Winform web browser. I have a history.xml file which stores
I have a xml file which I need to open with Microsoft Word 2007.
I have this xml file which has text init. i.e Hi my name is
I have an XML file which XML parser choke on. A part of it
I have an XML file which has many section like the one below: <Operations>

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.