You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Vasanth Kumar Kumarswamy <va...@wipro.com> on 2000/11/02 04:07:25 UTC

Help required in extracting the tag names from XML to put in data portion of HTML

Hi,

Subject : Help required in extracting the tag names from XML to put in data
portion of HTML

We are facing a problem in converting an XML document to HTML Document using
XSL style sheets.
We have converted it to HTML without column headings.
(It is required to extract the tag names(column-1, column-2, column-3)  into
<TH>column-1</TH>...
tags in the HTML output.

The sample XML will be as follows :

xml Structure :

<table_name>
   <Record>
       <column-1>Data1</column-1>
       <column-2>Data2</column-2>
       <column-3>Data3</column-3>
   </Record>
   . . .
  </table_name>

We require the HTML Layout as follows :

HTML Structure:

<HTML>
 <HEAD>
  table_name
 </HEAD>
  <BODY>
     <TABLE>
        <TH>column-1</TH>
        <TH>column-2</TH>
        <TH>column-3</TH>
        <TR>
            <TD>Data1</TD>
            <TD>Data2</TD>
            <TD>Data3</TD>
       </TR>
     </TABLE>
  </BODY>
</HTML>

We will be verymuch thankful if anyone provide us a solution.


Regards
Vasanth



Re: Help required in extracting the tag names from XML to put in data portion of HTML

Posted by "Peter B. West" <pb...@powerup.com.au>.
Vasanth,

This is really a question for the xsl-list@mulberrytech.com.  I imagine
you would be referred to the spec, a good book and the FAQ.

You have not said that the tags will be constant from record to record,
but I assume that is the case.

The attached file works on that assumption.

Peter


Vasanth Kumar Kumarswamy wrote:
> 
> Hi,
> 
> Subject : Help required in extracting the tag names from XML to put in data
> portion of HTML
> 
> We are facing a problem in converting an XML document to HTML Document using
> XSL style sheets.
> We have converted it to HTML without column headings.
> (It is required to extract the tag names(column-1, column-2, column-3)  into
> <TH>column-1</TH>...
> tags in the HTML output.
> 
> The sample XML will be as follows :
> 
> xml Structure :
> 
> <table_name>
>    <Record>
>        <column-1>Data1</column-1>
>        <column-2>Data2</column-2>
>        <column-3>Data3</column-3>
>    </Record>
>    . . .
>   </table_name>
> 
> We require the HTML Layout as follows :
> 
> HTML Structure:
> 
> <HTML>
>  <HEAD>
>   table_name
>  </HEAD>
>   <BODY>
>      <TABLE>
>         <TH>column-1</TH>
>         <TH>column-2</TH>
>         <TH>column-3</TH>
>         <TR>
>             <TD>Data1</TD>
>             <TD>Data2</TD>
>             <TD>Data3</TD>
>        </TR>
>      </TABLE>
>   </BODY>
> </HTML>
> 
> We will be verymuch thankful if anyone provide us a solution.
> 
> Regards
> Vasanth

-- 
Peter B. West  pbwest@powerup.com.au  http://powerup.com.au/~pbwest
"Lord, to whom shall we go?"