Solved

Counting lines in XML/XSL

Posted on 2000-04-26
2
318 Views
Last Modified: 2006-11-17
I want to display a mobile phone bill.  The data is displayed in 2 columns.  Column 1 displays the first 50 lines and then I want to continue in column 2.
What is the best way to do this?
0
Comment
Question by:fiona_freeman
2 Comments
 
LVL 10

Expert Comment

by:makerp
ID: 2750947
if your using xsl/xml then hold the phone bill in xml and use xsl to trasform it in to html

this appraoch only works in IE if done on the client. you can if ypou like use asp to trasform it on the server and then send it to the browser but this is a bit more involved.

basically to do it on the client you xml will be something like this.

<BILL>
     <ITEM>
           <NUMBER>7878</NUMBER>
           <COST>89.76</COST>
     </ITEM>
     <ITEM>
           <NUMBER>788444</NUMBER>
           <COST>489.76</COST>
     </ITEM>
</BILL>

and then your xsl something like this, this will go through your xml and transform it

<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  <xsl:template match="/">
  <TABLE>
  <xsl:for-each select="BILL/ITEM">
  <TR>
      <TD><xsl:value-of select="NUMBER"/></TD>
      <TD><xsl:value-of select="COST"/></TD>
  </TR>
  </xsl:for-each>
  </TABLE>
</xsl:template>
</xsl:stylesheet>

finally the actual bit that makes it work.

in you html page you have two refernces , one to the xml and one to the xsl

like this

<XML ID=xmlobject SRC=your.xml>
<XML ID=xslobject SRC=your.xsl>

then a div tag that the trasformed output will go into

<DIV ID=mydiv></DIV>

then a vbscript trasformnode to populate the div

<SCRIPT>
    mydiv.InnerHTML = xslobject.TransformNode(xmlobject.XMLDocument)
</SCRIPT>
0
 
LVL 1

Accepted Solution

by:
kwq5421 earned 50 total points
ID: 2771657
you can use three table , first table include two tabke inside it,
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C# Delete from XML 10 47
Unable to resolve XML http request 4 98
XSLT: how to increment number value if attribute present 4 46
TSQL query to generate xml 4 46
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

791 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