preventing tranforming empty element with begin- and endtag to self-closing-tag
RSRob Stapper23 May 2025 13:11 # Hi Christian,
Basex seems to transform 'begin-/endtagged' element with empty content to a single self-closing-tagged element:
<div></div>
</div>
This gives problems in my client application. Both in Chrome, Edge and Firefox transforms Javascript's "insertAdjacentHTML":
<div>
<div/>
<div>tekst</div>
<div>tekst</div>
</div>
<div>
<div>
<div>tekst</div>
<div>tekst</div>
</div>
</div>
This is not what is intended.
I guess for void-elements this transformation is ok but result in problems like this in case of container-elements.
Is it possible in Basex to suppress this transformation?
mvgr.
Rob Stapper
CGChristian Grün23 May 2025 13:29 # Quoted text · Rob Stapper · 2 lines
>
> Hi Rob
Is it possible in Basex to suppress this transformation?
Quoted text · Rob Stapper · 1 line
>
You will need to serialize your data as HTML [1].
Hope this helps,
Christian
[1] https://docs.basex.org/main/Serialization
⚡Generated with XQuery