Altova User Forum


Important: this is not a Support Forum! Experienced users might answer from time to time questions posted here.
If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

How to put content in table cells Options · View
jodi
Posted: Tuesday, January 24, 2012 1:50:56 PM
Rank: Newbie

Joined: 1/24/2012
Posts: 6
Hello,

Just starting with Style Vision and yet I have a big show stopper.
Can any one help me.

It creates rows and columns as planned.
How can I fill the cells with content.

Kind regards

Jos
vlad
Posted: Tuesday, January 24, 2012 2:10:41 PM
Rank: Advanced Member

Joined: 12/13/2005
Posts: 2,479
Location: Mauritius
What is actually your problem? From the screenshot below it is difficult to says what is wrong.

If you attach here all your files with description what you want to see, than the chances increase a lot that somebody can help you.
jodi
Posted: Wednesday, January 25, 2012 10:16:21 AM
Rank: Newbie

Joined: 1/24/2012
Posts: 6
vlad wrote:
What is actually your problem? From the screenshot below it is difficult to says what is wrong.

If you attach here all your files with description what you want to see, than the chances increase a lot that somebody can help you.



Here more detail:

This is a piece of my xml

<table xsi:type="tabCliNwLft">
<nr>1.1a</nr>
<title>Cliëntkenmerken bij nieuw cliënttraject bij bureau jeugdzorg en aanvang onderzoek AMK</title>
<tableDescription/>
<col0Title>Leeftijd</col0Title>
<column index="1" title="Aantal jeugdigen met nieuw cliënttraject bij bureau jeugdzorg"/>
<column index="2" title="Aantal jeugdigen bij aanvang onderzoek AMK"/>
<row index="1" title="0 tot en met 5 jaar"/>
<row index="2" title="6 tot en met 11 jaar"/>
<row index="3" title="12 tot en met 14 jaar"/>
<row index="4" title="15 tot en met 17 jaar"/>
<row index="5" title="18 jaar en ouder"/>
<row index="6" title="Onbekend"/>
<row index="7" title="Totaal" isTotalRow="true"/>
<cell columnIndex="1" rowIndex="1" value="1817"/>
<cell columnIndex="1" rowIndex="2" value="1976"/>
<cell columnIndex="1" rowIndex="3" value="1102"/>
<cell columnIndex="1" rowIndex="4" value="1444"/>
<cell columnIndex="1" rowIndex="5" value="114"/>
<cell columnIndex="1" rowIndex="6" value="0"/>
<cell columnIndex="1" rowIndex="7" value="6453"/>
<cell columnIndex="2" rowIndex="1" value="0"/>
<cell columnIndex="2" rowIndex="2" value="0"/>
<cell columnIndex="2" rowIndex="3" value="0"/>
<cell columnIndex="2" rowIndex="4" value="0"/>
<cell columnIndex="2" rowIndex="5" value="0"/>
<cell columnIndex="2" rowIndex="6" value="0"/>
<cell columnIndex="2" rowIndex="7" value="0"/>
</table>

You can see the relevant xsd in the attachment.

Each table has dynamic columns and row.
For example, some tables have 2 columns, with 5 rows, other tables have 10 columns and 10 rows

Stylevision is able to generate tables with dynamic columns and rows.

But I'm not able to fill each cell.
How can I do that?
In the result attachment you see 'Content?'. But that needs to be filled bij the value property in the cell elements.


vlad
Posted: Wednesday, January 25, 2012 10:53:38 AM
Rank: Advanced Member

Joined: 12/13/2005
Posts: 2,479
Location: Mauritius
Normally, StyleVision can handle tables which grow in both directions automatically, as long as they correspond to either HTML or CALS standard.

Your XML is very unusual, but surely can be handled too. Ideally you should define one variable for row element, let's name it $row, and another one for column element - $column (use Define Variables context menu to do this and assign them value . (dot) in both cases which means current node).

Once you have these variables, all you need is to find the correct cell by using a User-Defined-Template like this

//cell[@columnIndex=$column/@index and @rowIndex=$row/@index]

within this template the rest is done as usual.


vlad attached the following image(s):
Capture1.PNG
Capture2.PNG

jodi
Posted: Wednesday, January 25, 2012 12:13:33 PM
Rank: Newbie

Joined: 1/24/2012
Posts: 6
Dear vlad, you're the bomb. This is exactly want I want.
Unfortunately I'm still unable to reproduce it. What am I doing wrong?
Please took a look at the attachments.

Thanks,

Jos

File Attachment(s):
probeer2.sps (15kb) downloaded 91 time(s).


vlad
Posted: Wednesday, January 25, 2012 12:48:25 PM
Rank: Advanced Member

Joined: 12/13/2005
Posts: 2,479
Location: Mauritius
You can see the reason when you look at your Schema tree - you are using namespace prefix qns: and therefore in your case you must prepend cell with qns: prefix

//qns:cell[@columnIndex=$column/@index and @rowIndex=$row/@index]
jodi
Posted: Wednesday, January 25, 2012 12:57:20 PM
Rank: Newbie

Joined: 1/24/2012
Posts: 6
vlad, that's true. I have fixed that.
It seems that all values are repeated in each cell.
Due to more tables within qns:tables

Please take a look at the new attached probeer.sps

thanks,

Jos
jodi
Posted: Wednesday, January 25, 2012 1:08:19 PM
Rank: Newbie

Joined: 1/24/2012
Posts: 6
I've got it:

//qns:cell[@columnIndex=$column/@index and @rowIndex=$row/@index and ../qns:nr=$tableName]
jodi
Posted: Wednesday, January 25, 2012 1:15:08 PM
Rank: Newbie

Joined: 1/24/2012
Posts: 6
Thanks vlad, to put me in right direction.

You made my day!!!
A lot of pressure of my shoulders now.

Jos
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova User Forums Terms of Service.

Please note that the Altova User Forum was launched so that our users have the possibility to interact and exchange their experiences regarding Altova's product line with one another. It must be pointed out that our support engineers and software engineers regularly post answers to questions in the user forum as an extra service, however this is not a replacement for the regular support mechanism and we cannot in anyway guarantee that a question will be answered or give a specific timeframe for an answer.The user forum was not intended to replace the online support form, but was implemented as an additional source of information after repeated requests for a user based forum in which users can help one another.