|
Намеренное игнорирование тегов при Correlate и Next класса %XML.Reader
|
|||
---|---|---|---|
#18+
Для парсинга *.xlsx с помощью XML Schema Wizard и xml-схем были созданы необходимые классы (схемы: https://svn.cesecore.eu/svn/signserver/vendor/openxml4j/current/src/schemas/, совет от Tony на https://groups.google.com/forum/#!topic/intersystems-public-cache/xabfh8UXoeo). Все было хорошо до попытки загрузки файла Excel 2013. В ..\xl\workbook.xml появились неопределенные пространства имен и свойства: Код: xml 1. 2. 3. 4. 5.
И при выполнении у метода загрузки из файла: Код: vbnet 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14.
возникает ошибка: ОШИБКА #6237: Неожиданный тег при XML вводе: AlternateContent (заканчивается в строке 2 символ 530) Про AlternateContent написано на https://wiki.openoffice.org/wiki/OOXML/Markup_Compatibility_and_Extensibility - это новшества 2013 версии офиса, не входящие в стандарт OOXML, и может встречаться в любом месте, в том числе и в ..\xl\worksheets\sheet[n], что еще более усугубляет ситуацию (думал подгружать только листы). Внимание вопрос: как проигнорировать неподдерживаемые неймспейсы и свойства? Использование только поддерживаемых версий офиса прошу не предлагать. ... |
|||
:
Нравится:
Не нравится:
|
|||
06.06.2017, 12:03 |
|
Намеренное игнорирование тегов при Correlate и Next класса %XML.Reader
|
|||
---|---|---|---|
#18+
drakut, AlternateContent вполне входит в стандарт , хоть и не входит в xsd. L.1.18.4 Roundtripping Alternate Content (ECMA-376 v5 p1 pg4631)Office Open XML defines a mechanism for the storage of content which is not defined by this Office Open XML specification, for example extensions developed by future software applications which leverage the Office Open XML formats. This mechanism allows for the storage of a series of alternative representations of content, of which the consuming application can use the first alternative whose requirements are met. Consider an application which creates a new paragraph property intended to make the colors of its text change randomly when it is displayed. This functionality is not defined in this Office Open XML specification, and so the application might choose to create an alternative representation setting a different manual color on each character for clients which do not understand this extension using an AlternateContent block as follows: Код: xml 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28.
The Choice element that requires the new color extensions uses the random element in its namespace, and the Fallback element allows clients that do not support this namespace to see an appropriate alternative representation. These alternate content blocks can occur at any location within a WordprocessingML document, and applications must handle and process them appropriately (taking the appropriate choice). However, WordprocessingML does not explicitly define a set of locations where applications must attempt to store and roundtrip all non-taken choices whenever possible. If an application does not understand the colors extension, the resulting file (if alternate choices are to be preserved would appear as follows:Annex L Код: xml 1. 2. 3. 4. 5. 6.
The file would then appear as follows after the choice is processed: Код: xml 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14.
Ваша проблема может быть решена добавлением параметров в сгенерированные XML классы: Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11.
Могу также порекомендовать мою статью про разбор docx . ... |
|||
:
Нравится:
Не нравится:
|
|||
06.06.2017, 13:48 |
|
Намеренное игнорирование тегов при Correlate и Next класса %XML.Reader
|
|||
---|---|---|---|
#18+
eduard93, Попробовал добавить указанные вами параметры в сгенерированный класс Lib.Util.OOXML.SML.CTWorkbook, с которым и коррелирую данные файла, но ошибка все равно почему-то возникает (та же самая), хотя по идее не должна ... |
|||
:
Нравится:
Не нравится:
|
|||
06.06.2017, 17:16 |
|
|
start [/forum/topic.php?fid=39&gotonew=1&tid=1556346]: |
0ms |
get settings: |
9ms |
get forum list: |
14ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
49ms |
get topic data: |
10ms |
get first new msg: |
7ms |
get forum data: |
2ms |
get page messages: |
41ms |
get tp. blocked users: |
1ms |
others: | 339ms |
total: | 478ms |
0 / 0 |