unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: rms@gnu.org
Cc: bugs@gnu.support, ulm@gentoo.org, emacs-devel@gnu.org,
	ams@gnu.org, arthur.miller@live.com, dgutov@yandex.ru
Subject: Re: Org schemas we talked to be non-free, was: [ELPA] New package: repology.el
Date: Tue, 26 Jan 2021 17:57:37 +0200	[thread overview]
Message-ID: <83a6sv1yj2.fsf@gnu.org> (raw)
In-Reply-To: <E1l4HPX-0000ln-Be@fencepost.gnu.org> (message from Richard Stallman on Tue, 26 Jan 2021 01:01:07 -0500)

> From: Richard Stallman <rms@gnu.org>
> Cc: ulm@gentoo.org, bugs@gnu.support, ulm@gentoo.org,
> 	emacs-devel@gnu.org, ams@gnu.org, arthur.miller@live.com,
> 	dgutov@yandex.ru
> Date: Tue, 26 Jan 2021 01:01:07 -0500
> 
>   > A schema can be similarly "generalized" (a.k.a. "extended") without
>   > changing it: you include the schema in your own and then add your own
>   > data types and conditions.
> 
> Can you please show me how sort of generalization is done?  It isn't
> allowed by editing the schema; the license of the schema does not give
> permission for such modifications.
>   
> Is there some other mechanism that can be used to do that job?  If so,
> could you please show me something about that mechanism, and what it
> can and can't do?

Basically you reference the original schema in yours, and then add
your extensions or overrides.

There are several methods available for that, but the simplest one is
to define new elements using the ones defined in the original schema.
Here's a simple example:

  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="USaddress">
   <xs:complexType>
    <xs:sequence>
     <xs:element name="street1" type="xs:string" minOccurs="0"/>
     <xs:element name="street2" type="xs:string" minOccurs="0"/>
     <xs:element name="city"    type="xs:string"/>
     <xs:element name="state"   type="xs:string"/>
     <xs:element name="zip"     type="xs:string" minOccurs="0"/>
    </xs:sequence>
   </xs:complexType>
  </xs:element>
  </xs:schema>

This defines an element "US Address" using xs:string type defined in
the W3C XMLSchema.  Then you can define a new element "Contact", on
top of that, by adding a name to an address:

  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
   <!-- Reference to External Module containing USaddress definition -->
   <xs:include schemaLocation="USaddress.xsd"/>
   <!-- Element containing USaddress element from included module -->
   <xs:complexType name="contact">
    <xs:sequence>
     <xs:element name="Name" type="xs:string"/>
     <xs:element ref="USaddress"/>
    </xs:sequence>
   </xs:complexType>
  </xs:schema>

You can also extend an existing type:

  <xs:complexType name="extendedNameType">
    <xs:extension base="nameType">
      <xs:sequence>
	<xs:element name="gen" type="xs:string"/>
      </xs:sequence>
    </xs:extension>
  </xs:complexType>

This extends the existing type "nameType" (presumably defined in some
schema you include as above) by adding to it the sub-element "gen".

There's also a facility to redefine existing data types.

Etc. etc.  This way, there's no reason to change the original schema,
you just extend it in your own schema, using the original one as the
baseline.

A few resources to read up on this:

  https://www.w3schools.com/xml/el_extension.asp
  https://www.ibm.com/developerworks/library/x-xtendschema/index.html
  https://stackoverflow.com/questions/3392402/how-do-i-extend-a-base-schema-with-custom-elements-while-remaining-open-to-chang



  reply	other threads:[~2021-01-26 15:57 UTC|newest]

Thread overview: 145+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-30 16:23 [ELPA] New package: repology.el Nicolas Goaziou
2020-12-30 19:34 ` Jean Louis
2020-12-30 21:01   ` Clément Pit-Claudel
2020-12-31 13:31     ` Jean Louis
2020-12-31 11:46   ` Nicolas Goaziou
2020-12-31 13:11     ` Jean Louis
2020-12-31 20:30       ` Ulrich Mueller
2021-01-01  7:31         ` Richard Stallman
2021-01-01 10:05         ` Jean Louis
2021-01-01 11:56           ` Eli Zaretskii
2021-01-02  9:56             ` Jean Louis
2021-01-02  5:30           ` Richard Stallman
2021-01-04 12:09             ` Dmitry Gutov
2021-01-04 14:39               ` Alfred M. Szmidt
2021-01-04 15:00                 ` Ulrich Mueller
2021-01-04 16:32                   ` Alfred M. Szmidt
2021-01-05  6:45                   ` Richard Stallman
2021-01-05  8:56                     ` Alfred M. Szmidt
2021-01-07  7:34                       ` Richard Stallman
2021-01-04 15:02                 ` Dmitry Gutov
2021-01-04 16:29                   ` Alfred M. Szmidt
2021-01-04 17:08                     ` Dmitry Gutov
2021-01-04 17:12                       ` Alfred M. Szmidt
2021-01-04 17:17                         ` Dmitry Gutov
2021-01-04 17:58                           ` Alfred M. Szmidt
2021-01-04 17:43                         ` Clément Pit-Claudel
2021-01-04 17:55                           ` Vasilij Schneidermann
2021-01-04 18:51                             ` Clément Pit-Claudel
2021-01-04 22:21                               ` Vasilij Schneidermann
2021-01-05  2:09                                 ` Stefan Monnier
2021-01-05  6:42                                   ` Richard Stallman
2021-01-05  9:28                                     ` Ulrich Mueller
2021-01-06  5:03                             ` Richard Stallman
2021-01-06  9:44                               ` Alfred M. Szmidt
2021-01-07 17:51                                 ` Richard Stallman
2021-01-04 19:14                           ` Ulrich Mueller
2021-01-04 19:17                             ` Clément Pit-Claudel
2021-01-06  5:02                       ` Richard Stallman
2021-01-06 10:58                         ` Dmitry Gutov
2021-01-06 14:41                         ` Jean Louis
2021-01-06 14:59                           ` Arthur Miller
2021-01-06 15:21                             ` Jean Louis
2021-01-06 16:23                               ` Arthur Miller
2021-01-06 18:53                                 ` Jean Louis
2021-01-06 19:26                                   ` Eli Zaretskii
2021-01-06 21:18                                     ` Alfred M. Szmidt
2021-01-06 21:25                                       ` Dmitry Gutov
2021-01-07  7:47                                         ` Richard Stallman
2021-01-07  8:54                                       ` Jean Louis
2021-01-07 14:07                                       ` Eli Zaretskii
2021-01-07  7:49                                     ` Richard Stallman
2021-01-07 11:41                                       ` Dmitry Gutov
2021-01-09  6:39                                         ` Richard Stallman
2021-01-09 10:50                                           ` Dmitry Gutov
2021-01-07 14:24                                       ` Eli Zaretskii
2021-01-07  8:15                                     ` Jean Louis
2021-01-07 14:37                                       ` Eli Zaretskii
2021-01-06 20:36                                   ` Arthur Miller
2021-01-07  7:48                                     ` Richard Stallman
2021-01-07 16:53                                       ` Arthur Miller
2021-01-14  5:21                                         ` Richard Stallman
2021-01-15 14:52                                           ` Arthur Miller
2021-01-16  5:14                                             ` Richard Stallman
2021-01-07  7:49                                   ` Richard Stallman
2021-01-07  9:00                                     ` Jean Louis
2021-01-08  6:21                                       ` Richard Stallman
2021-01-07 10:55                                     ` Ulrich Mueller
2021-01-09  6:34                                       ` Richard Stallman
2021-01-09 21:07                                         ` Ulrich Mueller
2021-01-11  4:46                                           ` Richard Stallman
2021-01-12  8:24                                             ` Ulrich Mueller
2021-01-20  6:14                                       ` Richard Stallman
2021-01-21 11:09                                         ` Ulrich Mueller
2021-01-22  6:06                                           ` Richard Stallman
2021-01-22  9:43                                             ` Ulrich Mueller
2021-01-24  6:35                                               ` Richard Stallman
2021-01-24  8:34                                                 ` Ulrich Mueller
2021-01-25  5:53                                                   ` Richard Stallman
2021-01-25  6:52                                                     ` Jean Louis
2021-01-25 12:11                                                       ` Fabrice BAUZAC-STEHLY
2021-01-25 15:29                                                       ` Eli Zaretskii
2021-01-27  7:37                                                       ` Richard Stallman
2021-01-25 15:51                                                     ` Dmitry Gutov
2021-01-25 17:59                                                       ` Jean Louis
2021-01-25 18:21                                                         ` Dmitry Gutov
2021-01-26  3:40                                                           ` Jean Louis
2021-01-26  6:10                                                           ` Richard Stallman
2021-01-26 13:42                                                             ` Stefan Monnier
2021-01-27 18:32                                                               ` Jean Louis
2021-01-25 19:33                                                         ` Eli Zaretskii
2021-01-25 19:38                                                         ` Eli Zaretskii
2021-01-26 13:21                                                         ` Richard Stallman
2021-01-26  5:59                                                       ` Richard Stallman
2021-01-26 13:15                                                         ` Dmitry Gutov
2021-01-27  7:41                                                           ` Richard Stallman
2021-01-24 10:53                                                 ` Org schemas we talked to be non-free, was: " Jean Louis
2021-01-24 17:50                                                   ` Ulrich Mueller
2021-01-24 19:12                                                     ` Jean Louis
2021-01-24 19:53                                                       ` Eli Zaretskii
2021-01-24 20:36                                                         ` Ulrich Mueller
2021-01-25 15:06                                                           ` Eli Zaretskii
2021-01-26  6:01                                                             ` Richard Stallman
2021-01-26 15:57                                                               ` Eli Zaretskii [this message]
2021-01-26 16:03                                                                 ` Dmitry Gutov
2021-01-26 16:13                                                                   ` Eli Zaretskii
2021-01-26 16:14                                                                     ` Dmitry Gutov
2021-01-26 16:31                                                                       ` Eli Zaretskii
2021-01-26 22:55                                                                         ` Dmitry Gutov
2021-01-28  6:29                                                                 ` Richard Stallman
2021-01-28 14:08                                                                   ` Eli Zaretskii
2021-01-29  6:36                                                                     ` Richard Stallman
2021-01-24 20:47                                                         ` Jean Louis
2021-01-25 15:13                                                           ` Eli Zaretskii
2021-01-25 17:50                                                             ` Jean Louis
2021-01-25 17:56                                                             ` Jean Louis
2021-01-25 19:27                                                               ` Eli Zaretskii
2021-01-26  3:50                                                                 ` Jean Louis
2021-01-26  6:09                                                               ` Richard Stallman
2021-01-25 20:10                                                             ` Ulrich Mueller
2021-01-25 20:21                                                               ` Eli Zaretskii
2021-01-26  6:09                                                               ` Richard Stallman
2021-01-25  5:53                                                         ` Richard Stallman
2021-01-25 15:27                                                           ` Eli Zaretskii
2021-01-24 20:46                                                       ` tomas
2021-01-27  7:35                                                         ` Richard Stallman
2021-01-25  5:53                                                       ` Richard Stallman
2021-01-25  9:27                                                         ` Ulrich Mueller
2021-01-26  6:03                                                           ` Richard Stallman
2021-01-26  9:24                                                             ` Ulrich Mueller
2021-01-27  7:43                                                               ` Richard Stallman
2021-01-26 15:43                                                             ` Jose A. Ortega Ruiz
2021-01-26 16:48                                                             ` Kévin Le Gouguec
2021-01-28  6:34                                                               ` Richard Stallman
2021-01-25  5:51                                                     ` Richard Stallman
2021-02-16  5:21                                       ` freedom issues in free software Richard Stallman
2021-01-07 15:05                                     ` [ELPA] New package: repology.el Stefan Monnier
2021-01-13 15:57                                       ` Richard Stallman
2021-01-05  6:33               ` Richard Stallman
2021-01-05 11:21                 ` Dmitry Gutov
2021-01-07  7:32                   ` Richard Stallman
2020-12-30 21:58 ` [ELPA] New package: repology.el (v2) Nicolas Goaziou
2021-01-04 11:45   ` [ELPA] New package: repology.el (v3) Nicolas Goaziou
2021-01-04 17:32     ` Stefan Monnier
2021-01-19  9:50       ` [ELPA] New package: repology.el (v4) Nicolas Goaziou
2021-01-20  6:13         ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83a6sv1yj2.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=ams@gnu.org \
    --cc=arthur.miller@live.com \
    --cc=bugs@gnu.support \
    --cc=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    --cc=ulm@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).