Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - table >Thread Next - Re: table Re: tableTo: NULL Date: 4/8/2005 7:23:00 AM I've been trying to get this to work for ages without success, I think
you're going to have to bite the bullet and reorganise your XML file so
that your values are stored in elements e.g.
<!-- In Xml file -->
<Account>
<FixedAssets>Value1</FixedAssets>
<StocksInventory>Value1</StocksInventory>
<Debtors>Value1</Debtors>
</Account>
<Account>
<FixedAssets>Value2</FixedAssets>
<StocksInventory>Value2</StocksInventory>
<Debtors>Value2</Debtors>
</Account>
This would make the table layout you are looking for relatively easy to
do.
It's not ideal but it would work!
a wrote:
> I'm trying to get a particular layout in a table. In the included
files, I
> have data that I want in a table where the simple element tags are
used as
> column headers and the values are aligned below the column header in
separate
> rows. What I keep getting is all the element values lined up under
the first
> column header. There are three elements, hence 3 values in each
column
> before the next template fills the next colum with 3 more
values...that's
> what I want anyway...like this...
>
> Header1 Header2
> Value1 Value1
> Value2 Value2
> Value3 Value3
>
> In my xml file it would look like this:
>
> FixedAssets StocksInventory
> 843000000 2000000
> 1408000000 2000000
> 1192000000 2000000
>
> Any ideas on how to solve this?
> Thanks,
>
> Paul
> ====================================================
> Here is the xml file:
> <?xml version="1.0" encoding="UTF-8"?>
> <?xml-stylesheet type="text/xsl" href="C:\Reuters.xslt"?>
> <xbrl xmlns="http://www.xbrl.org/2003/instance"
> xmlns:uk-gaap-ci="http://www.xbrl.org/uk/fr/gaap/ci/2004-05-15">
> <uk-gaap-ci:FixedAssets precision="INF" contextRef="cH104inst"
> unitRef="GBP">843000000</uk-gaap-ci:FixedAssets>
> <uk-gaap-ci:FixedAssets precision="INF" contextRef="cH103inst"
> unitRef="GBP">1408000000</uk-gaap-ci:FixedAssets>
> <uk-gaap-ci:FixedAssets precision="INF" contextRef="cFY03inst"
> unitRef="GBP">1192000000</uk-gaap-ci:FixedAssets>
> <uk-gaap-ci:StocksInventory precision="INF" contextRef="cH104inst"
> unitRef="GBP">2000000</uk-gaap-ci:StocksInventory>
> <uk-gaap-ci:StocksInventory precision="INF" contextRef="cH103inst"
> unitRef="GBP">2000000</uk-gaap-ci:StocksInventory>
> <uk-gaap-ci:StocksInventory precision="INF" contextRef="cFY03inst"
> unitRef="GBP">2000000</uk-gaap-ci:StocksInventory>
> <uk-gaap-ci:Debtors precision="INF" contextRef="cH104inst"
> unitRef="GBP">920000000</uk-gaap-ci:Debtors>
> <uk-gaap-ci:Debtors precision="INF" contextRef="cH103inst"
> unitRef="GBP">1369000000</uk-gaap-ci:Debtors>
> <uk-gaap-ci:Debtors precision="INF" contextRef="cFY03inst"
> unitRef="GBP">981000000</uk-gaap-ci:Debtors>
> </xbrl>
>
> ====================================================
> And the xslt:
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:n1="http://www.xbrl.org/2003/instance"
> xmlns:uk-gaap-ci="http://www.xbrl.org/uk/fr/gaap/ci/2004-05-15"
> xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
> xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes">
>
> <xsl:output version="1.0" encoding="UTF-8" indent="no"
> omit-xml-declaration="no" media-type="text/html"/>
> <xsl:template match="/">
> <html>
> <head>
> <title/>
> </head>
> <body>
> <br/>
>
> <table border="1">
> <thead>
> <tr>
> <td>FixedAssets</td>
> <td>Stocks Inventory</td>
> </tr>
> </thead>
> <tbody>
> <xsl:for-each select="n1:xbrl">
>
> <xsl:for-each select="uk-gaap-ci:FixedAssets">
> <tr>
> <td bgcolor="#FF0000">
> <xsl:apply-templates/>
> </td>
> </tr>
> </xsl:for-each>
>
> <xsl:for-each select="uk-gaap-ci:StocksInventory">
> <tr>
> <td bgcolor="blue">
> <xsl:apply-templates/>
> </td>
> </tr>
> </xsl:for-each>
>
> </xsl:for-each>
> </tbody>
> </table>
>
> </body>
> </html>
> </xsl:template>
> </xsl:stylesheet>
>
>
>
> Expand AllCollapse All
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
