Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml] repeating elements

From: "C. M. Sperberg-McQueen" <cmsmcq@---.--->
To: Ignacio Garcia <igcxslt@-----.--->
Date: 6/4/2007 3:57:00 AM
On 29 May 2007, at 09:32 , Ignacio Garcia wrote:

> ... I have created a schema that with a complex type that contains  
> a few
> html like tags:
>
> <xsd:complexType name="notesText" mixed="true">
>       <xsd:sequence minOccurs="0" maxOccurs="unbounded">
>               <xsd:element name="b" type="xsd:string" minOccurs="0"/>
>               <xsd:element name="i" type="xsd:string" minOccurs="0"/>
>               <xsd:element name="p" type="notesText" minOccurs="0"/>
>               <xsd:element name="br" minOccurs="0">
>                       <xsd:simpleType>
>                               <xsd:restriction base="xsd:string">
>                                       <xsd:length value="0"/>
>                               </xsd:restriction>
>                       </xsd:simpleType>
>               </xsd:element>
>               <xsd:element name="a" minOccurs="0">
>                       <xsd:complexType mixed="true">
>                               <xsd:attribute name="href"
>                                 type="xsd:string" use="required"/>
>                       </xsd:complexType>
>               </xsd:element>
>               <xsd:element name="ul" minOccurs="0">
>                       <xsd:complexType>
>                               <xsd:sequence maxOccurs="unbounded">
>                                       <xsd:element name="li"
>                                         type="notesText"  
> minOccurs="0"/>
>                               </xsd:sequence>
>                       </xsd:complexType>
>               </xsd:element>
>     </xsd:sequence>
> </xsd:complexType>
>
> ...
> HOWEVER, using this definition none of the html editors I have used
> lets me add the same html-like-tag two times in a row with text in
> between them......
> Does anyone know why???

Like Michael Kay, I believe this is a bug.  It seems an implausible
bug, though, so you might check to make sure what you are showing
is really what they are seeing.  The behavior you describe is consistent
with systems which see a version of this declaration with
maxOccurs="1" (possibly defaulted) on the sequence.  You might
modify your sample element:  you say that

   This is some <b>text</b> with <i>html</i> tags on it.

is accepted but

   This is some <b>text</b> with <i>html</i> tags <i>on</i> it.

is not.  How about

   This is some <i>text</i> with <b>html</b> tags on it.

?

> I have tried adding <sequence minOccurrs=0" maxOccurrs="unbounded">
> surrounding all the html-like elements, but that does not work
> either...

If you're willing to modify the declaration to work around the
deficiencies of tools, you might consider changing the enclosing
sequence to a choice; the two patterns are equivalent (i.e. they
recognize the same language) and the repeated choice is more
likely to have been checked by the developers.

--C. M. Sperberg-McQueen
   World Wide Web Consortium



From erin.cavanaugh@a... Mon Jun 04 16:00:29 2007
Received: from wiggum.w3.org ([128.30.52.23])
	by frink.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent