Uniface Structs: hurdle 1
Author: gianni.sandigliano@unifacesolutions.com (gianni)
I have had a light education on Uniface structs and, since first time I've heard about it, I always looked for an occasion to dedicate to them some deep learning time. Now I need to write a very simple Uniface application to: - Load a received XML from disk - Recognize few specific TAG(S) and get their (sub)value(s) - Write those values into some RDBMS tables - Delete each recognized TAG with its (sub)value(s) - Dump a new XML without those recognized and deleted TAG(S) Because those tags data I should managed are data valid only INTERNALLY at the user company, it is NOT my task to verify a full XML consistency, so for me: - No validation - No verification I am only interested to receive a loadable XML! It's time to test using Uniface struct in a real usecase. ========== ========== ========== ========== First hurdle: a very simple instruction: xmltostruct/full vStruct, "XMLToTestStruct.xml" where "XMLToTestStruct.xml" is a file on disk. It requires MINUTES to answer $status = -1503 and stop loading the XML into vStruct. A further inspection enable to discover the received XML contains few errors in the initial schema declarations part of the document: checking those schema URL with a browser - a first one references to a not existing page - a second one load a page defining itself as outdated from a newer document/page linked into its structure - a third one references to same not existing page as first one NOT an healthy XML this one...but it could happen...it's part of my usecase! Let's find a way to overcome this hurdle? Trying to: - load all referred pages with a browser to get all those errors requires only few SECONDS! - fix errors into XML schema declarations and Uniface is loading the XML in less than 2 seconds. Great! Uniface is obviously doing much more than I really need...and something in a different way, not in line with my needs. Basic questions: 1) Why Uniface is forcing a verification requiring MINUTES to answer back with $status = -1503, while a browser get answered for same pages in SECONDS? 2) Is there any way to avoid Uniface verification just loading into a struct a "well formed XML" (eventually) giving back a warning instead of an error? 3) Using structs in this case am I trying to shoot a sparrow with a cannon? Should I avoid struct, go back to load XML as a text and search strings in it? Thanks in advance for any answer / suggestion / hint. Gianni