Re: [xsl] How to allow element to appear 0, or 2 or more times (but not once)?

Subject: Re: [xsl] How to allow element to appear 0, or 2 or more times (but not once)?
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 31 Jul 2008 10:12:01 -0400
Mike,

At 09:01 AM 7/31/2008, you wrote:
I have a working schema for data that we use, and want to expand it to
do more checking on the XML elements.

We have a particular data element, say <FM>, that is not required to
appear in our data, but if it does, it must appear at least twice, and
possibly more.

That is, I want to detect a singular occurrence of <FM> during file
validation.

There are other sibling elements along with <FM>.

Can this be done, and can it be done with the schema itself, or with
uniqueness constraints, or???

Yes, it can certainly be done. Depending on details you haven't given us (what it mixes with), mainstream schema technologies can generally do it without fuss.


I'm using Oxygen 9.1 and XSLT 2.0.

Unfortunately, unless you're using XSLT to do it, the question of how to do it is not in scope for this list.


Cheers,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================

Current Thread