[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Number of scans required ??

Subject: RE: Number of scans required ??
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Thu, 7 Aug 2003 16:37:51 +0100
RE:  Number of scans required ??
> 
> I am trying to put the name of the elements which corresponds 
> to table or 
> column names in my database as my topmost line the output txt file.
> 
> Then i have to get the data for all columns and these files 
> are big i.e. 
> average 20 MBS.
> 
> SO DO I REQUIRE TO HAVE TWO SCANS FOR THIS ?? OR IS IT 
> POSSIBLE TO ACHIEVE IT 
> IN ONE SCAN ??

You haven't shown your document structure so I'm making guesses here.

If all the column names are present in the first row, then you can
output them as, for example,

<xsl:for-each select="row[1]/*">
<th><xsl:value-of select="name(.)"/></th>
</xsl:for-each>

Any half-decent XSLT processor will be able to do this without scanning
the whole document.


<
> 
> And in both the cases, I would be able to append the output 
> of second scan to 
> the first using insertion operation i.e. something like ">>" 
> or is there some 
> other way to do this ?
>

No, you don't want to use text concatenation for this. Think of it as
building a result tree, with the structure:

TABLE
  HEADING
    COLUMN1
    COLUMN2
  BODY
    ROW1
      CELL1,1
      CELL1,2 

and then serializing this result tree as text.

Michael Kay



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.