humboldtdigital / ProHD

A web application built with TEI Publisher
https://dossierdigital.ohc.cu/
GNU General Public License v3.0
6 stars 7 forks source link

Server error XPTY0004 #11

Closed arojascastro closed 2 years ago

arojascastro commented 3 years ago

I am currently working on some encoding principles, but found an error when accessing two nodes in a TEI document on our web application.

The sections are:

In both cases I am getting this response:

the server did not return any content

La solicitud al servidor ha fallado.: It is a type error if, during the static analysis phase, an expression is found to have a static type that is not appropriate for the context in which the expression occurs, or during the dynamic evaluation phase, the dynamic type of a value does not match a required type as specified by the matching rules in 2.5.4 SequenceType Matching. checking function parameter 1 in call util:node-id($prev): XPTY0004: The actual cardinality for parameter 1 does not match the cardinality declared in the function's signature: util:node-id($node as node()) xs:string. Expected cardinality: exactly one, got 2. [at line 390 of /db/apps/ProHD/modules/lib/api/document.xql]

To a document called "criterios.xml" found the folder /data

It is weird becasue this document contains many sections that are displayed properly. Do you have any hint @tuurma ? Thank you!

trafikante commented 2 years ago

The error that Antonio describes, persists apparently with "Rupturas de línea" (direct link to the - I suppose - relevant line of code).

Do we have any idea what causes the false server response? I just looked at the code in https://github.com/humboldtdigital/ProHD/blob/main/data/criterios.xml and could not find anything that might resemble a formal incoherence with any of the other sub-categories of <div type="level3">.

trafikante commented 2 years ago

Just a wild guess here...

Could it be that the XML element <g ref="#typoHyphen"/> inside of <seg type="code">... </seg> causes the crash?

            <p>Si el salto de línea ocurre dentro de una palabra, se ha codificado con el
              atributo <seg type="code">@break</seg> y el valor <seg type="code">no</seg>. En caso
              de aparecer un separador en la fuente original, se ha codificado como <seg type="code">
                <g ref="#typoHyphen"/>
              </seg>.</p>

So, instead of

se ha codificado como <seg type="code"><g ref="#typoHyphen"/></seg>.

it should probably be something like

se ha codificado como <seg type="code">&lt;g ref="#typoHyphen"/&gt;</seg>.

right?

humboldtdigital commented 2 years ago

This is not longer a problem since we have transformed the tei guidelines from TEI to docbook format. Magdalena has done this in this commit: https://github.com/humboldtdigital/ProHD/commit/65e981600aa33f24ad8a274c4dbbd9ae442fd2dc

Closing here then.