<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 9/27/2021 1:10 PM, Phil B via Cuis-dev wrote:
<blockquote
cite="mid:CAMJMOei6bf=qAPtM2cOBokSHRGL8Kc9jzh=JLFf+r4Sod-p8JA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div dir="ltr">Juan,
<div><br>
</div>
<div>Two things:</div>
<div><br>
</div>
<div>1) When reading XML files you have to be able to consume
CR and/or LF as the majority of XML files are going to come
from non-Smalltalk sources using who-knows-what
conventions. This goes for the structure as well as the
content. So we can't say 'just use LF'. It is fine (even
preferred) to emit only LF (for a generic end of line, not
an encoded entity) when writing XML files. See <a
moz-do-not-send="true"
href="https://www.w3.org/TR/REC-xml/#sec-line-ends">https://www.w3.org/TR/REC-xml/#sec-line-ends</a></div>
</div>
</div>
</blockquote>
<br>
Isn't this currently the case? Can you attach an XML (inside a zip!)
showing it is not?<br>
<br>
<blockquote
cite="mid:CAMJMOei6bf=qAPtM2cOBokSHRGL8Kc9jzh=JLFf+r4Sod-p8JA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div dir="ltr">
<div>2) When you want to ensure your CR's and/or LF's are
preserved 'as is' in attributes/nodes, they need to be
encoded as Hilaire is doing. They need to be unencoded
along with other entities when parsed.</div>
</div>
</div>
</blockquote>
<br>
Same as before. Isn't this the case? Do you have an example to show
otherwise?<br>
<br>
<blockquote
cite="mid:CAMJMOei6bf=qAPtM2cOBokSHRGL8Kc9jzh=JLFf+r4Sod-p8JA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div dir="ltr">
<div>If you don't encode your CR's inside attributes/nodes, I
believe many/most XML generators will translate them to LF's
(or even omit them) when the XML file is written per item
1. Now whether or not Hilaire's code should want the CR's
encoded is a valid point to consider as that's a content
question rather than an XML one. But it is valid from an
XML standpoint to do what he is doing.</div>
</div>
</div>
</blockquote>
<br>
Of course. I guess you didn't see or try the code I attached on
Hilaire's example.<br>
<br>
My suggestion was to ask # withCuisLineEndings to the Smalltalk code
extracted from the XML, prior to filing it into Cuis, so Cuis code
will honor the Cuis convention. In any case, it is not really
mandatory. Cuis will compile and run Smalltalk code in any line
ending convention...<br>
<br>
<blockquote
cite="mid:CAMJMOei6bf=qAPtM2cOBokSHRGL8Kc9jzh=JLFf+r4Sod-p8JA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div dir="ltr">
<div>Thanks,<br>
</div>
<div>Phil</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Mon, Sep 27, 2021 at 6:53
AM Juan Vuletich via Cuis-dev <<a moz-do-not-send="true"
href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<div bgcolor="#ffffff"> On 9/26/2021 10:27 AM, Hilaire
Fernandes via Cuis-dev wrote:
<blockquote type="cite">
<p><font size="+1">Hi Nicolas, <br>
</font></p>
<p><font size="+1">I can read most of DrGeo xml files,
only xml entity like (carriage return I
guess) and 	 (tabulation) are not translated
and kept as is when I read the file.<br>
</font></p>
<p>Hilaire<br>
</p>
<div>Le 26/09/2021 à 10:57, Nicola Mingotti a écrit :<br>
</div>
<blockquote type="cite">
<div dir="auto">i was parsing successfully a
libreoffice file with YAXO. </div>
</blockquote>
<pre cols="72">--
GNU Dr. Geo
<a moz-do-not-send="true" href="http://drgeo.eu" target="_blank">http://drgeo.eu</a>
<a moz-do-not-send="true" href="http://blog.drgeo.eu" target="_blank">http://blog.drgeo.eu</a></pre>
</blockquote>
<br>
It looks like the attached works. Test adding
#withCuisLineEndings, so that CR characters from Pharo are
converted to LF:<br>
<br>
| doc |<br>
doc _ XMLDOMParser parseDocumentFrom: 'Curve and
slope.fgeo' asFileEntry readStream.<br>
((doc elementAt: #drgenius) firstTagNamed: #code)
contentString withCuisLineEndings.<br>
<br>
I don't know the XML spec in full detail, but it looks
like the conversions in the attach are needed. Anyone
knows better?<br>
<br>
Thanks,<br>
<pre cols="72">--
Juan Vuletich
<a moz-do-not-send="true" href="http://www.cuis-smalltalk.org" target="_blank">www.cuis-smalltalk.org</a>
<a moz-do-not-send="true" href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev" target="_blank">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev</a>
<a moz-do-not-send="true" href="https://github.com/jvuletich" target="_blank">https://github.com/jvuletich</a>
<a moz-do-not-send="true" href="https://www.linkedin.com/in/juan-vuletich-75611b3" target="_blank">https://www.linkedin.com/in/juan-vuletich-75611b3</a>
@JuanVuletich</pre>
</div>
-- <br>
Cuis-dev mailing list<br>
<a moz-do-not-send="true"
href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
<a moz-do-not-send="true"
href="https://lists.cuis.st/mailman/listinfo/cuis-dev"
rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote>
</div>
</div>
</blockquote>
<br>
Thanks,<br>
<pre class="moz-signature" cols="72">--
Juan Vuletich
<a class="moz-txt-link-abbreviated" href="http://www.cuis-smalltalk.org">www.cuis-smalltalk.org</a>
<a class="moz-txt-link-freetext" href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev</a>
<a class="moz-txt-link-freetext" href="https://github.com/jvuletich">https://github.com/jvuletich</a>
<a class="moz-txt-link-freetext" href="https://www.linkedin.com/in/juan-vuletich-75611b3">https://www.linkedin.com/in/juan-vuletich-75611b3</a>
@JuanVuletich</pre>
</body>
</html>