question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make StrictTranslation property public

See original GitHub issue

Before submitting an issue, please fill this out

Is this a:

  • Issue with the OpenXml library
  • Question on library usage

Description

Please provide a simple description of the issue encountered.

Information

  • .NET Target: All
  • Latest commit on master

In https://github.com/OfficeDev/Open-XML-SDK/blob/0f1764a866e36d615e22d247e780fb7675046e9a/src/DocumentFormat.OpenXml/Packaging/OpenXmlPackage.cs#L240 StrictTranslation is internal.

Would it be possible to make this property public (at least the get)?

Knowing whether a package was saved in strict or non-strict mode eases the subsequent parsing. For example, in strict mode, dates are stored in yyyy-MM-dd format and in non-strict the serial number is stored.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
tomjebocommented, May 8, 2020

I agree with the IsStrict… part of the naming, however, I’m not sure that IsStrictMode would be accurate. The assumption here is that the StrictTranslation field set to “true” indicates that the workbook will contain dates in the yyyy-MM-dd format while “false” indicates they will use the serial number format. I can’t say that will always be the case as StrictTranslation simply means that at least 1 relationship was found with “http://purl.oclc.org…” (it’s not specific about which one). It’s not a bad assumption that this would indicate that Excel saved it in Strict conformance mode (if Excel was the last application to write to it). However, this scheme may fail if there are mixed strict and transitional URI’s used in the relationship parts of a workbook, as is seen in the example (“StrictXlsx.xlsx”) from Loading xlsx saved in strict mode….

<Relationship Id="rId3" Type="http://purl.oclc.org/ooxml/officeDocument/relationships/extendedProperties" Target="docProps/app.xml"/> <Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/> <Relationship Id="rId1" Type="http://purl.oclc.org/ooxml/officeDocument/relationships/officeDocument" Target="xl/workbook.xml"/>

In that case, you might assume you can’t process the workbook because it was saved as strict by Excel but that assumption might be wrong.

Bottom line is that I would be more comfortable exposing a get only property named something like “IsStrictTranslation” or “StrictRelationshipFound” or something. Just to be truthful in advertising this property.

0reactions
igiturcommented, May 11, 2020

Agree. I like StrictRelationshipFound. It’s very explicit about its intention. I’ll prepare a PR based on that if you concur.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Make StrictTranslation property public · Issue #711
Is StrictTranslation the correct name to expose publicly? I understand its meaning in the internal sense where you're translating namespaces ...
Read more >
Thread: [Resolved] Problem translating C# to VB
In C# (Imported C# .dll into VB project) the code works without any error. And traslating this code: Code: public byte Header {...
Read more >
DocumentFormat.OpenXml 2.20.0
- Extraction of data from Excel documents. - Searching and replacing content in Word/PowerPoint using regular expressions. - Updating cached data and embedded ......
Read more >
Auto-Implemented Properties - Visual Basic
Create properties that are WriteOnly . Use parameterized properties (including Default properties).
Read more >
Sensory Properties
The status of sensory properties is a topic of importance not only for so-called. 'type-type' identity theories but also (arguably) for those theories...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found