I was able to compile and run the code on the first attempt in my new MT5.
- 0 wininet problems!
- Very good code
Great contribution!, thank you.
Thanks for good library,
when i tried to pars my document from "File Input" method i got this error :*** Invalid Character found. Should be the beginning of an open tag P:0 ***.
after a headache and searching around the world i realized that the encoding that parser accepts is "UCS-2 LE BOM" so it was better mentioning this in the description,
is there any way to change this default encoding as my XMl Writer using "UTF-8-BOM"?
hi again, i found a solution for my case may it helps others,:)
i changed one line "CEasyXml::loadXmlFromFile(string pFilename)" function belongs to EasyXML Class :
int hFile=FileOpen(pFilename,FILE_READ|FILE_ANSI,CP_UTF8);
this reads my file correctly with encoding format of "UTF-8-BOM".
but still needs to remove "BOM"Bytes Of Orders="" characters from the string with :
StringReplace(pText,"","");
Hi, I'm trying to get the data on this page: https://www.usda.gov/oce/commodity/wasde/latest.xml but I ger this error with the script example_inline_parsing: *** Invalid Character found. Should be the beginning of an open tag P:0 ***
I'm just replacing the original url with the one above and the script doesn't work.
Any Idea?
Thank you
There seems to be a bug where self closing tags are used.
So in many xml editors, when there is an empty tag, the tag is automatically converted to a self-closing tag. E.g.
<element></element>
becomes
<element/> or<element />
automatically.
and according to w3 XML elements, it is legal to use self-closing tags. So I am unsure why they would not be supported when importing xml documents. Hopefully @Liquinaut can address this.
Luckily in my case, the amount of self-closing tags is relatively small. But what if the document has hundreds or thousands of such tags. are users expected to somehow convert these tags into open + close tags??
edit: For those looking to convert self-closing tags into separated tags, you may want to use this RegEx find/replace
Find: (<)(\w*)(.*)(/>)
Replace: <$2$3></$2>
[This is with .NET regEx Engine used in TextCrawler3. Other engines might use a different format; experiment]. Preserves all attributes within the original tag, if any
- www.w3schools.com
Hello I am using the library but I get the error in easyxmlnode.mqh of invalid pointer in this function:
CEasyXmlNode *CEasyXmlNode::createSibling(CEasyXmlNode *pSiblingNode) { pSiblingNode.Prev(GetPointer(this)); GetPointer(this).Next(pSiblingNode); ParentNode.createChild(pSiblingNode); return ParentNode.LastChild(); }
Do you know how can I solve the error?
Hello I am using the library but I get the error in easyxmlnode.mqh of invalid pointer in this function:
Do you know how can I solve the error?
a forex factory calendar xml, it works almost everytime but randomly it show that error. Can I do something to avoid the error or run the code again if it detect that error again?
You could tweak the library to catch this problem and return NULL in createSibling(), but you would have to fix the calling point to deal with it. And possibly you could have other issues.
This error probably appears because you get a wrong XML answer from time to time, so in my opinion the best solution is to check for that beforehand.
You could tweak the library to catch this problem and return NULL in createSibling(), but you would have to fix the calling point to deal with it. And possibly you could have other issues.
This error probably appears because you get a wrong XML answer from time to time, so in my opinion the best solution is to check for that beforehand.
Thank you for your answer Alain, ok I will check if I can solve the error by checking the xml answer.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
EasyXML - XML Parser:
EasyXML is a native MQL5 XML Parsing Library.
It can parse XML from three different sources: URL, File and String Input. It is completey object oriented an strives to integrate neately with MQL5, as it utilizes CObject and CArrayObj from the MQL5 Standard library to store the DOM.
Output:
Author: Paul van Hemmen