Re: [xsl] XSL Newbie: How2 write transforms for variable XML

Subject: Re: [xsl] XSL Newbie: How2 write transforms for variable XML
From: omprakash.v@xxxxxxxxxxxxx
Date: Fri, 28 Jan 2005 09:06:36 +0530
Hi Joe,
         You are right. There are ways to write stylesheets for limited
variability in xml content. Again, you are right in saying that there would
have to be some meta data available before what you mention below can be
accomplished. Alternately, you can try a templating mechanism where all the
column names are read in from a text file probably through an extension
mechanism at runtime though I haven't personally tried this approach. If
you would like to add formatting elements to your stylesheet, then XSL-FO
would be your best bet as XSL-FO allows rendering a input xml document to
be rendered in multiple output media like print, browser, eBook etc.,

Regards,
Omprakash.V





I'm sure there is some way to create XSL that can work for limited
variability in XML content.

Simple example, consider a report that yields columnar data in which the
columns in the report will vary - which columns and their order:

Sample1.xml
<data>
<row>
    <attrA>red</attrA>
    <attrB>128</attrB>
</row>
</data>

Sample2.xml
<data>
<row>
    <attrC>foo</attrC>
    <attrX>12.00</attrX>
    <attrB>128</attrB>
</row>
</data>

I want to know how I can develop XSL to handle the data without
hard-coding selects for specific names (attrA, attrB, attrC, attrD).
Additionally, I want to be able to define rules for each column. Like
justification, color, bold, etc. - would this be some kind of meta-data
or processing instructions?

Any suggestions would be greatly appreciated.

Forgive me if this is well understood, I could not find anything in the
archive 'cause I was probably not searching for the right keywords.

--
Joe Weder
Senior Software Developer/Architect
Intelligent Computer Systems
A Division of Global Beverage Group
717.295.7977 ext 614
www.gbg.com




















                                                                                                                   
                    Joe Weder                                                                                      
                    <jweder@xxxxx        To:     xsl-list@xxxxxxxxxxxxxxxxxxxxxx                                   
                    om>                  cc:     (bcc: omprakash.v/Polaris)                                        
                                         Subject:     [xsl] XSL Newbie: How2 write transforms for variable XML     
                    01/28/2005                                                                                     
                    01:55 AM                                                                                       
                    Please                                                                                         
                    respond to                                                                                     
                    xsl-list                                                                                       
                                                                                                                   
                                                                                                                   




I'm sure there is some way to create XSL that can work for limited
variability in XML content.

Simple example, consider a report that yields columnar data in which the
columns in the report will vary - which columns and their order:

Sample1.xml
<data>
<row>
    <attrA>red</attrA>
    <attrB>128</attrB>
</row>
</data>

Sample2.xml
<data>
<row>
    <attrC>foo</attrC>
    <attrX>12.00</attrX>
    <attrB>128</attrB>
</row>
</data>

I want to know how I can develop XSL to handle the data without
hard-coding selects for specific names (attrA, attrB, attrC, attrD).
Additionally, I want to be able to define rules for each column. Like
justification, color, bold, etc. - would this be some kind of meta-data
or processing instructions?

Any suggestions would be greatly appreciated.

Forgive me if this is well understood, I could not find anything in the
archive 'cause I was probably not searching for the right keywords.

--
Joe Weder
Senior Software Developer/Architect
Intelligent Computer Systems
A Division of Global Beverage Group
717.295.7977 ext 614
www.gbg.com






This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. 
If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately.
You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification,
distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited.

Visit Us at http://www.polaris.co.in

Current Thread