Question about create pivot table in xslt
Question posted by: Lee
(Guest)
on
June 1st, 2007 12:25 AM
I have a xml file, here is sample part:
<?xml version="1.0" encoding="UTF-8"?>
<ProducsList>
<Product id="1">
<SpecList>
<Spec>
<SpecLabel>Height</SpecLabel>
<SpecValue>10</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Width</SpecLabel>
<SpecValue>6</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Weight</SpecLabel>
<SpecValue>20.5</SpecValue>
<SpecCat>Weigth</SpecCat>
</Spec>
</SpecList>
</Prodcut>
<Product id="2">
<SpecList>
<Spec>
<SpecLabel>Height</SpecLabel>
<SpecValue>8</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Width</SpecLabel>
<SpecValue>5</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Weight</SpecLabel>
<SpecValue>18</SpecValue>
<SpecCat>Weigth</SpecCat>
</Spec>
</SpecList>
</Prodcut>
<Product id="3">
<SpecList>
<Spec>
<SpecLabel>Height</SpecLabel>
<SpecValue>5</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Width</SpecLabel>
<SpecValue>2</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Weight</SpecLabel>
<SpecValue>10</SpecValue>
<SpecCat>Weigth</SpecCat>
</Spec>
</SpecList>
</Prodcut>
</ProductsList>
I need to create a table look like that based on that xml file:
----------------------------------------------------
Label Product 1 product 2 product 3
----------------------------------------------------
Height 10 8 5
Width 6 5 2
Weight 20.5 18 10
I am totally losed, I don't know how to create that table. any one has
any idea about that? thank you very much.
Also how many Spec in SpecList is unkown.
Thanks for the help.
14
Answers Posted
Lee wrote:
Quote:
Originally Posted by
I am totally losed, I don't know how to create that table. any one has
any idea about that? thank you very much.
Break it down into parts. Express it in English -- or whatever language
you're most comfortable in -- and then use that as a guide to writing
the XSLT.
1) Pick one line of the table. How do you retrieve all the values needed
for that line? (Hint: You'll need to use a predicate.) What do you want
to surround those values with in order to display them in that line? (If
you're producing an HTML table, that would be <tdelements.) What does
the line have to be surrounded with to make it display as a line? (If
you're producing HTML, that would be a <trelement.)
2) Repeat for the other lines of the table.
3) What do you need to surround the lines with in order to display the
table? (If you're producing HTML, that would be a <tableelement.)
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Joe,
Thanks a lot for your reply. I am pretty new to xslt, so I don't quite
understand what you mean. do you have any sample codes for that?
Thanks again.
On May 31, 4:44 pm, Joe Kesselman <keshlam-nos...@comcast.netwrote:
Quote:
Originally Posted by
Lee wrote:
Quote:
Originally Posted by
I am totally losed, I don't know how to create that table. any one has
any idea about that? thank you very much.
>
Break it down into parts. Express it in English -- or whatever language
you're most comfortable in -- and then use that as a guide to writing
the XSLT.
>
1) Pick one line of the table. How do you retrieve all the values needed
for that line? (Hint: You'll need to use a predicate.) What do you want
to surround those values with in order to display them in that line? (If
you're producing an HTML table, that would be <tdelements.) What does
the line have to be surrounded with to make it display as a line? (If
you're producing HTML, that would be a <trelement.)
>
2) Repeat for the other lines of the table.
>
3) What do you need to surround the lines with in order to display the
table? (If you're producing HTML, that would be a <tableelement.)
>
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Lee wrote:
Quote:
Originally Posted by
Thanks a lot for your reply. I am pretty new to xslt, so I don't quite
understand what you mean. do you have any sample codes for that?
If you're asking that general a question, it sounds like you really need
to start by reading some XSLT tutorials. See my 5/29 post to the
"Transforming xhtml with xslt" thread for a list of good places to look
for information. In particular, IBM's site has many good tutorials and
articles, and the XSLT FAQ website has many examples worth studying.
See also http://www.catb.org/~esr/faqs/smart-questions.html -- I'm sure
you didn't intend it, but your question reads entirely too much like
"please do my homework assignment for me."
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
On May 31, 5:33 pm, Joe Kesselman <keshlam-nos...@comcast.netwrote:
Quote:
Originally Posted by
Lee wrote:
Quote:
Originally Posted by
Thanks a lot for your reply. I am pretty new to xslt, so I don't quite
understand what you mean. do you have any sample codes for that?
>
If you're asking that general a question, it sounds like you really need
to start by reading some XSLT tutorials. See my 5/29 post to the
"Transforming xhtml with xslt" thread for a list of good places to look
for information. In particular, IBM's site has many good tutorials and
articles, and the XSLT FAQ website has many examples worth studying.
>
See alsohttp://www.catb.org/~esr/faqs/smart-questions.html-- I'm sure
you didn't intend it, but your question reads entirely too much like
"please do my homework assignment for me."
>
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Joe,
Thanks for the reply.
On May 31, 5:33 pm, Joe Kesselman <keshlam-nos...@comcast.netwrote:
Quote:
Originally Posted by
Lee wrote:
Quote:
Originally Posted by
Thanks a lot for your reply. I am pretty new to xslt, so I don't quite
understand what you mean. do you have any sample codes for that?
>
If you're asking that general a question, it sounds like you really need
to start by reading some XSLT tutorials. See my 5/29 post to the
"Transforming xhtml with xslt" thread for a list of good places to look
for information. In particular, IBM's site has many good tutorials and
articles, and the XSLT FAQ website has many examples worth studying.
>
See alsohttp://www.catb.org/~esr/faqs/smart-questions.html-- I'm sure
you didn't intend it, but your question reads entirely too much like
"please do my homework assignment for me."
>
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Anybody else can help me out with this question? I know my knowledge
about xsl are really poor, but it is imposible for me to learn all
those stuff in one day. I will take some time to learn it step by
step. but for this particular question, I really need people with
experience give me some clue on how to deal with it. Thanks a lot!
On May 31, 6:55 pm, Lee <lee.jenkins...@gmail.comwrote:
Quote:
Originally Posted by
On May 31, 5:33 pm, Joe Kesselman <keshlam-nos...@comcast.netwrote:
>
>
>
>
>
Quote:
Originally Posted by
Lee wrote:
Quote:
Originally Posted by
Thanks a lot for your reply. I am pretty new to xslt, so I don't quite
understand what you mean. do you have any sample codes for that?
>
Quote:
Originally Posted by
If you're asking that general a question, it sounds like you really need
to start by reading some XSLT tutorials. See my 5/29 post to the
"Transforming xhtml with xslt" thread for a list of good places to look
for information. In particular, IBM's site has many good tutorials and
articles, and the XSLT FAQ website has many examples worth studying.
>
Quote:
Originally Posted by
See alsohttp://www.catb.org/~esr/faqs/smart-questions.html--I'm sure
you didn't intend it, but your question reads entirely too much like
"please do my homework assignment for me."
>
Quote:
Originally Posted by
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
>
Anybody else can help me out with this question? I know my knowledge
about xsl are really poor, but it is imposible for me to learn all
those stuff in one day. I will take some time to learn it step by
step. but for this particular question, I really need people with
experience give me some clue on how to deal with it. Thanks a lot!- Hide quoted text -
>
- Show quoted text -
or anybody knows there are already some discussion on the similar
question? Please let me know what keywords I should use to search this
question. Thanks a lot.
or anybody knows there are already some discussion on the similar
Quote:
Originally Posted by
question?
I already mentioned the Filk FAQ website, among other resources. Google
Is Your Friend. Your homework is YOUR homework.
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Sorry, crossed threads; let me corrct that...
Quote:
Originally Posted by
or anybody knows there are already some discussion on the similar
question?
I already mentioned the XSLT FAQ website, among other resources. Google
Is Your Friend. You have a homework assignment.
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
See:
http://www.topxml.com/code/default....v20010226151246
Cheers,
Dimitre Novatchev
"Lee" <lee.jenkins.ca@gmail.comwrote in message
news:1180653377.445712.231260@p77g2000hsh.googlegr oups.com...
Quote:
Originally Posted by
>I have a xml file, here is sample part:
<?xml version="1.0" encoding="UTF-8"?>
<ProducsList>
<Product id="1">
<SpecList>
<Spec>
<SpecLabel>Height</SpecLabel>
<SpecValue>10</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Width</SpecLabel>
<SpecValue>6</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Weight</SpecLabel>
<SpecValue>20.5</SpecValue>
<SpecCat>Weigth</SpecCat>
</Spec>
</SpecList>
</Prodcut>
<Product id="2">
<SpecList>
<Spec>
<SpecLabel>Height</SpecLabel>
<SpecValue>8</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Width</SpecLabel>
<SpecValue>5</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Weight</SpecLabel>
<SpecValue>18</SpecValue>
<SpecCat>Weigth</SpecCat>
</Spec>
</SpecList>
</Prodcut>
<Product id="3">
<SpecList>
<Spec>
<SpecLabel>Height</SpecLabel>
<SpecValue>5</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Width</SpecLabel>
<SpecValue>2</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Weight</SpecLabel>
<SpecValue>10</SpecValue>
<SpecCat>Weigth</SpecCat>
</Spec>
</SpecList>
</Prodcut>
</ProductsList>
>
I need to create a table look like that based on that xml file:
>
----------------------------------------------------
Label Product 1 product 2 product 3
----------------------------------------------------
Height 10 8 5
Width 6 5 2
Weight 20.5 18 10
>
I am totally losed, I don't know how to create that table. any one has
any idea about that? thank you very much.
>
Also how many Spec in SpecList is unkown.
>
Thanks for the help.
>
On Jun 1, 5:59 am, "Dimitre Novatchev" <dimit...@tpg.com.auwrote:
Quote:
Originally Posted by
See:
>
http://www.topxml.com/code/default....v20010226151246
>
Cheers,
Dimitre Novatchev
>
"Lee" <lee.jenkins...@gmail.comwrote in message
>
news:1180653377.445712.231260@p77g2000hsh.googlegr oups.com...
>
>
>
Quote:
Originally Posted by
I have a xml file, here is sample part:
<?xml version="1.0" encoding="UTF-8"?>
<ProducsList>
<Product id="1">
<SpecList>
<Spec>
<SpecLabel>Height</SpecLabel>
<SpecValue>10</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Width</SpecLabel>
<SpecValue>6</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Weight</SpecLabel>
<SpecValue>20.5</SpecValue>
<SpecCat>Weigth</SpecCat>
</Spec>
</SpecList>
</Prodcut>
<Product id="2">
<SpecList>
<Spec>
<SpecLabel>Height</SpecLabel>
<SpecValue>8</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Width</SpecLabel>
<SpecValue>5</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Weight</SpecLabel>
<SpecValue>18</SpecValue>
<SpecCat>Weigth</SpecCat>
</Spec>
</SpecList>
</Prodcut>
<Product id="3">
<SpecList>
<Spec>
<SpecLabel>Height</SpecLabel>
<SpecValue>5</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Width</SpecLabel>
<SpecValue>2</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Weight</SpecLabel>
<SpecValue>10</SpecValue>
<SpecCat>Weigth</SpecCat>
</Spec>
</SpecList>
</Prodcut>
</ProductsList>
>
Quote:
Originally Posted by
I need to create a table look like that based on that xml file:
>
Quote:
Originally Posted by
----------------------------------------------------
Label Product 1 product 2 product 3
----------------------------------------------------
Height 10 8 5
Width 6 5 2
Weight 20.5 18 10
>
Quote:
Originally Posted by
I am totally losed, I don't know how to create that table. any one has
any idea about that? thank you very much.
>
Quote:
Originally Posted by
Also how many Spec in SpecList is unkown.
>
Quote:
Originally Posted by
Thanks for the help.- Hide quoted text -
>
- Show quoted text -
Dimitre,
Thank you very much for the reply. actually, I did find your page
yesterday by google, but for some reason I could not open it
yesterday, I am checking it right now. Thanks a lot!
On Jun 1, 5:59 am, "Dimitre Novatchev" <dimit...@tpg.com.auwrote:
Quote:
Originally Posted by
See:
>
http://www.topxml.com/code/default....v20010226151246
>
Cheers,
Dimitre Novatchev
>
"Lee" <lee.jenkins...@gmail.comwrote in message
>
news:1180653377.445712.231260@p77g2000hsh.googlegr oups.com...
>
>
>
Quote:
Originally Posted by
I have a xml file, here is sample part:
<?xml version="1.0" encoding="UTF-8"?>
<ProducsList>
<Product id="1">
<SpecList>
<Spec>
<SpecLabel>Height</SpecLabel>
<SpecValue>10</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Width</SpecLabel>
<SpecValue>6</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Weight</SpecLabel>
<SpecValue>20.5</SpecValue>
<SpecCat>Weigth</SpecCat>
</Spec>
</SpecList>
</Prodcut>
<Product id="2">
<SpecList>
<Spec>
<SpecLabel>Height</SpecLabel>
<SpecValue>8</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Width</SpecLabel>
<SpecValue>5</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Weight</SpecLabel>
<SpecValue>18</SpecValue>
<SpecCat>Weigth</SpecCat>
</Spec>
</SpecList>
</Prodcut>
<Product id="3">
<SpecList>
<Spec>
<SpecLabel>Height</SpecLabel>
<SpecValue>5</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Width</SpecLabel>
<SpecValue>2</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Weight</SpecLabel>
<SpecValue>10</SpecValue>
<SpecCat>Weigth</SpecCat>
</Spec>
</SpecList>
</Prodcut>
</ProductsList>
>
Quote:
Originally Posted by
I need to create a table look like that based on that xml file:
>
Quote:
Originally Posted by
----------------------------------------------------
Label Product 1 product 2 product 3
----------------------------------------------------
Height 10 8 5
Width 6 5 2
Weight 20.5 18 10
>
Quote:
Originally Posted by
I am totally losed, I don't know how to create that table. any one has
any idea about that? thank you very much.
>
Quote:
Originally Posted by
Also how many Spec in SpecList is unkown.
>
Quote:
Originally Posted by
Thanks for the help.- Hide quoted text -
>
- Show quoted text -
Dimitre,
I found you are using msxsl namespace, is that gonna be a problem for
none-microsoft browsers? Thanks.
On Jun 1, 11:33 am, Lee <lee.jenkins...@gmail.comwrote:
Quote:
Originally Posted by
On Jun 1, 5:59 am, "Dimitre Novatchev" <dimit...@tpg.com.auwrote:
>
>
>
>
>
Quote:
Originally Posted by
See:
>
>
Quote:
Originally Posted by
Cheers,
Dimitre Novatchev
>
Quote:
Originally Posted by
"Lee" <lee.jenkins...@gmail.comwrote in message
>
Quote:
Originally Posted by
news:1180653377.445712.231260@p77g2000hsh.googlegr oups.com...
>
Quote:
Originally Posted by
Quote:
Originally Posted by
>I have a xml file, here is sample part:
<?xml version="1.0" encoding="UTF-8"?>
<ProducsList>
<Product id="1">
<SpecList>
<Spec>
<SpecLabel>Height</SpecLabel>
<SpecValue>10</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Width</SpecLabel>
<SpecValue>6</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Weight</SpecLabel>
<SpecValue>20.5</SpecValue>
<SpecCat>Weigth</SpecCat>
</Spec>
</SpecList>
</Prodcut>
<Product id="2">
<SpecList>
<Spec>
<SpecLabel>Height</SpecLabel>
<SpecValue>8</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Width</SpecLabel>
<SpecValue>5</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Weight</SpecLabel>
<SpecValue>18</SpecValue>
<SpecCat>Weigth</SpecCat>
</Spec>
</SpecList>
</Prodcut>
<Product id="3">
<SpecList>
<Spec>
<SpecLabel>Height</SpecLabel>
<SpecValue>5</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Width</SpecLabel>
<SpecValue>2</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Weight</SpecLabel>
<SpecValue>10</SpecValue>
<SpecCat>Weigth</SpecCat>
</Spec>
</SpecList>
</Prodcut>
</ProductsList>
>
Quote:
Originally Posted by
Quote:
Originally Posted by
I need to create a table look like that based on that xml file:
>
Quote:
Originally Posted by
Quote:
Originally Posted by
----------------------------------------------------
Label Product 1 product 2 product 3
----------------------------------------------------
Height 10 8 5
Width 6 5 2
Weight 20.5 18 10
>
Quote:
Originally Posted by
Quote:
Originally Posted by
I am totally losed, I don't know how to create that table. any one has
any idea about that? thank you very much.
>
Quote:
Originally Posted by
Quote:
Originally Posted by
Also how many Spec in SpecList is unkown.
>
Quote:
Originally Posted by
Quote:
Originally Posted by
Thanks for the help.- Hide quoted text -
>
Quote:
Originally Posted by
- Show quoted text -
>
Dimitre,
>
I found you are using msxsl namespace, is that gonna be a problem for
none-microsoft browsers? Thanks.- Hide quoted text -
>
- Show quoted text -
Thank you guys, I finially figured out how to do it. at the very
beginning I thought I can't use param in for-each, so I don't event
try to use variable, acutually, variable is OK to use in for-each
loop. so my xslt file is here:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/
Transform">
<xsl:output method="html" />
<xsl:template match="/">
<html>
<body>
<table border="1">
<xsl:for-each select="/ProductList/Product[position()=1]/SpecList/
Spec">
<xsl:variable name="label" select="SpecLabel"></xsl:variable>
<tr>
<td>
<xsl:value-of select="$label"/>
</td>
<xsl:for-each select="/ProductList/Product">
<td>
<xsl:apply-templates select="SpecList/Spec/SpecLabel[.=
$label]"/>
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="SpecLabel">
<xsl:value-of select="../SpecValue"/>
</xsl:template>
</xsl:stylesheet>
Dimitre,
Quote:
Originally Posted by
>
I found you are using msxsl namespace, is that gonna be a problem for
none-microsoft browsers? Thanks.
>
No, but for another processor one would normally use the exslt:node-set()
extension function instead.
Just a few days ago Julian Reschke and David Carlisle discovered a
technique, which allows to specify exslt:node-set() in a way that it can be
used with the MSXML xslt processor:
http://dpcarlisle.blogspot.com/2007...t-function.html
Cheers,
Dimitre Novatchev
"Lee" <lee.jenkins.ca@gmail.comwrote in message
news:1180722830.686354.136140@u30g2000hsc.googlegr oups.com...
Quote:
Originally Posted by
On Jun 1, 5:59 am, "Dimitre Novatchev" <dimit...@tpg.com.auwrote:
Quote:
Originally Posted by
>See:
>>
> http://www.topxml.com/code/default....v20010226151246
>>
>Cheers,
>Dimitre Novatchev
>>
>"Lee" <lee.jenkins...@gmail.comwrote in message
>>
>news:1180653377.445712.231260@p77g2000hsh.googlegr oups.com...
>>
>>
>>
Quote:
Originally Posted by
>I have a xml file, here is sample part:
<?xml version="1.0" encoding="UTF-8"?>
<ProducsList>
<Product id="1">
<SpecList>
<Spec>
<SpecLabel>Height</SpecLabel>
<SpecValue>10</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Width</SpecLabel>
<SpecValue>6</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Weight</SpecLabel>
<SpecValue>20.5</SpecValue>
<SpecCat>Weigth</SpecCat>
</Spec>
</SpecList>
</Prodcut>
<Product id="2">
<SpecList>
<Spec>
<SpecLabel>Height</SpecLabel>
<SpecValue>8</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Width</SpecLabel>
<SpecValue>5</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Weight</SpecLabel>
<SpecValue>18</SpecValue>
<SpecCat>Weigth</SpecCat>
</Spec>
</SpecList>
</Prodcut>
<Product id="3">
<SpecList>
<Spec>
<SpecLabel>Height</SpecLabel>
<SpecValue>5</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Width</SpecLabel>
<SpecValue>2</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Weight</SpecLabel>
<SpecValue>10</SpecValue>
<SpecCat>Weigth</SpecCat>
</Spec>
</SpecList>
</Prodcut>
</ProductsList>
>>
Quote:
Originally Posted by
I need to create a table look like that based on that xml file:
>>
Quote:
Originally Posted by
----------------------------------------------------
Label Product 1 product 2 product 3
----------------------------------------------------
Height 10 8 5
Width 6 5 2
Weight 20.5 18 10
>>
Quote:
Originally Posted by
I am totally losed, I don't know how to create that table. any one has
any idea about that? thank you very much.
>>
Quote:
Originally Posted by
Also how many Spec in SpecList is unkown.
>>
Quote:
Originally Posted by
Thanks for the help.- Hide quoted text -
>>
>- Show quoted text -
>
On Jun 1, 11:33 pm, "Dimitre Novatchev" <dimit...@tpg.com.auwrote:
Quote:
Originally Posted by
Quote:
Originally Posted by
Dimitre,
>
Quote:
Originally Posted by
I found you are using msxsl namespace, is that gonna be a problem for
none-microsoft browsers? Thanks.
>
No, but for another processor one would normally use the exslt:node-set()
extension function instead.
>
Just a few days ago Julian Reschke and David Carlisle discovered a
technique, which allows to specify exslt:node-set() in a way that it can be
used with the MSXML xslt processor:
>
http://dpcarlisle.blogspot.com/2007...t-function.html
>
Cheers,
Dimitre Novatchev
>
"Lee" <lee.jenkins...@gmail.comwrote in message
>
news:1180722830.686354.136140@u30g2000hsc.googlegr oups.com...
>
>
>
Quote:
Originally Posted by
On Jun 1, 5:59 am, "Dimitre Novatchev" <dimit...@tpg.com.auwrote:
Quote:
Originally Posted by
See:
>
>
Quote:
Originally Posted by
Quote:
Originally Posted by
Cheers,
Dimitre Novatchev
>
Quote:
Originally Posted by
Quote:
Originally Posted by
"Lee" <lee.jenkins...@gmail.comwrote in message
>
Quote:
Originally Posted by
Quote:
Originally Posted by
>news:1180653377.445712.231260@p77g2000hsh.googlegr oups.com...
>
Quote:
Originally Posted by
Quote:
Originally Posted by
I have a xml file, here is sample part:
<?xml version="1.0" encoding="UTF-8"?>
<ProducsList>
<Product id="1">
<SpecList>
<Spec>
<SpecLabel>Height</SpecLabel>
<SpecValue>10</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Width</SpecLabel>
<SpecValue>6</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Weight</SpecLabel>
<SpecValue>20.5</SpecValue>
<SpecCat>Weigth</SpecCat>
</Spec>
</SpecList>
</Prodcut>
<Product id="2">
<SpecList>
<Spec>
<SpecLabel>Height</SpecLabel>
<SpecValue>8</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Width</SpecLabel>
<SpecValue>5</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Weight</SpecLabel>
<SpecValue>18</SpecValue>
<SpecCat>Weigth</SpecCat>
</Spec>
</SpecList>
</Prodcut>
<Product id="3">
<SpecList>
<Spec>
<SpecLabel>Height</SpecLabel>
<SpecValue>5</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Width</SpecLabel>
<SpecValue>2</SpecValue>
<SpecCat>Dimension</SpecCat>
</Spec>
<Spec>
<SpecLabel>Weight</SpecLabel>
<SpecValue>10</SpecValue>
<SpecCat>Weigth</SpecCat>
</Spec>
</SpecList>
</Prodcut>
</ProductsList>
>
Quote:
Originally Posted by
Quote:
Originally Posted by
I need to create a table look like that based on that xml file:
>
Quote:
Originally Posted by
Quote:
Originally Posted by
----------------------------------------------------
Label Product 1 product 2 product 3
----------------------------------------------------
Height 10 8 5
Width 6 5 2
Weight 20.5 18 10
>
Quote:
Originally Posted by
Quote:
Originally Posted by
I am totally losed, I don't know how to create that table. any one has
any idea about that? thank you very much.
>
Quote:
Originally Posted by
Quote:
Originally Posted by
Also how many Spec in SpecList is unkown.
>
Quote:
Originally Posted by
Quote:
Originally Posted by
Thanks for the help.- Hide quoted text -
>
Quote:
Originally Posted by
Quote:
Originally Posted by
- Show quoted text -- Hide quoted text -
>
- Show quoted text -
Dimitre,
Thanks a lot for the help. It is an interesting article. Thanks.
|
|
|
What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 197,020 network members.
Top Community Contributors
|