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

Re: testing for a missing attribute

Subject: Re: testing for a missing attribute
From: Mukul Gandhi <gandhi.mukul@xxxxxxxxx>
Date: Sun, 11 Jul 2010 12:06:02 +0530
Re:  testing for a missing attribute
I'm sure you'll find the answer to this :)

just curious, what do you treat this for example:
minOccurs="5" maxOccurs="10"

is this "required" or "required repeating"?

On Sun, Jul 11, 2010 at 7:51 AM, Dan Vint <dvint@xxxxxxxxx> wrote:
> I'm trying to process an XML schema and produce some documentation. I'm
> trying to trap the various ways min/max occurs can be specified and give
the
> typical option/required/repeating translation. min/maxOccurs are not
> required values and they default to 1 when not specified. I'm having
> troubles detecting this situation.
>
> Here is what I've been trying, but it isn't working unless values are
> specified:
>
> <xsl:choose>
> B  B  B  B <xsl:when test="@minOccurs=0 and @maxOccurs=''"> optional
> B  B  B  B </xsl:when>
> B  B  B  B <xsl:when test="@minOccurs=nil and @maxOccurs=nil"> required
> B  B  B  B </xsl:when>
> B  B  B  B <xsl:when test="@minOccurs=1 and @maxOccurs=1"> required
> B  B  B  B </xsl:when>
> B  B  B  B <xsl:when test="@minOccurs=1 and @maxOccurs='unbounded'">
required
> repeating
> B  B  B  B </xsl:when>
> B  B  B  B <xsl:when test="@minOccurs='' and @maxOccurs='unbounded'">
required
> repeating
> B  B  B  B </xsl:when>
> B  B  B  B <xsl:otherwise> min:<xsl:value-of select="@minOccurs"/>
> max:<xsl:value-of select="@maxOccurs"/>
> B  B  B  B </xsl:otherwise>
> B  B </xsl:choose>
>
> ..dan
> ---------------------------------------------------------------------------
> Danny Vint
>
> Panoramic Photography
> http://www.dvint.com
>
> voice: 502-749-6179



--
Regards,
Mukul Gandhi

Current Thread

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
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.