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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:58:19+00:00 2026-06-07T18:58:19+00:00

I have two XHTML files and my task is to convert from one to

  • 0

I have two XHTML files and my task is to convert from one to another with XSLT (or any other method by Java Program). I searched but I didn’t get any example for this, all are related for converting one XML to another with XSLT or little bit information for one XHMTL to other. So can anyone please explain the procedure with one example containing source, desired and XSLT files by using my XHTML files or any other. II’ll be very much thankful for that.

Source file [1]-

<?xml version="1.0" encoding="UTF-8"?>  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml">  
<head>  
<meta http-equiv="Content-type" content="text/html;  charset=utf-8" />  
<title>eXe</title>  
<style type="text/css">  
@import url(base.css);  
@import url(content.css);  
</style>  
<script type="text/javascript" src="common.js"></script>  
</head>  
<body>  
<div id="outer">  
<div id="main">  
<div id="nodeDecoration">  
<p id="nodeTitle">  
Part 1</p>  
</div>  
<div class="TrueFalseIdevice" id="id12">  
<script type="text/javascript" src="common.js"></script>  
<!--THIS JAVASCRIPT HAS TO BE ELIMINATED-->  
<script type="text/javascript" src="libot_drag.js"></script>  
<div class="iDevice emphasis1">  
<img alt="" class="iDevice_icon" src="icon_question.gif" />  
<span class="iDeviceTitle">True-False Question</span><br/>  
<div class="iDevice_inner">  
<div id="ta12_16" class="block" style="display:block">  

</div><div class="question">  
<br/><br/><div id="taquestion0b12" class="block" style="display:block">1><span style="color: #000000; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: #ffffff; display: inline ! important; float: none"> SQL Stands for Structure Query Language?</span>   

<!--THIS ONCLICK EVENT HAS TO BE REMOVED-->  
</div><br/>True <input type="radio" name="option0b12" id="true0b12" onclick="getFeedback(0,2,'0b12','truefalse')"/>   
False <input type="radio" name="option0b12" id="false0b12" onclick="getFeedback(1,2,'0b12','truefalse')"/>  
<div id="s0b0b12" style="color: rgb(0, 51, 204);display: none;" even_steven="18">Correct! </div>  
<div id="s1b0b12" style="color: rgb(0, 51, 204);display: none;" even_steven="19">Incorrect! </div>  
<div id="sfbk0b12" style="color: rgb(0, 51, 204);display: none;"><div id="tafeedback0b12" class="block" style="display:block">  

</div></div>  
</div>  
</div>  
</div>  
</body></html> 

Desired File [1]:

<?xml version="1.0" encoding="UTF-8"?>  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml">  
<head>  
<title>eXe</title>  
<meta http-equiv="Content-Type" content="text/html;  charset=utf-8" />  
<!-- Created using eXe: http://exelearning.org -->  
<style type="text/css">  
@import url(base.css);  
@import url(content.css);  
</style>  
<script type="text/javascript" src="common.js"></script>  
</head>  
<!--THESE TWO JAVASCRIPT HAVE TO BE INCLUDED-->  
<script type="text/javascript" src="APIWrapper.js"></script>  
<script type="text/javascript" src="SCOFunctions.js"></script>  
<body onload="loadPage()" onunload="unloadPage()"><div id="outer">  
<div id="main">  
<div id="nodeDecoration">  
<p id="nodeTitle">  
Part 1</p></div>  
<div class="QuizTestIdevice" id="id8">  
<!--THIS JAVASCRIPT AND FORM HAVE TO BE INCLUDED-->  
<script type="text/javascript" src="calculate.js"></script>  
<form name="quizForm8" id="quizForm8" action="javascript:calcScore2();">  
<div class="iDevice emphasis1">  
<img alt="" class="iDevice_icon" src="icon_question.gif" />  
<span class="iDeviceTitle">SCORM Quiz</span>  
<div class="iDevice_inner">  
<div class="passrate" value="50"></div>  
<div class="question">  
<div id="taquestion0b8" class="block" style="display:block">1> SQL Stands for Structure Query Language?  

</div><br/>  
<table><tr><td><input type="radio" name="key0b8" value="0" />  
</td><td>  
<div id="taoptionAnswer0q0b8" class="block" style="display:block">True  

</div></td></tr>  
<tr><td><input type="radio" name="key0b8" value="1" />  
</td><td>  
<div id="taoptionAnswer1q0b8" class="block" style="display:block">False  

</div></td></tr>  
</table></div>  
<!--THIS SUBMIT BUTTON HAS TO BE INCLUDED-->  
<br/><input type="submit" name="submitB" value="SUBMIT ANSWERS"/>  
</div></div>  
</form>  
</div>  
</div>  
</div>  
</body></html>  

COMPLETE SOURCE FILE [2]-

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html;  charset=utf-8" />
<title>eXe</title>
<style type="text/css">
@import url(base.css);
@import url(content.css);
</style>
<script type="text/javascript" src="common.js"></script>
</head>
<body>
<div id="outer">
<div id="main">
<div id="nodeDecoration">
<p id="nodeTitle">
Part 2</p>
</div>
<div class="TrueFalseIdevice" id="id13">

<script type="text/javascript" src="common.js"></script>
<script type="text/javascript" src="libot_drag.js"></script>

<div class="iDevice emphasis1">
<img alt="" class="iDevice_icon" src="icon_question.gif" />
<span class="iDeviceTitle">True-False Question</span><br/>
<div class="iDevice_inner">
<div id="ta13_16" class="block" style="display:block">
</div>

<div class="question">
<br/><br/><div id="taquestion0b13" class="block" style="display:block">1: Can a table have more than one primary key?

</div><br/>True <input type="radio" name="option0b13" id="true0b13" onclick="getFeedback(0,2,'0b13','truefalse')"/> 
False <input type="radio" name="option0b13" id="false0b13" onclick="getFeedback(1,2,'0b13','truefalse')"/>
<div id="s0b0b13" style="color: rgb(0, 51, 204);display: none;" even_steven="18">Correct! </div>
<div id="s1b0b13" style="color: rgb(0, 51, 204);display: none;" even_steven="19">Incorrect! </div>
<div id="sfbk0b13" style="color: rgb(0, 51, 204);display: none;"><div id="tafeedback0b13" class="block" style="display:block">
</div></div></div>

<div class="question">

<br/><br/><div id="taquestion1b13" class="block" style="display:block"><span style="color: #000000; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: #ffffff; display: inline ! important; float: none">2: A row in a database can also be called a domain.</span>

</div><br/>True <input type="radio" name="option1b13" id="true1b13" onclick="getFeedback(0,2,'1b13','truefalse')"/> 

False <input type="radio" name="option1b13" id="false1b13" onclick="getFeedback(1,2,'1b13','truefalse')"/>

<div id="s0b1b13" style="color: rgb(0, 51, 204);display: none;" even_steven="19">Incorrect! </div>
<div id="s1b1b13" style="color: rgb(0, 51, 204);display: none;" even_steven="18">Correct! </div>
<div id="sfbk1b13" style="color: rgb(0, 51, 204);display: none;"><div id="tafeedback1b13" class="block" style="display:block">
</div></div>
</div>

<div class="question">

<br/><br/><div id="taquestion2b13" class="block" style="display:block"><span style="color: #000000; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: #ffffff; display: inline ! important; float: none">3: In an OO database objects may inherit some or all of the characteristics of other objects.</span>

</div><br/>True <input type="radio" name="option2b13" id="true2b13" onclick="getFeedback(0,2,'2b13','truefalse')"/> 
False <input type="radio" name="option2b13" id="false2b13" onclick="getFeedback(1,2,'2b13','truefalse')"/>
<div id="s0b2b13" style="color: rgb(0, 51, 204);display: none;" even_steven="18">Correct! </div>
<div id="s1b2b13" style="color: rgb(0, 51, 204);display: none;" even_steven="19">Incorrect!</div>
<div id="sfbk2b13" style="color: rgb(0, 51, 204);display: none;"><div id="tafeedback2b13" class="block" style="display:block">
</div></div>
</div>

<div class="question">

<br/><br/><div id="taquestion3b13" class="block" style="display:block"><span style="color: #000000; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; background-color: #ffffff; display: inline ! important; float: none">4: In entity attribute modelling a many to many relationship is represented by M:M.</span>

</div><br/>True <input type="radio" name="option3b13" id="true3b13" onclick="getFeedback(0,2,'3b13','truefalse')"/> 

False <input type="radio" name="option3b13" id="false3b13" onclick="getFeedback(1,2,'3b13','truefalse')"/>

<div id="s0b3b13" style="color: rgb(0, 51, 204);display: none;" even_steven="19">Incorrect! </div>
<div id="s1b3b13" style="color: rgb(0, 51, 204);display: none;" even_steven="18">Correct! </div>
<div id="sfbk3b13" style="color: rgb(0, 51, 204);display: none;"><div id="tafeedback3b13" class="block" style="display:block">

</div></div></div></div></div></div></div></div>
</body></html>

My XSLT-

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <!-- Import the identity transformation. -->
      <xsl:import href="identity.xsl"/>

      <xsl:template match="@onclick">

      </xsl:template>
      <xsl:template match="@style"/>

      <xsl:template match="input">
        <xsl:element name="input">
          <xsl:attribute name="type">submit</xsl:attribute>
          <xsl:attribute name="name">submitB</xsl:attribute>
          <xsl:attribute name="value">Submit</xsl:attribute>
          <xsl:apply-templates />
        </xsl:element>
      </xsl:template>

    </xsl:stylesheet>

COMPLETE DESIRED FILE [2]-

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>eXe</title>
<meta http-equiv="Content-Type" content="text/html;  charset=utf-8" />
<style type="text/css">
@import url(base.css);
@import url(content.css);
</style>
<script type="text/javascript" src="common.js"></script>
</head>

<script type="text/javascript" src="APIWrapper.js"></script>
<script type="text/javascript" src="SCOFunctions.js"></script>

<body onload="loadPage()" onunload="unloadPage()"><div id="outer">
<div id="main">

<div id="nodeDecoration">
<p id="nodeTitle">
Part 2</p></div>
<div class="QuizTestIdevice" id="id10">

<script type="text/javascript" src="calculate.js"></script>

<form name="quizForm10" id="quizForm10" action="javascript:calcScore2();">
<div class="iDevice emphasis1">
<img alt="" class="iDevice_icon" src="icon_question.gif" />
<span class="iDeviceTitle">SCORM Quiz</span>
<div class="iDevice_inner">
<div class="passrate" value="50"></div>

<div class="question">
<div id="taquestion0b10" class="block" style="display:block">1: Can a table have more than one primary key?
</div><br/>

<table><tr><td><input type="radio" name="key0b10" value="0" />
</td><td>
<div id="taoptionAnswer0q0b10" class="block" style="display:block">True
</div></td></tr>
<tr><td><input type="radio" name="key0b10" value="1" />
</td><td>
<div id="taoptionAnswer1q0b10" class="block" style="display:block">False
</div></td></tr>
</table></div>

<br/><div class="question">
<div id="taquestion1b10" class="block" style="display:block"><span class="Ques">2: A row in a database can also be called a domain.
</span>
</div><br/>
<table><tr><td><input type="radio" name="key1b10" value="0" />
</td><td>
<div id="taoptionAnswer0q1b10" class="block" style="display:block">True
</div></td></tr>
<tr><td><input type="radio" name="key1b10" value="1" />
</td><td>
<div id="taoptionAnswer1q1b10" class="block" style="display:block">False
</div></td></tr>
</table></div>

<br/><div class="question">
<div id="taquestion2b10" class="block" style="display:block"><span class="Ques">3: In an OO database objects may inherit some or all of the characteristics of other objects.
</span>
</div><br/>
<table><tr><td><input type="radio" name="key2b10" value="0" />
</td><td>
<div id="taoptionAnswer0q2b10" class="block" style="display:block">True
</div></td></tr>
<tr><td><input type="radio" name="key2b10" value="1" />
</td><td>
<div id="taoptionAnswer1q2b10" class="block" style="display:block">False
</div></td></tr>
</table></div>

<br/><div class="question">
<div id="taquestion3b10" class="block" style="display:block"><span class="Ques">4: In entity attribute modelling a many to many relationship is represented by M:M.</span>
</div><br/>
<table><tr><td><input type="radio" name="key3b10" value="0" />
</td><td>
<div id="taoptionAnswer0q3b10" class="block" style="display:block">True
</div></td></tr>
<tr><td><input type="radio" name="key3b10" value="1" />
</td><td>
<div id="taoptionAnswer1q3b10" class="block" style="display:block">False
</div></td></tr>
</table></div>

<br/><input type="submit" name="submitB" value="SUBMIT ANSWERS"/>
</div></div>
</form>
</div></div></div>
</body></html>
  • 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-07T18:58:21+00:00Added an answer on June 7, 2026 at 6:58 pm

    Everything you read about transforming XML using XSLT is applicable to transforming XHTML, because XHTML is XML. It’s hard to see what’s difficult about your problem, other than working out how general the solution needs to be: is this the only document that needs to be transformed (if so, why not use a text editor?) or are there others that are similar, and if so how much do they differ?

    The general approach to writing a transformation that copies most things but deletes a few things is to write two template rules: a general identity template that copies things you want to copy, and a special rule that matches the things you want to delete.

    See here for variations on the theme:

    http://www.dpawson.co.uk/xsl/sect2/identity.html

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

Sidebar

Related Questions

Have two folders with approx. 150 java property files. In a shell script, how
I have two classes (MVC view model) which inherits from one abstract base class.
I have two pages one is the main page and the another one is
Here I have a two files. One for forms and second php for getting
I have two similar pages, one named index.xhtml and one named index_old.xhtml both in
I have two files: groundup.xml and groundup.xslt. groundup.xml: <content> <root> <housing_option_name>The first name</housing_option_name> <housing_option_headline>Live
I would like to have two .css files. One for each master\content page and
Have two actionsheet buttons and one modalviewcontroller on mainviewcontroller in application. Now for two
I have two files client.php and server.php. The client file send a HTTP request
I have two files. I want to create pdf with these two files. does

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.