472,954 Members | 2,292 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,954 software developers and data experts.

w3c Schema naming patterns and template-based schema generation

In a schema I've been working on recently, a convention I evolved was to use a
consistent naming pattern such that, for instance, a Resident could appear in
a ResidentSet, and could be referred to by a ResidentRef, and the same pattern
would apply to other types of entities. That amounts to a lot of duplication
in the schema, though, and results in a need to enforce consistency in how the
naming convention is applied.

A solution I've come up with is to have a template schema file in which any
element can be a template for any pattern (by using an attribute from the
template system's namespace) where patterns are described in annotation
elements of the schema, each pattern contains one or more cases, and each case
indicates a set of text replacements represented as clause/text pairs. Each
template, then, gets output multiple times, once for each case in its pattern,
and for each case, any text matching the clause text in any attribute, element
text content, comment, or processing instruction is replaced with the
corresponding replacement text.

My questions for this group are...

1. Does anyone else think this is worthwile?
2. What should this system be called? Currently, I'm calling my prototype
SchemaSquared.xsl. Schema Squared refers to the fact that the template file
is sort of applied to itself. It contains both template code and expansion
case information to apply to the templates to produce the final xsd.

If you're on the fence as to whether this would be useful, here are some more
details, but please note that I'm not digging for approval here. I'm really
hoping for honest opinions of whether this is a good idea or not. If enough
people like the idea, I'll make a sourceforge project for it.

More details...

A template schema is also a valid schema unto itself and can be directly
validated by xsl editors like oXygen and XML Spy even though it can't be used
directly (without expanding first) to validate useful XML documents.

If one or more cases of any template need to be overridden by another
implementation, just make a sibling element that includes an override
attribute specifying the case it overrides. Replacements for the case are
still performed on an override so that, by using clauses, it can be valid in
the non-expanded template schema even if it has element references to other
globally defined elements requiring template expansion.

Template patterns can occur at any depth within the schema, and will be
replicated at the place they occur as multiple siblings. Template expansions
can be nested - a template element can contain other template elements for
different patterns.

I have an XSL file that right now that is surprisingly clear and short and
implements all of the functionality descibed here, but with some quirks to
work out such as correctly handling different prefixes for schema elements in
the template schema file.

Aug 9 '05 #1
0 1110

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Shemp | last post by:
We are having a debate in our organization about naming conventions for abstract classes. The three proposed methods are: 1) Prefix the class name with abstract. Example: AbstractUser 2)...
by: Tony Ha | last post by:
Hello I am learning Python for in the pass ten months, and have brought a few books about Python. Most of them are good books by its only right, and all of them only teach you how to write...
by: NKOBAYE027 | last post by:
Hi Folks: Can anyone direct me to a good resource on design patterns. I'd like to use them for a project I'm working on regarding set theory - in particular I'd like to use the Decorator pattern to...
by: Tim Smith | last post by:
Dear All, Silly question, but I am having trouble understanding the diagram on the inside back cover entitled "Design Pattern Relationships." It shows the relationships between all of the...
by: Mark Broadbent | last post by:
stupid question time again to most of you experts but this is something that continually bothers me. I am trying to get into the habit of naming variables and controls in an assembly as per...
by: Jonathan Wood | last post by:
I was just wondering what naming convention most of you use for class variables. Underscore, "m_" prefix, camel case, capitalized, etc? Has one style emerged as the most popular? Thanks for...
by: Allen | last post by:
Yesterday I discussed with my boss about method naming. In the RPC argument pack / unpack classes, packing & unpacking remote procedure calling arguments into / from a byte buffer. I named the...
by: Miguel Guedes | last post by:
Hello, Does anyone have a link to the C++ Standard Library naming conventions that they could share? I have found a few links to pages on C++ naming conventions but am unsure as to what standard...
by: vital | last post by:
Hi, I am doing a Project designing all the three tiers(Presentation, Business and Database). In the Middle tier what patterns should be used and how should I use one. In Middle tier C#...
by: vital | last post by:
Hi, I am doing a Project designing and development of all the three tiers(Presentation, Business and Database). In the Presentation tier are there any patterns should be followed. I want to...
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.