[
https://issues.apache.org/jira/browse/ODFTOOLKIT-153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460155#comment-13460155
]
DaLi Liu commented on ODFTOOLKIT-153:
-------------------------------------
Verified status of this issue
2.not sure - I am not sure about this issue, maybe still need to be opened
> Toolkit allows ODF that fails validation to be created
> ------------------------------------------------------
>
> Key: ODFTOOLKIT-153
> URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-153
> Project: ODF Toolkit
> Issue Type: Improvement
> Components: java
> Affects Versions: 0.8.6
> Environment: Operating System: All
> Platform: All
> Reporter: kelvin
> Assignee: issues
> Priority: Minor
> Fix For: 0.8.7
>
>
> I am not an ODF expert - although I am rapidly becoming one in some areas!
> Thanks to Rob telling me, I found out about the on-line validation web page.
> I have started running all of my documents that I create using the toolkit
> through the validator.
> I have discovered that several of my documents contain errors.
> I think in many, not all, but many, of these cases, odfdom could have stopped
> me from creating an invalid document.
> Here is an example. The following code snippet creates an automatic style
> entry (that I now know is not valid):
> style = contentAutoStyles.newStyle( OdfStyleFamily.TableRow );
> rowStyleBoldCenter = style.getStyleNameAttribute();
> style.setProperty(OdfTextProperties.FontWeight, "bold");
> property = OdfStyleProperty.get(
> OdfStylePropertiesSet.TableRowProperties
> , OdfName.newName(OdfNamespaceNames.FO,
> text-align"));
> style.setProperty( property, "center" );
> Here is the generated XML element:
> <style:style style:family="table-row" style:name="a7d9e1d">
> <style:table-row-properties fo:text-align="center"/>
> <style:text-properties fo:font-weight="bold"/>
> </style:style>
> After my ODS file failed validation I went to the ODF spec and looked at the
> <style:table-row-properties> definition (section 17.17)
> Having read the spec I now understand that I am not allowed to use
> fo:text-align in a row style (although it would be really useful to be able
> to do this at the row level).
> Given this rule is in the spec and given the validator can check for it, I
> think odfdom could have as well.
> This is just one example, I could provide several more. The point is that the
> odfdom allowed me to create bad (invalid) ODF when it should have been able
> to give me an error message (or at least a warning).
> What do you all think?
> Cheers
> Kelvin
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira