The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
Use DOM API to build your object or for parsing. It is verbose, but simple. String building will always burn you later.
We sometimes utilize a cousin of XML called BobML.
Differences from XML
- No attributes
- No escaping of 5 special chars
Verbose but simple to generate and parse via string functions into values and lists.
Developed by Bob of course!
Trust me, it can get worse. I write plugins for an application that stores objects into XML files insisting on using the BOM flag and failing to correctly translate different string types from one format to another* when you try to use the methods intended for exactly that purpose. I thought using a library like xercesc would save me from dealing with the finer details, but in the end I needed to stream the already written xml file I created into another and insert that BOM flag manually - because for some reason Xerxesc ignored my telling him to do it for me...
Of course, all that requires to first find out there is such a thing like a BOM flag which isn't immediately obvious when you look at your created XML file with some standard editor. Then you need an editor that actually knows the difference. Then you need to know where to look that you actually have a BOM flag (or not), then you need to duckduckgo (or google if you prefer) for whatever that flag is, and how it's coded, and then you need to find out how in the world you get it written!
*choose any two from: utf8, utf16, wchar_t*, CString (MFC), XMLCh* (which is simply an unsigned short "string")
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
to your question "is anyone actively using XML as a data transport format?" I hope the answer is negative, because it is easier for the transport of data to use JSON. ;)
Another thing is to continue using XML vocabularies, e.g. UBL from oasis-open.org, to generate electronic documents, which have dematerialized commercial documents and especially commercial documents for electronic businesses; the evidence of the commercial transaction is the XML object, and this evidence is regulated and recognized by the authorities of the countries, who give legal effects to the artifacts and trust in their use to the market when they use digital signatures that are also legally recognized. - Colombia uses ubl-Invoice and other documents, digitally signed, as securities that circulate in the market for the sale of "discounted invoices", a type of factoring, and authenticity, integrity and non-repudiation are protected by the legislation, and the availability is protected by a State entity through public storage services and an approach to the time-stamp; in the future these dematerialized documents will be registered and made available in decentralized blockchain services, and rules will be designed in smart contracts that will be based on conditions written in a formal XML document, stored in the syntax and semantics of the chosen vocabulary, and thanks To techniques such as XAdES-EPES from etsi.org, the Merkle trees of the b lockchain will be reinforced with the cryptographic summaries (sha-2, sha-3,…) used for the digital signature, and the PKI + PKC of the blockchain nodes will be able to be reinforced by means of digital certificates from CAs recognized in legal jurisdictions, well defined. - Colombia and other countries of the American continent, and the European Union process many millions of XML documents daily, with vocabularies or with their own XSD schemas.
I remember when XML was new and how it was hyped to be the best thing since sliced bread. Then I used it for a database / C# project ... and decided never to use it again! (It didn't help that the C# class libraries for this sort of thing were utterly naff in C# 1.0). I have found no desirable use for it since (don't get me wrong I am sure it is useful ... in some distant galaxy ...).
one of my first jobs as a developer, I had xml in everything, it grew (from the early 2000's) from just needing a configuration file that I could control the output to being used in everything. by the time of leaving that job after 18 years, my library for dealing with XML in communications from screen layouts to configuration files grew pretty vast.
At the next job (never done any web dev before this) I was introduced to Json data. although, I would prefer this for communication transport if I had to go back to that old job, I would likely stay with XML for screen layouts and (some) configuration files.
Json doesn't take care of everything I would like, but YAML does look interesting in how it treats object references, where two parent objects might have a common reference to a shared object.
my current job has introduced me to more new concepts that I wouldn't have been exposed to in the last couple jobs. it's odd after spending so long at my first job I still think back to what I could have done better with my current knowledge.
Hi Glenn, What a lovely morning! I've just been cursed at by the sr. partner (after working late yesterday and early this morning) because I gave her exactly what she asked for and it's still not what she wants. Apparently, I have a bad attitude.
In the meantime, I have at least 3-4 customer issues to deal with today. (mostly Covid related)
As usual, everybody needs something, and I'm the only one here who knows what is going on.
"Go forth into the source" - Neal Morse
"Hope is contagious"
Just making sure some other s*d was working! What users want or think want verus what they need/ require been there too many times I think tomorrows going to fun, three of us need to stand 2 M apart in a 1.5 M room to witness one of our widgets in a torture test!
I just checked and according to Online Sources1 car accidents halved in 2020 due to Covid and lockdown.
Would anyone care to bet that will result in premiums dropping this year?
1 So it must be true.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!