Link to home
Start Free TrialLog in
Avatar of Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.ScFlag for Zambia

asked on

Safe Net in XML

Dear Experts!

Sorry to bother you again, in MS access we have a safe net called Optional Explicit , this helps us to ensure that the code we write is correct , now what about XML do we have any and how do we end statements like below:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
</customUI>

foe example I want to add 10 tabs, 10 groups  and 10 controls , how do I end the statements . By the way is it true that if we store the XML statements in a table , then each statement like the one above will look like below:

PK                        RibbonName                XmlRibbon
1                          MyTab                            <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
2                          Mytab                             </customUI>

etc


Kindly assist

Regards

Chris
Avatar of ste5an
ste5an
Flag of Germany image

XML per se must be well-formed.  Well-formed mean the document is syntactically correct. You normally check this before processing XML in DOM mode or on the fly in stream mode. When it is not well-formed, processing stops and no data is used. The creator/source of the XML is responsible for well-formed XML.

Then there is also XML schema. A XML schema defines the structure and occurences of elements and data types. You use it to validate a well-formed XML file. When XML schema validation fails, the same from above applies: no further processing.

This means: Your table from above is nonsense, cause you would store invalid XML fragments per row. USysRibbons takes entire ribbon declarations, not fragments.

Further more, as it is about ribbons: See Ribbons for Access. Gunter's site is the best compendium and comes with some code samples and a practical ribbon builder.

But your implicit question answered: You would create and manipulate the UI XML in an appropriate XML editor. Many of them support XML validation for well-formed-ness and schema validation. You than only store a valid UI XML in the USysRibbons table.
Avatar of Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc

ASKER

Ok well said

Does this syntax go in one raw in a system table????????

PK                        RibbonName                XmlRibbon
1                          MyTab                            <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"> <ribbon startFromScratch="true"/></customUI>


Or two rows in a system table ???????????????

PK                        RibbonName                XmlRibbon
1                          MyTab                            <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
2                          Mytab                             </customUI>
USysRibbons takes entire ribbon declarations, not fragments.
has already answered this.

USysRibbons is a table. Tables in a RDBMS take one row per entity.
ASKER CERTIFIED SOLUTION
Avatar of Fabrice Lambert
Fabrice Lambert
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you so much you have lifted my day !