Skip to content
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

epub not parsing #2

Open
InukVT opened this issue Mar 26, 2019 · 1 comment
Open

epub not parsing #2

InukVT opened this issue Mar 26, 2019 · 1 comment
Assignees
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@InukVT
Copy link
Owner

InukVT commented Mar 26, 2019

ePub files are not parsing proberly

@InukVT InukVT added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed labels Mar 26, 2019
@InukVT InukVT added this to the 1.0 milestone Mar 26, 2019
@InukVT InukVT self-assigned this Mar 26, 2019
@InukVT
Copy link
Owner Author

InukVT commented Mar 27, 2019

Epub files are now parsing, now they just have to be handled before this issue can be closed.

MaxDesiatov added a commit to CoreOffice/XMLCoder that referenced this issue Apr 8, 2019
Recent addition of value intrinsic allows XMLCoder to handle last few known edge cases, but still a lot of times the shape of an XML isn't guaranteed to be always the same. E.g. some of the attributes might be present or absent, but an element without attributes is never decoded as a `KeyedBox` even with a value intrinsic. And vice versa, a `KeyedBox` with attributes can't be decoded with a primitive type that maps to the element value. 

This was previously reported by @Inukinator as an issue in InukVT/Read#2.

Consider this sample XML:

```xml
<container>
<foo id="123">456</foo>
<foo id="789">123</foo>
</container>
```

As of 847d754 this can't be decoded as

```swift
struct Container: Codable {
  let foo: [Int]
}
```

And this xml:

```xml
<container>
<foo>456</foo>
<foo>123</foo>
<foo>789</foo>
</container>
```

can't be decoded with

```swift
struct Container: Codable {
  struct Foo: Codable {
    let value: Int
  }

  let foo: [Foo]
}
```

This is fixed now with added optional down casts that peek into the box structure and map it correctly in these remaining edge cases.

* Refine value intrinsic tests
* Refactor XMLCoderElement.flatten, add 
* Add missing assert to 
* Fix FlattenTests error due to missing assert
* Fix new cases in AttributedIntrinsicTest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant