Re: Round-tripping ixml?

I talk about roundtripping in a couple of my papers, in particular my most recent one: https://archive.xmlprague.cz/2022/files/xmlprague-2022-proceedings.pdf#page=51 There’s a section at the end on it.

Thank you for the pointer. I’m glad to see round-tripping is on the agenda.

Just out of interest, what is your use case, if I may ask?

I am considering using iXML to translate between XML and a domain-specific language called Name-Value Hierarchy (NVH): https://www.namevaluehierarchy.org/

The scenario would go like this:

A human edits data in NVH.
A machine reads data in NVH, parses it into XML, makes some changes, linearizes back to NVH.
The human continues editing the NVH.

Another scenario I can imagine will come up is this:

A machine obtains data from somewhere, composes an XML document out of it, then linearizes it into “not XML” for humans to edit.
Humans edit the “not XML”.

This second scenario can’t even be described as round-tripping any more.

Thanks for the info.


PS. By the way, if you look at NVH closely you’re probably going to say that it can’t be done because, in iXML, you can’t parse terminals into XML element names. That’s not what I want to do though. I want to write iXML grammars for specific schemas where the grammar knows in advance what the names of the elements are.

On the contrary:


nvh: entry+.
entry: headword, partOfSpeech, sense+.
headword: -"headword: ", [L]+, nl.
partOfSpeech: -"partOfSpeech: ", [L]+, nl.
sense: definition, translation, exampleContainer.
definition: -"definition: ", [L; " "]+, nl.
exampleContainer: example, translation.
example: -"example: ", [L; " ,."]+, nl.
translation: -"translation: ", [L; " ,."]+, nl.
-nl: -#a, -" "*.#

headword: bank
  partOfSpeech: noun
  definition: an institution where you store or borrow money
    translation: банка
    example: I got a large loan from the bank.
      translation: Я получил крупный кредит в банке.
  definition: a stretch of land along a river
    translation: берег
    example: The house is on the north bank of the river.
      translation: Дом находится на северном берегу реки.
#
<nvh>
   <entry>
      <headword>bank</headword>
      <partOfSpeech>noun</partOfSpeech>
      <sense>
         <definition>an institution where you store or borrow money</definition>
         <translation>банка</translation>
         <exampleContainer>
            <example>I got a large loan from the bank.</example>
            <translation>Я получил крупный кредит в банке.</translation>
         </exampleContainer>
      </sense>
      <sense>
         <definition>a stretch of land along a river</definition>
         <translation>берег</translation>
         <exampleContainer>
            <example>The house is on the north bank of the river.</example>
            <translation>Дом находится на северном берегу реки.</translation>
         </exampleContainer>
      </sense>
   </entry>
</nvh>


Steven

Received on Tuesday, 18 October 2022 19:11:05 UTC