XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Duplicate Ouput on Repeating E... (2)
-> + How to canculate grand total. (3)
-> + Displaying two xml files toget... (2)
-> + Replace xml attribs vals with ... (2)
-> + check mark - font problem? (5)
-> + Xml to XML with XSLT (Remove) (10)
-> + Problem viewing xml as html wi... (4)
-> + Need to create lunk through XM... (2)
-> - Pagination with xslt (1)
-> + Transform to text using xslt (5)
-> + Rotating text using XSL FO (2)
-> + XSL -- Trim blanks from a vari... (3)
-> + dynamic matching (4)
-> + XSL:key for each condition - p... (5)
-> + XSL does not sort (5)
-> + CAN i CREATE INTERMEDIATE XML ... (2)
-> - Xml to html conversion (3)
-> ->Xml to html conversion
-> ->Xml to html conversion
-> + Using Xpath against Variables ... (9)
-> + XML-22004: (Fatal Error) Error... (10)
-> + Current page number (3)
-- Previous [1381-1400] [1401-1420] [1421-1440] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
priya narayanSubject: Xml to html conversion
Author: priya narayan
Date: 17 Jul 2006 05:06 PM
Hi,

I am novice to xslt and was looking for some good solution to a problem. I have an xml file that is generated dynamically and randomly. User can select what columns of the xml should be outputed.

example:
<XML_Ds>
<Table>
<Col1>column 1</Col1>
<Col2>column 2</Col2>
<Col3>column 3</Col3>
</Table>
<Table>
.....
</Table>
</XML_Ds>

There can also be some other XML file with 5 coulmns and with different column names. Depending on the columns selected by the user, I want to pass the columns as parameters and process the xml file so that only coulmns user needs is displayed.

It would be really great if you guys can provide me some ideas about how a generic solution can be developed.

Thanks,
Priya

Postnext
Ivan PedruzziSubject: Xml to html conversion
Author: Ivan Pedruzzi
Date: 17 Jul 2006 10:56 PM
Hi Priya,

Attached you can find one of many possible solutions.

To keep the code simple and XSLT 1.0 compliant, you will need to format the parameter value as
list of column names separated by space, also the list needs to start and to end with a space.


Hope this helps
Ivan Pedruzzi
Stylus Studio Team


Documentcolumns.zip

Posttop
priya narayanSubject: Xml to html conversion
Author: priya narayan
Date: 18 Jul 2006 11:50 AM
Hi,

Thanks for the solution. I also have couple more question for you.

1) I also want to add header columns in the table and let's say that the header columns are in some delimited strings like below

<xsl:param name="columns" select="'$header1$header2$header3$'" />

If want it to be displayed as
<head>
<th><td>header1</td></th>
<th><td>header2</td></th>
<th><td>header3</td></th>
</head>

2) In your attached document, can I use someparameter for node set XML_Ds/Table instead of hardcoding in the xsl file.
<xsl:for-each select="XML_Ds/Table">

Thanks very much for your help.
- Priya

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.