Apache OpenOffice (AOO) Bugzilla – Issue 36102
XSLT filter: Remove 'dxa' conversion from measure_conversion.xsl
Last modified: 2005-02-02 13:47:10 UTC
A conversion of 'dxa' has been added to the measure_conversion.xsl stylesheet, but dxa is not a measurement, but a naming derived from the MS binary file format and always provided in the measurement TWIP (cmp. http://www.msxnet.org/word2rtf/formats/dosword5). Adapt the WordML stylesheets and recommit the earlier CVS version. General constraint: Be careful to not use an editor, which is changing spaces, as these changes will become visible in the CVS.
Gary: Please take a look at it.
to ->sus, As we discussed in the previous email thread "twip/dxa in measure_conversion.xsl" I won't fix this bug because: It is inconvenient for us to use the convert methods after the change from dxa to twip. It is because in MS word, it uses the 'dxa' to represent the twip measurement internally. Looking at the following example, please: <w:tcMar> <w:top w:w="142" w:type="dxa"/> .... </w:tcMar> The w:type can be dxa, nil, pct, or auto. Before the change from dxa to twip, I can use the convert method like the below: <xsl:call-template name="convert2in"> <xsl:with-param name="value" select="concat(w:tcMar/w:left/@w:w , w:tcMar/w:left/@w:type) "/> </xsl:call-template> But now,we have to convert the w:type from 'dxa' to 'twip' first and then concat the w:w and 'twip' in order to use the new convertion method.
SUS->Gary: Concerning the email thread 'Twip/dxa in measure_conversion.xsl', remember that I finished the thread by a mail from 8/3/2004 9:41 AM pointing out that 'dxa' is not a measurement, it is a surprise to me that you still want to keep the 'dxa' conversion after the thread. I assume, that you agree that 'dxa' is not a measurement and that it basically has nothing to do in the measure_conversion.xsl stylesheet, even it looks unconvenient for your work on the first sight. Second, your approach has the downside, that from four of your possible values ('dxa, nil, pct, or auto') only one ('dxa') will be converted to twip (and even this 'dxa' is not a measure), the other types are unknown to the conversion stylesheet and their values will be returned without changing. As I suspect that 'pct' has something to do with the pica measure (didn't found it by a short look in the MS spec, you know this for sure), in case it is 'pica' you would have to rename it anyway. You don't want really want to add 'pct' aside of pica, don't you? Besides, it is interesting that you explicitly concatenate 'dxa' to the value (instead of 'twip') in the wordml stylesheets to trigger this measure conversion even more times than are using the 'w:type'. In total you are calling the conversion 17 times, please adapt them to map to twip or their corresponding measures.
gyang -> sus: Yes, You could say that I agree that 'dxa' is not a measurement in M$'s document but practically it is used as a measurement in wordml. In contrast to 'dxa', the twip is documemted in M$ document as a measurement, but virtually it is never used in wordml, at least I can't find such a place that is using twip. So in my mind, it is M$ breaks the rule it made not us. In my opinion, I'd like to keep both convert2twip and convert2dxa in measure_conversion.xsl.
gyang->SUS: As for concatenating 'dxa' to the value becaue they are legacy code and now they are easy to be replaced by twip. As for removing convert2dxa template, it should be considered again because: 1) it brings us a lots of inconvience 2) it definately slows down the perfomance because it requires more choose -select statement. But so far, I haven't found the other value of w:type appearing. I think that it might not remove convert2dxa template now. PS: the possible value of w:type please refer to the wordml schema (wordnet.xsd) by search keyword "tableWidthPropertyType"
sus->gyang: The measure_conversion.xsl stylesheet of the common folder was mentioned for measurement conversion that are commonly used. Microsoft obvioulsy had made a design mistake by using 'dxa' and I would agree adding it to the measurement, if the other possible values of your attribute would match to the xsl:choose of the conversion template. But it does not. What does the other possible values (nil, pct, or auto) mean? Are you sure that the return of the same value is not an issue? And don't you think that this proprietary measurement conversion belongs to this Microsoft conversion solely? AFAIK even Microsoft's spreadsheetml does not use 'dxa'. Therefore I propose to use this conversion in the wordml spreadsheet itself, as it break the rule of the design. Nevertheless it is not THIS important to me. When you have answers to the questions above (esp. for the handling of the other possible values of the attribute) you might add a comment to the measure_conversion.xsl about 'dxa' and keep it.
fixed!I removed the convert2dxa template from measure_conversion.xsl stylesheet and all wordml stylesheet.
reopen
reopen to reassign to jw, please verify
added developer note
reset to fixed
verified
seen good in src680_m76 -> closing