I managed to get some access to the custom attributes but I do not know how to take it further to produce the correct document.
from the examples given I modified one. The attributes i'm requesting are CUST_QUANTITY and CUST_UNITPRICE
Code: Select all
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- This file is an example from
http://www.codeproject.com/Articles/898616/ToDoLists-StyleSheets-a-tutorial
May 2015 -->
<xsl:output method="html" indent="yes" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" />
<xsl:template match="/TODOLIST">
<xsl:element name="html">
<xsl:element name="head">
<xsl:element name="title">
<xsl:value-of select="@PROJECTNAME" />
</xsl:element>
</xsl:element>
<xsl:element name="body">
<xsl:value-of select="@PROJECTNAME" />
<xsl:element name="br" />
<xsl:value-of select="@FILENAME" />
<xsl:element name="br" />
<xsl:element name="br" />
<xsl:apply-templates select="TASK" />
</xsl:element>
</xsl:element>
</xsl:template>
<xsl:template match="TASK">
<xsl:value-of select="@TITLE" />
<xsl:element name="br" />
<xsl:apply-templates select="TASK" />
<xsl:if test="CUSTOMATTRIB">
<xsl:for-each select="(TASK/CUSTOMATTRIB[@ID='CUST_QUANTITY'])">
<xsl:value-of select="@VALUE"/>
<xsl:element name="br" />
</xsl:for-each>
<xsl:for-each select="(TASK/CUSTOMATTRIB[@ID='CUST_UNITPRICE'])">
<xsl:text> x </xsl:text>
<xsl:value-of select="@VALUE"/>
<xsl:element name="br" />
</xsl:for-each>
</xsl:if>
<xsl:element name="br" />
</xsl:template>
</xsl:stylesheet>
My list
My list.tdl
Δημόσια Έργα
Δασικό έργο ντα βρύση καγκελούδια
Σύνταξη λογαριασμού
24
x 34
1
x 0
Ανακαινίσεις
Κατοικία Αγ. Λαύρας 9 Καβάλα
Εξωτερικές επισκευές
Μόνωση ταράτσας
Πλαϊνό βάψιμο πολυκατοικίας
Βάψιμο, σοβάτισμα , καθαρισμός ποταμων
Μισθωση σκαλωσιας
4
3
x 23
x 56
Κατασκευές στα μπαλκόνια
Κάγκελο
Βάψιμο, στοκαρισμα
στοκάρισμα στο κάγκελο
4
6
x 5
x 6
Κατασκευή Πέργκολας
Προσδιορισμός υλικών πέργκολας
Ανέβασμα υλικών
Προετοιμασία υλικών, τρίψιμο, βερνικωμα
Εργασίες κατασκευής στησίματος
10
2
45
45
x 24
x 3
x 4
x 3
0
0
x 0
x 0
5
0
0
x 5
x 0
x 0
Εσωτερικές επισκευές
Τοποθέτηση καθρεφτών και ξύλων ανάρτησης στο γυμναστήριο.
Δημιουργία γραφείου και βιβλιοθήκης στο μικρό δωμάτιο.
Καθαίρεση κεντρικού επίπλου κουζίνας και δημιουργία πάγκου
Άνοιγμα στο πίσω μπαλκόνι της κρεβατοκάμαρας
Καθαίρεση σοβάδωνκαι επισκευή στην περιοχή της σκάλας
Βάψιμο εσωτερικών χώρων
Τοποθέτηση κάγκελο σκάλα
0
x 0
0
x 0
Αυθαίρετα
1. Ψηφιακή Σάρωση σχεδίων
2. Σχεδιασμός επί σαρωμένων των αποτυπομένων υποστυλωμάτων
The document i want to produce would be:
TASK POSISITION | TASK NAME | CUST_UNIT | CUST_QUANTITY | CUST_UNITPRICE | CUST_TOTALPRICE* |
*I also realized that CUST_TOTALPRICE being a calculated attribute, is not getting exported to tdl with the tasks, is saved only as definition.
So I suppose the last column has to be calculated in the xsl file but how we do calculations in xsl? Also this attribute is cumulative.
Also why the custom attributes have only the option to do calculations between only two attributes? wouldn't be easier and more versatile just to have a formula field?
And maybe we would need attribute groups that would also help with the interface? With foldable groups of attributes? Timing attributes/Location Attributes/Costing Attributes/Allocation attributes etc.