473,385 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Question about create pivot table in xslt

Lee
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.

May 31 '07 #1
14 5104
Lee wrote:
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
May 31 '07 #2
Lee
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:
Lee wrote:
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

Jun 1 '07 #3
Lee wrote:
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
Jun 1 '07 #4
Lee
On May 31, 5:33 pm, Joe Kesselman <keshlam-nos...@comcast.netwrote:
Lee wrote:
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.

Jun 1 '07 #5
Lee
On May 31, 5:33 pm, Joe Kesselman <keshlam-nos...@comcast.netwrote:
Lee wrote:
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!

Jun 1 '07 #6
Lee
On May 31, 6:55 pm, Lee <lee.jenkins...@gmail.comwrote:
On May 31, 5:33 pm, Joe Kesselman <keshlam-nos...@comcast.netwrote:


Lee wrote:
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!- 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.

Jun 1 '07 #7
or anybody knows there are already some discussion on the similar
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
Jun 1 '07 #8
Sorry, crossed threads; let me corrct that...
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
Jun 1 '07 #9
See:

http://www.topxml.com/code/default.a...20010226151246
Cheers,
Dimitre Novatchev
"Lee" <le************@gmail.comwrote in message
news:11**********************@p77g2000hsh.googlegr oups.com...
>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.

Jun 1 '07 #10
Lee
On Jun 1, 5:59 am, "Dimitre Novatchev" <dimit...@tpg.com.auwrote:
See:

http://www.topxml.com/code/default.a...20010226151246

Cheers,
Dimitre Novatchev

"Lee" <lee.jenkins...@gmail.comwrote in message

news:11**********************@p77g2000hsh.googlegr oups.com...
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.- 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!

Jun 1 '07 #11
Lee
On Jun 1, 5:59 am, "Dimitre Novatchev" <dimit...@tpg.com.auwrote:
See:

http://www.topxml.com/code/default.a...20010226151246

Cheers,
Dimitre Novatchev

"Lee" <lee.jenkins...@gmail.comwrote in message

news:11**********************@p77g2000hsh.googlegr oups.com...
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.- 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.

Jun 1 '07 #12
Lee
On Jun 1, 11:33 am, Lee <lee.jenkins...@gmail.comwrote:
On Jun 1, 5:59 am, "Dimitre Novatchev" <dimit...@tpg.com.auwrote:


See:
http://www.topxml.com/code/default.a...20010226151246
Cheers,
Dimitre Novatchev
"Lee" <lee.jenkins...@gmail.comwrote in message
news:11**********************@p77g2000hsh.googlegr oups.com...
>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.- 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.- 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>

Jun 2 '07 #13
Dimitre,
>
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/...-function.html

Cheers,
Dimitre Novatchev

"Lee" <le************@gmail.comwrote in message
news:11**********************@u30g2000hsc.googlegr oups.com...
On Jun 1, 5:59 am, "Dimitre Novatchev" <dimit...@tpg.com.auwrote:
>See:

http://www.topxml.com/code/default.a...20010226151246

Cheers,
Dimitre Novatchev

"Lee" <lee.jenkins...@gmail.comwrote in message

news:11**********************@p77g2000hsh.googleg roups.com...
>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.- Hide quoted text -

- Show quoted text -

Jun 2 '07 #14
Lee
On Jun 1, 11:33 pm, "Dimitre Novatchev" <dimit...@tpg.com.auwrote:
Dimitre,
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/...-function.html

Cheers,
Dimitre Novatchev

"Lee" <lee.jenkins...@gmail.comwrote in message

news:11**********************@u30g2000hsc.googlegr oups.com...
On Jun 1, 5:59 am, "Dimitre Novatchev" <dimit...@tpg.com.auwrote:
See:
http://www.topxml.com/code/default.a...20010226151246
Cheers,
Dimitre Novatchev
"Lee" <lee.jenkins...@gmail.comwrote in message
>news:11**********************@p77g2000hsh.googleg roups.com...
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.- Hide quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -
Dimitre,

Thanks a lot for the help. It is an interesting article. Thanks.

Jun 7 '07 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rob | last post by:
I'm just getting around to using pivot tables and charts. I find the Pivot table interface to be INCREDIBLY frustrating. When I view a table in Design view, then choose Pivot table view, I get...
4
by: Ajay | last post by:
Hello all, I used to display reports in Excel earlier on my website. Now the client has requested that he would like see reports in Pivot table on the web . The backend is Sql2000. Can you please...
9
by: PeteCresswell | last post by:
I've got something called "Reference Rates". The idea is that on a given day, we have various rates of return for various entities. e.g. Libor 3-month return, Libor 6-month return, US Treasury...
0
by: salad | last post by:
I have A97 and A2003. I created a form using the Pivot Table wizard. This creates an unbound form with an embedded OLE object containing a Pivot table in Excel. There are 2 controls when the...
2
by: LittlePhil via AccessMonster.com | last post by:
Someone please help before i start to cry. I'm trying to export from Access to Excel, then create a new excel sheet with a pivot table to display the data held in columns A:P. I get the error...
0
by: ravindarjobs | last post by:
Hello friends, I am using ms access 2003, and Vb6. i am displaying a table in a form as pivot table (following "Auto Form: Pivot Table" Wizard) Usually i select the items i want to be...
7
by: Dave | last post by:
I'm stuck on something and I've been trying to find some examples on it. I'm trying to show the data to my users as such: year1 year2 Q1 Q2 Q1 Q2 Smith my dataset...
1
by: mld01s | last post by:
I really need help!!! I dont know if its possible to share pivot tables, or see pivot tables in other machines that the one where the tables were created. This is what happens: I created a...
2
by: Gary Dunne | last post by:
Hi All, I'm struggling to find the correct syntax for creating a Pivot table in an excel file via VB . Net 2005 The Excel help file is not particularly helpful where parameters are concerned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.