Solved

Counting lines in XML/XSL

Posted on 2000-04-26
2
286 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
Comment Utility
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
Comment Utility
you can use three table , first table include two tabke inside it,
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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. 
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now