The reference to entity “foo” must end with the ‘;’ delimiter

The ampersand & is a special character in HTML and XML. If you want to use it as a normal character, you have to encode it correctly. Write &amp; instead of &: src=”https://stackoverflow.com/questions/6483807/…9623&amp;w=180&amp;h=46&amp;style=white&amp;variant=text&amp;loc=en_US” & denotes the start of an encoded entity, such as &lt; for <, or &amp; for &. In your case the parser … Read more

Convert XML String to Object

You need to use the xsd.exe tool which gets installed with the Windows SDK into a directory something similar to: C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin And on 64-bit computers: C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\bin And on Windows 10 computers: C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin On the first run, you use xsd.exe and you convert your sample XML into a … Read more

DOMDocument in php

If you want to work with DOM you have to understand the concept. Everything in a DOM Document, including the DOMDocument, is a Node. The DOMDocument is a hierarchical tree structure of nodes. It starts with a root node. That root node can have child nodes and all these child nodes can have child nodes … Read more

How to read and write XML files?

Here is a quick DOM example that shows how to read and write a simple xml file with its dtd: <?xml version=”1.0″ encoding=”UTF-8″ standalone=”no”?> <!DOCTYPE roles SYSTEM “roles.dtd”> <roles> <role1>User</role1> <role2>Author</role2> <role3>Admin</role3> <role4/> </roles> and the dtd: <?xml version=”1.0″ encoding=”UTF-8″?> <!ELEMENT roles (role1,role2,role3,role4)> <!ELEMENT role1 (#PCDATA)> <!ELEMENT role2 (#PCDATA)> <!ELEMENT role3 (#PCDATA)> <!ELEMENT role4 (#PCDATA)> … Read more

jQuery XML error ‘ No ‘Access-Control-Allow-Origin’ header is present on the requested resource.’

You won’t be able to make an ajax call to http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml from a file deployed at http://run.jsbin.com due to the same-origin policy. As the source (aka origin) page and the target URL are at different domains (run.jsbin.com and www.ecb.europa.eu), your code is actually attempting to make a Cross-domain (CORS) request, not an ordinary GET. In … Read more

How to fix error: The markup in the document following the root element must be well-formed

General case The markup in the document following the root element must be well-formed. This error indicates that your XML has markup following the root element. In order to be well-formed, XML must have exactly one root element, and there can be no further markup following the single root element. One root element example (GOOD) … Read more

How to parse XML using vba

Thanks for the pointers. I don’t know, whether this is the best approach to the problem or not, but here is how I got it to work. I referenced the Microsoft XML, v2.6 dll in my VBA, and then the following code snippet, gives me the required values Dim objXML As MSXML2.DOMDocument Set objXML = … Read more