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

Format & display from two xml files

Subject: Format & display from two xml files
From: "Sindigi, Ganesh K" <SindiGK@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 24 Dec 2003 14:49:13 -0700
fieldgroup html
Hello,

I have two xml documents, first one contains titles/headers  
for the data in second file.  
The first file contains order in which data/fields needs to be displayed. 
 I have no control on the both of the input sources.
The size of data file could be in 10s of MB.

The data needs to be shown as HTML table format with headers 
& orders from first file.  
This table could contain nested tables which is determined by 
attribute rowCount of element fieldGroup.

I need to come up with an XSL to achieve both 
- have control on alignment of html-tables
- have control on order of data displayed

I am finding it difficult to align the titles columns with the data
displayed.  
All the column headers are coming in first data column and subsequent data 
columns do not have headers, as these two are formed from two different 
sources and html-tables inside a td are not able to align with subsequent
data td's.

Please suggest me how I could achieve this. 

Thanks,
Ganesh.

Here is XML titles document, source1:

<?xml version="1.0" encoding="UTF-8"?>
<customerList>
   <customer>
      <field> <id>customerId</id> <title>Customer Id</title> </field>
      <field> <id>customerName</id> <title>Customer Name</title></field>
      <fieldGroup rowcount="1">
         <id>homeAddress</id> <title>Home Address</title>
         <fieldList>
            <field> <id>street</id> <title>Street</title> </field>
            <field> <id>city</id> <title>City</title> </field>
         </fieldList>
      </fieldGroup>
      <fieldGroup rowCount="n">
         <id>companyAddress</id> <title>Company Address</title>
         <fieldList>
            <field> <id>street</id> <title>Street</title> </field>
            <field> <id>city</id> <title>City</title> </field>
         </fieldList>
      </fieldGroup>
   </customer>
</customerList>


Here is XML data document, source2:

<?xml version="1.0" encoding="UTF-8"?>
<customerList>
   <customer>
      <field> <id>customerName</id> <value>Customer 1</value></field>
      <field> <id>customerId</id> <value>cust1</value> </field>
      <fieldGroup>
         <id>homeAddress</id>
         <fieldList>
            <field> <id>street</id> <value>98th Street </value></field>
            <field> <id>city</id> <value>Chicago</value></field>
         </fieldList>
      </fieldGroup>
      <fieldGroup>
         <id>companyAddress</id>
         <fieldList>
            <field> <id>street</id> <value>128th Street</value></field>
            <field> <id>city</id> <value>Chicago</value></field>
         </fieldList>
      </fieldGroup>
      <fieldGroup>
         <id>companyAddress</id>
         <fieldList>
            <field> <id>street</id> <value>16th Street</value></field>
            <field> <id>city</id> <value>NY</value></field>
         </fieldList>
      </fieldGroup>
   </customer>...
</customerList>

Desired Output html:

----------------------------------------------------------------------------
-
Customer Id	Customer Name	  Home Address		  Company Address

					Street      City
Street     	City
----------------------------------------------------------------------------
-
cust1		Customer 1		98thStreet Chicago 	128th Street
Chicago
	
---------------------
									16th
Street   NY
----------------------------------------------------------------------------
-
cust2		Customer 2		98thStreet Chicago 	128th Street
Chicago
	
---------------------
									16th
Street   NY
	
---------------------
									16th
Street   NJ

 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.