Using Perl to process health data from Apple

Viewed 46

I've got a little Dancer2 app I've written to experiment with graphing miles and steps from the Apple Health app. I do this by uploading the Health export (XML) from my phone.

The app has this line:

use XML::LibXML '1.70';

When I uploaded data from iOS15 the app worked great. Since then, I've updated by phone to iOS16 and it broke.

This is the output I get:

health-ios16.xml:156: parser error : ATTLIST: no name for Attribute
<!ELEMENT RightEye EMPTY>
^
health-ios16.xml:206: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration

  device           CDATA #IMPLIED
  ^
health-ios16.xml:206: parser error : DOCTYPE improperly terminated
  device           CDATA #IMPLIED
  ^
health-ios16.xml:206: parser error : Start tag expected, '<' not found
  device           CDATA #IMPLIED

I'm completely befuddled by this and I'm not sure what to do. Any ideas?

EDIT: I don't understand much about XML, but looking in the file, I definitely see things that appear to be askew. My guess is that the file provided by Apple contains errors.

EDIT 2: Long story short, Apple iOS16 mangled the export.xml file from the Health app. So this isn't a problem with Perl, the XML::LibXML module, or my logic. I'm closing this question.

0 Answers
Related