-
Notifications
You must be signed in to change notification settings - Fork 547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misc element properties are not lining up with their ECMA definitions #780
Comments
FYI - I caught this while testing out the Serialize.OpenXml.CodeGen library. |
Interesting. @tomjebo can you take a look at the spec and weigh in here? |
@rmboggs Can you share the section of the spec you were looking at? |
I was referencing the first revision of the open xml ecma standard located here. Please let me know if there are more questions. |
Actually, I dug a bit deeper here as there are other elements that also have the same possible values. |
My gut says that's a breaking change. I'll dig into it too see. We'll probably do a v3 soon and can handle any breaking changes then |
It makes sense to be cautious. I don't think this is urgent since the cantSplit class has been set this way for quite some time and the difference is being noticed now, in a non production environment. I have an idea how to get around this in my project so I should be ok. In the meantime, would it be ok to label this for the 3.0 release so it doesn't get lost. |
@twsouthwick @rmboggs I think we have a mistake in the schema processing (backend). cantSplit looks like it was defined in our backend processing as CT_OnOffOnly which is not correct based on the ISO definition or what I see in the Office source schemas. I see it actually associated with both CT_OnOffOnly and CT_OnOff in our backend code and the former looks like it's overriding the latter. I think this is wrong. I'm not sure if correcting this to CT_OnOff would be breaking as it would be expanding the possible values, not taking any away. I'll need to check the other elements that are set to this type as well. |
Thanks @tomjebo. Please let me know if you need more information on this. |
This is definitely a v3.0 change as it will be a breaking change. We'll track this and get that in. |
Thanks guys, I have a work around for my stuff in the meantime. It's not the prettiest work around but it will do. |
Hi, I'm finding other non-enumvalue type properties that do not seem to be matching up to their values in some of the sample documents that I am testing against. Since they seem to be related to schema mismatches at first glance similar to this, should I append what I find to this issue or create a new one to keep things clean? Please let me know. |
Yes, let's make this an uber-issue for those kind of issues. Then we can track it for v3.0 |
Ok, let me see if I can modify the title to be more broad in a bit. In the meantime, I'm seeing more inconsistencies in the sample docx file mentioned at the beginning of this issue when compared to the ecma standard. First one is for the DocGrid.CharacterSpace property. The property type is set to Please let me know if more details are needed for this. |
``` { "FilePath": "test/docx/golden/tables.docx", "ValidationErrors": "[{\"Description\":\"The attribute 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:val' has invalid value 'true'. The Enumeration constraint failed.\",\"Path\":{\"NamespacesDefinitions\":[\"xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\"],\"Namespaces\":{},\"XPath\":\"/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:trPr[1]/w:tblHeader[1]\",\"PartUri\":\"/word/document.xml\"},\"Id\":\"Sch_AttributeValueDataTypeDetailed\",\"ErrorType\":\"Schema\"}]" } ``` Although this one might actually be a bug in Open-XML-SDK similar to this, or a subtle difference between standard versions: dotnet/Open-XML-SDK#780 Signed-off-by: Edwin Török <[email protected]>
``` { "FilePath": "test/docx/golden/tables.docx", "ValidationErrors": "[{\"Description\":\"The attribute 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:val' has invalid value 'true'. The Enumeration constraint failed.\",\"Path\":{\"NamespacesDefinitions\":[\"xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\"],\"Namespaces\":{},\"XPath\":\"/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:trPr[1]/w:tblHeader[1]\",\"PartUri\":\"/word/document.xml\"},\"Id\":\"Sch_AttributeValueDataTypeDetailed\",\"ErrorType\":\"Schema\"}]" } ``` Although this one might actually be a bug in Open-XML-SDK similar to this, or a subtle difference between standard versions: dotnet/Open-XML-SDK#780 Signed-off-by: Edwin Török <[email protected]>
``` { "FilePath": "test/docx/golden/tables.docx", "ValidationErrors": "[{\"Description\":\"The attribute 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:val' has invalid value 'true'. The Enumeration constraint failed.\",\"Path\":{\"NamespacesDefinitions\":[\"xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\"],\"Namespaces\":{},\"XPath\":\"/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:trPr[1]/w:tblHeader[1]\",\"PartUri\":\"/word/document.xml\"},\"Id\":\"Sch_AttributeValueDataTypeDetailed\",\"ErrorType\":\"Schema\"}]" } ``` Although this one might actually be a bug in Open-XML-SDK similar to this, or a subtle difference between standard versions: dotnet/Open-XML-SDK#780 Signed-off-by: Edwin Török <[email protected]>
``` { "FilePath": "test/docx/golden/tables.docx", "ValidationErrors": "[{\"Description\":\"The attribute 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:val' has invalid value 'true'. The Enumeration constraint failed.\",\"Path\":{\"NamespacesDefinitions\":[\"xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\"],\"Namespaces\":{},\"XPath\":\"/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:trPr[1]/w:tblHeader[1]\",\"PartUri\":\"/word/document.xml\"},\"Id\":\"Sch_AttributeValueDataTypeDetailed\",\"ErrorType\":\"Schema\"}]" } ``` Although this one might actually be a bug in Open-XML-SDK similar to this, or a subtle difference between standard versions: dotnet/Open-XML-SDK#780 Signed-off-by: Edwin Török <[email protected]>
Before submitting an issue, please fill this out
Is this a:
Description
The DocumentFormat.OpenXml.WordProcessing.OnOffOnlyValues enum only contains values
On
andOff
but if I am reading the ECMA-376 standard correctly, properties with this value type may contain valuesOn
,Off
,0
,1
,true
, andfalse
. When values, such as true or false, are present for an xml attribute for this type, theValue
property of theEnumValue<OnOffOnlyType>
object throws aSystem.FormatException
exception.The attached document contains an element
/document[0]/tbl[0]/tr[0]/trPr[0]/cantSplit
which contains the property in question.file-sample_500kB.docx
I'm open to discuss this further but it doesn't seem like this should be the correct behavior.
Information
Repro
Observed
Expected
The text was updated successfully, but these errors were encountered: