[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Advantages/disadvantages of extremely simple XML designs

  • From: John Cowan <johnwcowan@gmail.com>
  • To: "Costello, Roger L." <costello@mitre.org>
  • Date: Sat, 11 Aug 2018 19:55:51 -0400

Re:  Advantages/disadvantages of extremely simple XML designs
I think tthat for such a document design, you should skip the XML Schema (or any other grammar schema) altogether, and just stick with Schematron.

On Sat, Aug 11, 2018 at 10:35 AM Costello, Roger L. <costello@mitre.org> wrote:

Hi Folks,

There is an Apache technology called NiFi. It is used to distribute data. [1]

A feature of NiFi is that a NiFi application will automatically generate metadata about the data it ingests. The metadata is formatted as XML, which has this form:

<properties>
   
<entry key="A">A content</entry>
   
<entry key="B">B content</entry>
   
<entry key="C">C content</entry>
   
<entry key="D">D content</entry>
    ...
</properties>

 

Each item of metadata is represented with an <entry> element. The “key” attribute contains the name of the metadata item, and the value of the <entry> element contains the value of the metadata item.

What are the advantages and disadvantages of this type of XML design?

Advantages:

  • The markup is simple and regular: just a root element and one element that is repeated over and over. So, it’s easy to understand and use.
  • The design is highly extensible: to represent new metadata items, simply add more <entry> elements. No changes to the markup (i.e., no change to the XML Schema).

Disadvantages:

There is likely to be a constraint (relation) between an <entry>’s @key value and the <entry>’s content:

Examples of co-constraints:

  • “If @key has the value A, then the content must be a string restricted to 20 characters and must have this pattern: regex
  • “If @key has the value B, then the content must be a member of this enumeration list: foo, bar, blah
  • And so on.

 

XML Schema 1.0 doesn’t support co-constraints. [2] So, you need to supplement XSD with Schematron. In some environments, it is simply not feasible to perform both XML Schema validation and Schematron validation.

Consequently, co-constraints go unexpressed. The design hampers the ability to use XML Schema’s powerful constraint mechanisms. Thus, the design hampers the ability to perform powerful error-checking.

Do you agree with these advantages and disadvantages? Are there other advantages and disadvantages?

/Roger

[1] https://nifi.apache.org/

[2] Yes, I know that XSD 1.1 supports co-constraints, but (I assert, without evidence that) there is lesser support for XSD 1.1 than for XSD 1.0 or for Schematron.

 

PNG image

PNG image



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.