-
Hi all, |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 11 replies
-
Hi Renato, There is no missing information. Here is how to get a grasp of it:
Let me explain.
So think of it like this: visual -> conceptual -> physical Let me know if this helps. Regards, |
Beta Was this translation helpful? Give feedback.
-
To complement the answer from @rousso : As this information is defined in a standard way in the XSD files, we currently have no plans to provide it in a different way. |
Beta Was this translation helpful? Give feedback.
-
Hi again Renato, First I will address a couple of points on the specific things you ask, and then I will give you more details on how to go about creating the XML file.
See my explanation of the process later in this answer.
If I understand well your question, the idea you are considering is to start from the XSD to generate a "generic" XML file inside which you can later inject the notice data collected from the user (and remove any unused XML elements). The idea is valid. A similar idea was our first attempt at this (before we started creating the SDK) and I think that this is more or less the approach that our eNotices2 application still uses. I think it should work, although you will still need to juggle the transposition of the data from the visual model which you already have on your user's screen, to the physical model that you create from the XSD. In my head it is simpler and safer to go through the visual -> conceptual -> physical model transformation because it is a rules based approach that uses an intermediate representation and will require far fewer mind bending if-then-elses. In my mind the approach we try to take in the Notice Editor Sample Application will be easier to implement and to maintain. It's your choice.
See the implementation we have so far for this in the Notice Editor Sample Application. Going back to the topic of visual -> conceptual -> physical model transformation. Quick clarification before I continue: I use the term "model" (visual, conceptual, physical) but I really refer to a "representation" (an "instance" of a model). It will be an in-memory object at the end of the day that follows some rules for its structure. I hope this makes sense. Let's take them one by one: Visual model:This should be a collection of objects that are either The elements you need for the visual model are all inside the notice-type-definition file (inside the When the user submits the form, you will have to traverse your visual model and for each element that the user has provided data you need to create a corresponding element in the conceptual model. Conceptual model:The conceptual model is a collection of objects that are either While you are creating your conceptual model you will be actually traversing your visual model element by element, adding to the conceptual model a corresponding element for each element in your visual model.
In short, the structure of the elements in your conceptual model will follow the structure provided in At the end of this process all the data that the user has entered on the screen will be in a conceptual model structure that is much closer to the final physical model structure. The next thing you need to do is derive the physical model from the conceptual one, which should be much easier now that you have "escaped" the visual structure. Physical model:The physical model needs to correspond to the actual XML structure. The physical model therefore can only contain To create the physical model, you will traverse your conceptual model. Each
At the end of this process all the data entered by the user will be in a structure that has a one-to-one correspondence with the structure of the XML file that you want to generate. Your final step is to traverse this physical model that you just generated and write the XML output file element by element. I hope this helps to clarify the idea a bit further. Maybe an idea that combines your suggestion to "start with the XSD" with the idea of transforming from a visual to a conceptual model first, is an even better approach that keeps the best of both worlds. In this case you would still do the work of transforming from the visual to the conceptual model, but, instead of generating the XML element by element, you can create it from the XSD and then fill it in from the conceptual model where the correspondence between Regards |
Beta Was this translation helpful? Give feedback.
-
@rengit62 FYI for converting the conceptual model to XML (building the xml nodes one by one by using/splitting the XPath): |
Beta Was this translation helpful? Give feedback.
-
Right ! Thanks Jasper ! |
Beta Was this translation helpful? Give feedback.
Right ! Thanks Jasper !