Saverio Member Licensed User Longtime User Sep 18, 2014 #1 Hi! Erel, I'm using B4A v3.82, windows7 sp1, and got the following problem: As you can see the hint show the problem but... So the problem happen when I use the "Less than" sign. As you can see, instead, using the "Greater than" sign, the hint work properly. The questions are: 1. Is this a bug? 2. I'm doing something wrong 3. A comment, doesn't should be a "comment", no matter what inside? You said "Please escape it if necessary", yes I could, but I will get an hint which is not user-friendly Regards
Hi! Erel, I'm using B4A v3.82, windows7 sp1, and got the following problem: As you can see the hint show the problem but... So the problem happen when I use the "Less than" sign. As you can see, instead, using the "Greater than" sign, the hint work properly. The questions are: 1. Is this a bug? 2. I'm doing something wrong 3. A comment, doesn't should be a "comment", no matter what inside? You said "Please escape it if necessary", yes I could, but I will get an hint which is not user-friendly Regards
MaFu Well-Known Member Licensed User Longtime User Sep 18, 2014 #2 < and > are illegal characters in xml, this has nothing to do with B4A. You should escape it ( < as < and > as > ).
< and > are illegal characters in xml, this has nothing to do with B4A. You should escape it ( < as < and > as > ).
eps Expert Licensed User Longtime User Sep 18, 2014 #3 MaFu said: < and > are illegal characters in xml, this has nothing to do with B4A. You should escape it ( < as < and > as > ). Click to expand... < and > are legal characters in XML.... It's a little odd that the parser thinks that you've started to code XML within B4A - seems like a bug to me. Will see what Erel says....
MaFu said: < and > are illegal characters in xml, this has nothing to do with B4A. You should escape it ( < as < and > as > ). Click to expand... < and > are legal characters in XML.... It's a little odd that the parser thinks that you've started to code XML within B4A - seems like a bug to me. Will see what Erel says....
barx Well-Known Member Licensed User Longtime User Sep 18, 2014 #4 This question has been asked before, including by myself. < must be replaced by < as stated. Otherwise the compiler will mistake it, probably for a nested element.
This question has been asked before, including by myself. < must be replaced by < as stated. Otherwise the compiler will mistake it, probably for a nested element.
eps Expert Licensed User Longtime User Sep 18, 2014 #5 barx said: This question has been asked before, including by myself. < must be replaced by < as stated. Otherwise the compiler will mistake it, probably for a nested element. Click to expand... Very good, thanks for confirming. I haven't seen it before.
barx said: This question has been asked before, including by myself. < must be replaced by < as stated. Otherwise the compiler will mistake it, probably for a nested element. Click to expand... Very good, thanks for confirming. I haven't seen it before.
MaFu Well-Known Member Licensed User Longtime User Sep 18, 2014 #6 eps said: < and > are legal characters in XML.... It's a little odd that the parser thinks that you've started to code XML within B4A - seems like a bug to me. Will see what Erel says.... Click to expand... This is not correct. < and > are NOT legal in xml and must be escaped. And there's nothing odd. B4A use the standard .NET classes to interpret the xml data (imho) and therefore the xml must be well formattet. Why should Erel reinvent the wheel?
eps said: < and > are legal characters in XML.... It's a little odd that the parser thinks that you've started to code XML within B4A - seems like a bug to me. Will see what Erel says.... Click to expand... This is not correct. < and > are NOT legal in xml and must be escaped. And there's nothing odd. B4A use the standard .NET classes to interpret the xml data (imho) and therefore the xml must be well formattet. Why should Erel reinvent the wheel?
eps Expert Licensed User Longtime User Sep 18, 2014 #7 MaFu said: This is not correct. < and > are NOT legal in xml and must be escaped. And there's nothing odd. B4A use the standard .NET classes to interpret the xml data (imho) and therefore the xml must be well formattet. Why should Erel reinvent the wheel? Click to expand... Ah, I think I understand the confusion now.. < and > are legal characters in xml but not within xml statements.
MaFu said: This is not correct. < and > are NOT legal in xml and must be escaped. And there's nothing odd. B4A use the standard .NET classes to interpret the xml data (imho) and therefore the xml must be well formattet. Why should Erel reinvent the wheel? Click to expand... Ah, I think I understand the confusion now.. < and > are legal characters in xml but not within xml statements.
Saverio Member Licensed User Longtime User Sep 18, 2014 #9 MaFu said: < and > are illegal characters in xml, this has nothing to do with B4A. You should escape it ( < as < and > as > ). Click to expand... I have tried < and >, both aren't working for me. And I think it is a B4A precisely matter. Should be B4A to convert any needed substitution in the xml code. I don't know nothing about xml, I'm just using B4A. Please can you provvide a concrete example, "exactly", related to my question? Thank you
MaFu said: < and > are illegal characters in xml, this has nothing to do with B4A. You should escape it ( < as < and > as > ). Click to expand... I have tried < and >, both aren't working for me. And I think it is a B4A precisely matter. Should be B4A to convert any needed substitution in the xml code. I don't know nothing about xml, I'm just using B4A. Please can you provvide a concrete example, "exactly", related to my question? Thank you
LucaMs Expert Licensed User Longtime User Sep 18, 2014 #10 I have no idea. But think about what problem for a single character (free app!!!). Just one thing: if it were a matter of "legality" of those characters, the problem should be with both of them, with one of them instead the problem does not occur (">").
I have no idea. But think about what problem for a single character (free app!!!). Just one thing: if it were a matter of "legality" of those characters, the problem should be with both of them, with one of them instead the problem does not occur (">").
MaFu Well-Known Member Licensed User Longtime User Sep 18, 2014 #11 Saverio said: I have tried < and >, both aren't working for me. Click to expand... Be sure using < and > < and > is wrong syntax.
Saverio said: I have tried < and >, both aren't working for me. Click to expand... Be sure using < and > < and > is wrong syntax.
Saverio Member Licensed User Longtime User Sep 18, 2014 #12 MaFu said: Be sure using < and > < and > is wrong syntax. Click to expand... Oh well, now we have what is wrong. What abot what is correct under B4A?
MaFu said: Be sure using < and > < and > is wrong syntax. Click to expand... Oh well, now we have what is wrong. What abot what is correct under B4A?
Saverio Member Licensed User Longtime User Sep 18, 2014 #13 LucaMs said: I have no idea. But think about what problem for a single character (free app!!!). Just one thing: if it were a matter of "legality" of those characters, the problem should be with both of them, with one of them instead the problem does not occur (">"). Click to expand... Ciao Luca, Yeah! you got the target. Why "<" is wrong for xml and, instead, ">" don't Someone said that both are wrong. I'm getting confused.
LucaMs said: I have no idea. But think about what problem for a single character (free app!!!). Just one thing: if it were a matter of "legality" of those characters, the problem should be with both of them, with one of them instead the problem does not occur (">"). Click to expand... Ciao Luca, Yeah! you got the target. Why "<" is wrong for xml and, instead, ">" don't Someone said that both are wrong. I'm getting confused.
MaFu Well-Known Member Licensed User Longtime User Sep 18, 2014 #14 Normally both are wrong. No idea why > works. But this have nothing to do with B4A. This escaping is same syntax as in html. Use always the escaped version and you're on the right side.
Normally both are wrong. No idea why > works. But this have nothing to do with B4A. This escaping is same syntax as in html. Use always the escaped version and you're on the right side.
Saverio Member Licensed User Longtime User Sep 18, 2014 #15 MaFu said: Normally both are wrong. No idea why > works. But this have nothing to do with B4A. This escaping is same syntax as in html. Use always the escaped version and you're on the right side. Click to expand... Thank you for reply MaFu. Now I understad a bit more! So, in short, the trick is: Working comment Code: Copy 'Example1 IIf(3 > 4, "Correct", "Wrong") will Return "Wrong" Sub IIf(QuestionTrue As Boolean, TruePart As Object, FalsePart As Object) As Object If QuestionTrue Then Return TruePart Return FalsePart End Sub Not working comment Code: Copy 'Example1 IIf(3 < 4, "Correct", "Wrong") will Return "Correct" Sub IIf(QuestionTrue As Boolean, TruePart As Object, FalsePart As Object) As Object If QuestionTrue Then Return TruePart Return FalsePart End Sub The Trick working for both comment Code: Copy 'Example1 IIf(3 > 4, "Correct", "Wrong") will Return "Correct" 'Example2 IIf(3 < 4, "Correct", "Wrong") will Return 4 Sub IIf(QuestionTrue As Boolean, TruePart As Object, FalsePart As Object) As Object If QuestionTrue Then Return TruePart Return FalsePart End Sub But, once again, as I said in the post #1, even get it working in the "Baloon", upon the subroutine, still not user-friendly. I think B4A, can do, easily, the translation. But this is just a wish ** NOTE ** For all those will read this thread, I remind them that we are talking about the comment upon the subroutine that will be shown in the hint(baloon) at the program time. The Code inside the subroutine still working, no matter whether the comment is working or not. Last edited: Sep 18, 2014
MaFu said: Normally both are wrong. No idea why > works. But this have nothing to do with B4A. This escaping is same syntax as in html. Use always the escaped version and you're on the right side. Click to expand... Thank you for reply MaFu. Now I understad a bit more! So, in short, the trick is: Working comment Code: Copy 'Example1 IIf(3 > 4, "Correct", "Wrong") will Return "Wrong" Sub IIf(QuestionTrue As Boolean, TruePart As Object, FalsePart As Object) As Object If QuestionTrue Then Return TruePart Return FalsePart End Sub Not working comment Code: Copy 'Example1 IIf(3 < 4, "Correct", "Wrong") will Return "Correct" Sub IIf(QuestionTrue As Boolean, TruePart As Object, FalsePart As Object) As Object If QuestionTrue Then Return TruePart Return FalsePart End Sub The Trick working for both comment Code: Copy 'Example1 IIf(3 > 4, "Correct", "Wrong") will Return "Correct" 'Example2 IIf(3 < 4, "Correct", "Wrong") will Return 4 Sub IIf(QuestionTrue As Boolean, TruePart As Object, FalsePart As Object) As Object If QuestionTrue Then Return TruePart Return FalsePart End Sub But, once again, as I said in the post #1, even get it working in the "Baloon", upon the subroutine, still not user-friendly. I think B4A, can do, easily, the translation. But this is just a wish ** NOTE ** For all those will read this thread, I remind them that we are talking about the comment upon the subroutine that will be shown in the hint(baloon) at the program time. The Code inside the subroutine still working, no matter whether the comment is working or not.
eps Expert Licensed User Longtime User Sep 18, 2014 #16 < starts to open up an XML structure whereas > is an ending XML structure so the both are processed differently as I suspect the parser and compiler encounter them and consider them differently.
< starts to open up an XML structure whereas > is an ending XML structure so the both are processed differently as I suspect the parser and compiler encounter them and consider them differently.
MaFu Well-Known Member Licensed User Longtime User Sep 18, 2014 #17 Saverio said: But, once again, as I said in the post #1, even get it working in the "Baloon", upon the subroutine, still not user-friendly. I think B4A, can do, easily, the translation. But this is just a wish Click to expand... But how should this work? The .net framework loads and parses the xml. B4A sees only the already parsed result, on this time it's to late. Only the tool which creates the xml can do the correction.
Saverio said: But, once again, as I said in the post #1, even get it working in the "Baloon", upon the subroutine, still not user-friendly. I think B4A, can do, easily, the translation. But this is just a wish Click to expand... But how should this work? The .net framework loads and parses the xml. B4A sees only the already parsed result, on this time it's to late. Only the tool which creates the xml can do the correction.
Saverio Member Licensed User Longtime User Sep 19, 2014 #18 MaFu said: But how should this work? The .net framework loads and parses the xml. B4A sees only the already parsed result, on this time it's to late. Only the tool which creates the xml can do the correction. Click to expand... Considering that B4A knows which line is a comment and which don't, I think, it's possible, before performing the "Save" function, translate, in the comment lines only, those characters which needs to be "escaped" and set back them at reload time, leaving the IDE buffer text as it is. I'm not a programmer and don't want teach none. This is how I would do it if the source code would my.
MaFu said: But how should this work? The .net framework loads and parses the xml. B4A sees only the already parsed result, on this time it's to late. Only the tool which creates the xml can do the correction. Click to expand... Considering that B4A knows which line is a comment and which don't, I think, it's possible, before performing the "Save" function, translate, in the comment lines only, those characters which needs to be "escaped" and set back them at reload time, leaving the IDE buffer text as it is. I'm not a programmer and don't want teach none. This is how I would do it if the source code would my.
MaFu Well-Known Member Licensed User Longtime User Sep 19, 2014 #19 You're speaking from libraries created with B4A? In this case it's possible.
J James Chamblin Active Member Licensed User Longtime User Sep 19, 2014 #20 MaFu said: Normally both are wrong. No idea why > works. But this have nothing to do with B4A. This escaping is same syntax as in html. Use always the escaped version and you're on the right side. Click to expand... Actually, only < and & are illegal in XML. It is recommended to escape >, ", and ' as well to prevent ambiguity. http://www.w3schools.com/xml/xml_syntax.asp - under Entity Reference http://www.xml.com/pub/a/98/10/guide0.html?page=3#ENTREF
MaFu said: Normally both are wrong. No idea why > works. But this have nothing to do with B4A. This escaping is same syntax as in html. Use always the escaped version and you're on the right side. Click to expand... Actually, only < and & are illegal in XML. It is recommended to escape >, ", and ' as well to prevent ambiguity. http://www.w3schools.com/xml/xml_syntax.asp - under Entity Reference http://www.xml.com/pub/a/98/10/guide0.html?page=3#ENTREF