logo       

RE: XML to HTML... dynamic table headers from element names: msg#01448

Subject: RE: XML to HTML... dynamic table headers from element names
Happy to help when I can.  Similar thing again, just make small change so
that its for all rows, for all data.


<tr>
<xsl:for-each select="Table[1]/*">
        <td><xsl:value-of select="local-name()"/></td>
</xsl:for-each>
</tr>
<xsl:for-each select="Table">
        <tr>
                <xsl:for-each select="*">
                        <td><xsl:value-of select="." /></td>
                </xsl:for-each>
        </tr>
</xsl:for-each>




-----Original Message-----
From: Alan K. Gay [mailto:alan@xxxxxxxxxxxx]
Sent: Wednesday, October 30, 2002 10:49 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] XML to HTML... dynamic table headers from element
names


Tx ... got that working... would you be willing to help me then loop
back through all the tables to get the data?  

You effectively solved a problem I hadn't mentioned, which is the
variable number of children within <table> and the variable children
names.  Spy designer doesn't do variable element names (all hard-coded
from schema) so I haven't learned this piece yet (Books on the way from
Amazon.)

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Adam Griffin
Sent: Wednesday, October 30, 2002 3:15 PM
To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
Subject: RE: [xsl] XML to HTML... dynamic table headers from element
names

something to the effect of... see below ... should work. (only first row
of
data, read their names) this would eliminate the need for position test
of
if block.

-adam

<tr>
<xsl:for-each select="Table[1]/*">
        <xsl:value-of select="local-name()"/>
</xsl:for-each>
</tr>



-----Original Message-----
From: Alan K. Gay [mailto:alan@xxxxxxxxxxxx]
Sent: Wednesday, October 30, 2002 2:56 PM
To: XSLT List
Subject: [xsl] XML to HTML... dynamic table headers from element names


Just getting my feet wet. using XMLSpy stylesheet designer to help
guide.   I'm converting XML to HTML, which is Microsoft's recommended
way of controlling the import of XML into Excel.  I've got the
stylesheet below in productive use.  However, I want to make one key
change. I want the name of XML elements to become the text column
headings so I can deal with files that have dynamic column names.

Suggestions appreciated.     

Here is typical XML:
<NewDataSet>
        <Table>
                <Name>Linda Britt</Name>
                <RFQCount>324</RFQCount>
                <RFQResponseCount>556</RFQResponseCount>
        </Table>
</NewDataSet>




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

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




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
region.costa-ri...    user-groups.lin...    lang.prothon.us...    xfree86.cvs/200...    finance.aqbanki...    ietf.smtp/1993-...    web.turbogears....    jakarta.cactus....    yellowdog.gener...    php.gtk+.genera...    org.region.indo...    hurd.l4/2005-10...    culture.religio...    apple.fink.gene...    db.mysql.window...    bluez.devel/200...    security.pgp-ba...    video.blender.d...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe