Re: using ixml with mixed content - a design problem

"C. M. Sperberg-McQueen" <cmsmcq@blackmesatech.com> writes:
> and a pretty-printer for WEB could parse the embedded @<...@> sequences
> as cross-references, in my XML-based LP system this code scrap would
> look something like this:
>
>   <scrap file="primes.pas"
>          n="Program to print the first thousand prime numbers">
>   program print_primes(output);
>     const m=1000;
>           <ptr target="constants"/>;
>     var <ptr target="vars"/>;
>   begin
>       <ptr target="print-m-primes"/>
>   end.
>   </scrap>
>
> In a grammar for Pascal or a similar language, it's not hard to
> recognize the 'begin ... end' as a block.  But I have not found a good
> way to recognize the 'begin ... end' here as a block, given that what an
> ixml parser called on the text nodes of this 'scrap' element will see at
> that point is one text node reading ";&#xA;begin&#xA;    " and another
> reading "&#xA;end.".

Could you get any milage out of parsing this text?

   program print_primes(output);
     const m=1000;
           &lt;ptr target="constants"/&gt;;
     var &lt;ptr target="vars"/&gt;;
   begin
       &lt;ptr target="print-m-primes"/&gt;
   end.

If so, might you parse the serialization of the content of scrap?

                                        Be seeing you,
                                          norm

--
Norm Tovey-Walsh
Saxonica

Received on Sunday, 18 June 2023 17:50:54 UTC