Closed bdolor closed 7 years ago
After testing a few books an edge case has been discovered and as a result this needs to account for both a nesting pattern two levels deep (current support for this) and three levels deep (for instance Anatomy, Biology textbooks). Some CNX textbooks have Units->Chapters->Chapter Parts instead of just Chapters->Chapter Parts.
When you pull in a book that has 'Units', no content can be imported:
In books with three levels, Pressbooks Parts and Chapters will need to be mapped to CNX Chapters, Chapter Parts. There is no content in Units so it will need to be be discarded (no where to represent it in PB)
similar to https://github.com/pressbooks/pressbooks/blob/dev/inc/modules/import/epub/class-epub201.php#L216 this returns a SimpleXML object if collection.xml exists. Could also check for the existence of cnx attribute(s)