Solved

HTML in .xsl file

Posted on 2009-05-06
9
333 Views
Last Modified: 2013-11-18
to display the html tags in .xsl file
---html file---
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<body>
 
	<div id="comment" class="hide">
    <div style="height:155px; overflow:auto; margin-bottom: 10px;">
    <table  border="0" cellspacing="0" cellpadding="0" class="formTbl">
      <tr>
        <td nowrap><label><strong>Ticket&nbsp;</strong><span class="txtLarge"><strong>&nbsp;</strong></span></label></td>
        
        <form name="Update">
  <select name="up">
	<option selected value="car">car</option>
                <option value="bike">bike</option>            
	          </select>
 
</form>
</body>
</html>
---------------I am try to display the same html as .xsl file----------------
 
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" omit-xml-declaration="yes"/>
 
<xsl:param name="Number" select="item"/>
<xsl:variable name="Count"><xsl:value-of select="item"/></xsl:variable>
 
<xsl:template match="/">
	
<xsl:template name="render">
	
	
		<div class="hide" id="comment">
		<div style="height:155px; overflow:auto; margin-bottom: 10px;">
			<table border="0" cellspacing="0" cellpadding="0" class="formTbl">
				<tr>
					<td colspan="2"><label><strong>Update</strong><span class="txtLarge"><strong>&#160;</strong></span></label></td>
				</tr>
				<tr>
				
					******[how to display html tags like form and dropdown box here]*****
					
					
					<td colspan="2"><textarea id="commentText" name="" cols="67" rows="6">comment</textarea>     </td>
					
				</tr>
				<tr>   
					<td><div class="input"><a href="#">
					Send</a></div><xsl:text>  </xsl:text></td>
					<td><span class='confirmMsg' style='display:none' id='commentSent'>
					<xsl:text>  </xsl:text><img src='c.gif' width='16' height='13' alt='message' /><xsl:text>   </xsl:text>></td>
				</tr>
			</table>
			</div>
		</div>
</xsl:template>
<xsl:template match="*"/>
</xsl:stylesheet>

Open in new window

0
Comment
Question by:mkarthik415
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 39

Assisted Solution

by:abel
abel earned 210 total points
ID: 24319871
yes, but what's the question? Are there problems with it? The code seems ok on first sight...
0
 
LVL 60

Assisted Solution

by:Geert Bormans
Geert Bormans earned 290 total points
ID: 24319895
You have a nested template inside a template, that is not allowed.
You should place your templates next to each other.

Why did you not continue in the other question by the way?
0
 
LVL 39

Assisted Solution

by:abel
abel earned 210 total points
ID: 24319915
hmm, I take that back, the XSLT is not valid... The xsl:templates are nested (not allowed) and the <span> is not terminated.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 60

Assisted Solution

by:Geert Bormans
Geert Bormans earned 290 total points
ID: 24319943
I made a possible fix for your stylesheet,

Can you please post a source XML and tell us what you exactly need because a lot of things will possibly gor wrong in this stylesheet
and I am not at all sure that a form is allowed inside a table row
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" omit-xml-declaration="yes"/>
    
    <xsl:param name="Number" select="item"/>
    <xsl:variable name="Count"><xsl:value-of select="item"/></xsl:variable>
    
    <xsl:template match="/">
        <xsl:call-template name="render"/>
    </xsl:template>
    
        <xsl:template name="render">
            
            
            <div class="hide" id="comment">
                <div style="height:155px; overflow:auto; margin-bottom: 10px;">
                    <table border="0" cellspacing="0" cellpadding="0" class="formTbl">
                        <tr>
                            <td colspan="2"><label><strong>Update</strong><span class="txtLarge"><strong>&#160;</strong></span></label></td>
                        </tr>
                        <tr>
                            
                            ******[how to display html tags like form and dropdown box here]*****
                            
                            
                            <td colspan="2"><textarea id="commentText" name="" cols="67" rows="6">comment</textarea>     </td>
                            
                        </tr>
                        <tr>   
                            <td><div class="input"><a href="#">
                                Send</a></div><xsl:text>  </xsl:text></td>
                            <td><span class='confirmMsg' style='display:none' id='commentSent'>
                                <xsl:text>  </xsl:text><img src='c.gif' width='16' height='13' alt='message' /><xsl:text>   </xsl:text>></span></td>
                        </tr>
                    </table>
                </div>
            </div>
        </xsl:template>
        <xsl:template match="*"/>
</xsl:stylesheet>

Open in new window

0
 

Author Comment

by:mkarthik415
ID: 24319960
I am trying to use same form and select tags from the html in to .xsl file above the text area.
0
 
LVL 39

Assisted Solution

by:abel
abel earned 210 total points
ID: 24319973
Hi Geert, on the same level as always? Was this related to that xsl-fo question?
0
 
LVL 39

Assisted Solution

by:abel
abel earned 210 total points
ID: 24319990
I' m off anyway, it is late here... C u l8r and good luck with the q. ;)
0
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 290 total points
ID: 24320024
Can you please phrase what you are trying to do?
You have an HTML, and now you want to construct the same HTML from an XML using XSLT?
Or is your question a bit confusing and do you mean that you want to generate what is in teh html, biut then in PDF using XSL-FO?

It is hard to work on this without
- source XML
- a clear indication of what the question exactly is
0
 
LVL 39

Expert Comment

by:abel
ID: 24375801
weird: no real question in the end, no real answer, and every comment is B-graded as (assisted) solution...

@mkarthik415: please read a few of the FAQ's, mainly: how to close, 10pts must principle at EE and splitting points.
0

Featured Post

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question