ReadAlongs / Studio-Web

Suite of web packages for creating interactive ReadAlongs (this repo was formerly called Web-Component)
https://readalong-studio.mothertongues.org/
Other
10 stars 9 forks source link

Cannot download Elan, Praat, SRT or WebVTT from Editor #347

Open joanise opened 8 hours ago

joanise commented 8 hours ago

If you create a read-along in the Studio, all six download formats work fine.

If you then reload any read-along in the Editor, html and zip downloads work, but the other four formats give a 422 with this error:

{
    "detail": "ReadAlong provided is not valid: <string>:1:0:ERROR:VALID:DTD_UNKNOWN_ATTRIBUTE: No declaration for attribute xmlns of element read-along"
}

as seen by going F12 / Network / <pick download event with the 422> / Response

joanise commented 8 hours ago

Possibly relevant, the payload that Studio sends to the /convert_alignment/eaf endpoint looks like this:

<read-along version="1.2">

    <meta name="generator" content="@readalongs/studio (cli) 1.1.0" id="m01"/><meta name="generator" content="@readalongs/studio-web 1.5.0"/><text xml:lang="und" fallback-langs="und" id="t0">
        <body id="t0b0">
            <div type="page" id="t0b0d0">
                <p id="t0b0d0p0">
                    <s id="t0b0d0p0s0"><w id="t0b0d0p0s0w0" ARPABET="AA S D F" time="0" dur="0.88">asdf</w></s>
                </p>
            </div>
        </body>
    </text>
</read-along>

but the payload the editor sends has a few differences:

<read-along xmlns="http://www.w3.org/1999/xhtml" version="1.2">

    <meta name="generator" content="@readalongs/studio (cli) 1.1.0" id="m01"><body id="t0b0"></body></meta><meta name="generator" content="@readalongs/studio-web 1.5.0" /><text xml:lang="und" fallback-langs="und" id="t0">

            <div type="page" id="t0b0d0">
                <p id="t0b0d0p0">
                    <s id="t0b0d0p0s0"><w id="t0b0d0p0s0w0" arpabet="AA S D F" time="0" dur="0.88">asdf</w></s>
                </p>
            </div>

    </text>
</read-along>
joanise commented 5 hours ago

@deltork Maybe you know how to address this?

joanise commented 5 hours ago

The actual error messages seems to be due to xmlns on the read-along element, which our DTD 1.2 does not allow.

I expect there will also be an error from

<meta name="generator" content="@readalongs/studio (cli) 1.1.0" id="m01"><body id="t0b0"></body></meta>

the body tag is not supposed to be inside the meta tag.