Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: NewBie Question

From: George Cristian Bina <george@---------.--->
To: =?windows-1252?Q?H=E4mmer_Wolfgang?= <Wolfgang.Haemmer@---.--->
Date: 6/23/2005 8:08:00 PM
Hi,

Well, *just as a note*, this is a case that has a direct support in 
Relax NG, the anyName nameclass or * in compact syntax:

start =
   element root {
     element * {
       text
       & element LocalVariables {
           (element l_start { text },
            element l_end { text })
           | (element l_first { text },
              element l_second { text },
              element l_third { text })
         }
     }+
   }

or

<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
     xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
     datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
     <start>
         <element name="root">
             <oneOrMore>
                 <element>
                     <anyName/>
                     <interleave>
                         <text/>
                         <element name="LocalVariables">
                             <choice>
                                 <group>
                                     <element 
name="l_start"><text/></element>
                                     <element name="l_end"><text/></ele=
ment>
                                 </group>
                                 <group>
                                     <element 
name="l_first"><text/></element>
                                     <element 
name="l_second"><text/></element>
                                     <element 
name="l_third"><text/></element>
                                 </group>
                             </choice>
                         </element>
                     </interleave>
                 </element>
             </oneOrMore>
         </element>
     </start>
</grammar>

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
www.---.com


H=E4mmer Wolfgang wrote:
> 
> Salut Pete, Henry, George,
>  
> I will follow all the leads you all gave me. This is a great mailing li=
st!!!
> Thanks a lot for your help!
>  
> Best regards, Wolf
> 
>     -----Original Message-----
>     *From:* xmlschema-dev-request@w...
>     [mailto:xmlschema-dev-request@w...]*On Behalf Of *Pete Hendry
>     *Sent:* Donnerstag, 23. Juni 2005 14:19
>     *To:* xmlschema-dev@w...
>     *Subject:* Re: NewBie Question
> 
>     The weakness here is that you rely on the sender adding xsi:type to
>     the instance to get validation. If you do not control the sender
>     then this could be a problem. You will not know whether the parser
>     validated each element or not unless you check that xsi:type is
>     present on each which would likely mean you have to parse to DOM an=
d
>     check each place where this could be present in the instance. That
>     is, if you require validation. If you don't then it doesn't matter.
> 
>     The general problem with this approach is that the schema defines a
>     contract on the document. The contract being defined would say that
>     any element is allowed but there is no way to say that only element=
s
>     of a specific type are allowed. So the contract being defined is no=
t
>     specific enough to use the schema without out-of-band information.
> 
>     Pete
> 
>     Henry S. Thompson wrote:
> 
>>-----BEGIN PGP SIGNED MESSAGE-----
>>Hash: SHA1
>>
>>H=E4mmer Wolfgang writes:
>>
>>  
>>
>>>I don't know these name in advance.
>>>    
>>
>>
>>Another option is to use xsi:type in the instance -- see the XML
>>Schema Primer, particularly section 4.7 [1] (but you don't want to
>>make your type abstract).  You'll end up with e.g.
>>
>> <TableDropBanana xsi:type="CommonType">
>>  ...
>>  <LocalVariables>...</LocalVariables>
>> </TableDropBanana>
>>
>>Ultimate fallback is to use lax validation and give LocalVariables a
>>top-level declaration, and at least it and its contents will get
>>validated properly.
>>
>>ht
>>
>>[1] http://www.w3.org/TR/xmlschema-0/#abstract
>>- -- 
>> Henry S. Thompson, HCRC Language Technology Group, University of Edinb=
urgh
>>                     Half-time member of W3C Team
>>    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
>>            Fax: (44) 131 650-4587, e-mail: ht@i...
>>                   URL: http://www.ltg.ed.ac.uk/~ht/
>>[mail really from me _always_ has this .sig -- mail without it is forge=
d spam]
>>-----BEGIN PGP SIGNATURE-----
>>Version: GnuPG v1.2.6 (GNU/Linux)
>>
>>iD8DBQFCuotGkjnJixAXWBoRAs4BAJ4+2iHlT3lEMFhfR0pT0cIMyo7UIACfX/Dq
>>tzMWVtQujpdVbNW80MyKPBs=
>>=a61e
>>-----END PGP SIGNATURE-----
>>
>>  
> 
>  
>  
> This message is for the named person's use only. It may contain 
> confidential, proprietary or legally privileged information. No 
> confidentiality or privilege is waived or lost by any mistransmission. 
> If you receive this message in error, please notify the sender urgently=
 
> and then immediately delete the message and any copies of it from your 
> system. Please also immediately destroy any hardcopies of the message. 
> You must not, directly or indirectly, use, disclose, distribute, print,=
 
> or copy any part of this message if you are not the intended recipient.=
 
> The sender=92s company reserves the right to monitor all e-mail 
> communications through their networks. Any views expressed in this 
> message are those of the individual sender, except where the message 
> states otherwise and the sender is authorised to state them to be the 
> views of the sender=92s company.
> 

From steven@s... Thu Jun 23 21:40:33 2005
Received: from bart.w3.org ([128.30.52.40])
	by frink.w3.org with esmtp (Exim 4.50)
	id 1DlZR3-0004Zw-2H
	for xmlschema-dev@l...; Thu, 23 J


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