[relaxng-user] notAllowed element and trang

CAUBEL, Hugues hugues.caubel at airbus.com
Thu Mar 3 10:26:13 ICT 2005


Hello,

I have a problem of converting "notAllowed" element to xsd with trang. 

With the example:

start = DocumentRoot

DocumentRoot = element document {AdditionalStruct,
				      para+									
}

AdditionalStruct = notAllowed
para = element p {text}

With trang, it will be translated in xsd into:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  <xs:element name="document" abstract="true"/>
  <xs:element name="p" type="xs:string"/>
</xs:schema>

I don't understand why trang translate "document" element in an abstract element ?
Is it a bug of trang or something I don't understand in "notAllowed" element ?

I have notice that when I used "notAllowed" element as optional element, like

DocumentRoot = element document {AdditionalStruct?,
					 para+									
}

the result xsd is what I expected:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  <xs:element name="document">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="p"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="p" type="xs:string"/>
</xs:schema>

What I am missing ?

Hugues



This e-mail is intended only for the above addressee. It may contain
privileged information. If you are not the addressee you must not copy,
distribute, disclose or use any of the information in it. If you have
received it in error please delete it and immediately notify the sender.
Security Notice: all e-mail, sent to or from this address, may be
accessed by someone other than the recipient, for system management and
security reasons. This access is controlled under Regulation of
Investigatory Powers Act 2000, Lawful Business Practises.


More information about the relaxng-user mailing list