On Tue, Jan 30, 2018 at 02:53:44AM +0000, Karl Stubsjoen wrote:
>
> I'd like to convert Xml Schema's directly to Sql Table scripts and
> simple CRUD operations.  I will write my own stylesheets to do this
> but figured I'd check first with support to see what is available.
> Unfortunately when you Google it, only the "other" product pops up
> as having a solution.

One of the perks of not dealing directly with the systems engineering
world is not needing to fix someone else's broken db ... but I
digress.  Those years did, however, drill home the value of anything
which does (or comes close enough to do) for SQL databases what oXygen
does for XML, will always be worth keeping on hand.

Navicat (ideally the Premium edition) is still the winner there, even
here where OS constraints prevent installing the latest version.
Unfortunately it's OS X and Windows only, but it makes the damned
things less painful.  The conversion method is basically follow the
prompts and does plenty more than XML.

A bit over two years ago I stumbled across a mostly undocumented XML
schema in a project I contribute to.  Shortly after that, I generated
schema files for it with oXygenXML Editor.  So I figured I'd use that
to demonstrate what Navicat's import does.  Attached is the XSD
version of the schema and the subsequent dump file created after
importing into a test server (only the db server host address has been
changed).

The source material is in one of my git branches until we decide
if/when to set a global xmlns for future releases.  That branch is
here:

https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gpgme.git;a=tree;f=lang/xml-schemas;h=6306cd1dca1cfacb5a97ac80848fcc216622bfb1;hb=003c3f24fd6ef19e6e7042d461232c33a6f83150

In the mean time it can at least show the value in selecting the right
corners to cut.  ;)


Regards,
Ben
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
elementFormDefault="qualified">
  <xs:element name="gpgme">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="keylist"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="keylist">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="key"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="key">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="revoked"/>
        <xs:element ref="expired"/>
        <xs:element ref="disabled"/>
        <xs:element ref="invalid"/>
        <xs:element ref="can-encrypt"/>
        <xs:element ref="can-sign"/>
        <xs:element ref="can-certify"/>
        <xs:element ref="can-authenticate"/>
        <xs:element ref="is-qualified"/>
        <xs:element ref="secret"/>
        <xs:element ref="protocol"/>
        <xs:element ref="issuer"/>
        <xs:element ref="chain-id"/>
        <xs:element ref="owner-trust"/>
        <xs:element ref="subkeys"/>
        <xs:element ref="uids"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="revoked">
    <xs:complexType>
      <xs:attribute name="value" use="required" type="xs:NMTOKEN"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="expired">
    <xs:complexType>
      <xs:attribute name="value" use="required" type="xs:NMTOKEN"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="disabled">
    <xs:complexType>
      <xs:attribute name="value" use="required" type="xs:NMTOKEN"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="invalid">
    <xs:complexType>
      <xs:attribute name="value" use="required" type="xs:NMTOKEN"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="can-encrypt">
    <xs:complexType>
      <xs:attribute name="value" use="required" type="xs:NMTOKEN"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="can-sign">
    <xs:complexType>
      <xs:attribute name="value" use="required" type="xs:NMTOKEN"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="can-certify">
    <xs:complexType>
      <xs:attribute name="value" use="required" type="xs:NMTOKEN"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="can-authenticate">
    <xs:complexType>
      <xs:attribute name="value" use="required" type="xs:NMTOKEN"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="is-qualified">
    <xs:complexType>
      <xs:attribute name="value" use="required" type="xs:NMTOKEN"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="protocol">
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base="xs:NCName">
          <xs:attribute name="value" use="required" type="xs:integer"/>
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="issuer">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="serial"/>
        <xs:element ref="name"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="serial">
    <xs:complexType/>
  </xs:element>
  <xs:element name="chain-id">
    <xs:complexType/>
  </xs:element>
  <xs:element name="owner-trust">
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base="xs:NCName">
          <xs:attribute name="value" use="required" type="xs:integer"/>
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="subkeys">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="subkey"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="subkey">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="keyid"/>
        <xs:element ref="fpr"/>
        <xs:element ref="secret"/>
        <xs:element ref="is_cardkey"/>
        <xs:element minOccurs="0" ref="curve"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="keyid" type="xs:NMTOKEN"/>
  <xs:element name="fpr" type="xs:string"/>
  <xs:element name="is_cardkey">
    <xs:complexType>
      <xs:attribute name="value" use="required" type="xs:NMTOKEN"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="curve" type="xs:NCName"/>
  <xs:element name="uids">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="uid"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="secret">
    <xs:complexType>
      <xs:attribute name="value" use="required" type="xs:NMTOKEN"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="name" type="xs:string"/>
  <xs:element name="uid">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="name"/>
        <xs:element ref="uid"/>
        <xs:element ref="comment"/>
        <xs:element ref="email"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="comment" type="xs:string"/>
  <xs:element name="email" type="xs:anyURI"/>
</xs:schema>
/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 50626
 Source Host           : localhost
 Source Database       : test

 Target Server Type    : MySQL
 Target Server Version : 50626
 File Encoding         : utf-8

 Date: 02/11/2018 04:51:27 AM
*/

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `gpgmekeys`
-- ----------------------------
DROP TABLE IF EXISTS `gpgmekeys`;
CREATE TABLE `gpgmekeys` (
  `element` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
--  Records of `gpgmekeys`
-- ----------------------------
BEGIN;
INSERT INTO `gpgmekeys` VALUES ('gpgme'), ('keylist'), ('key'), ('revoked'), 
('expired'), ('disabled'), ('invalid'), ('can-encrypt'), ('can-sign'), 
('can-certify'), ('can-authenticate'), ('is-qualified'), ('protocol'), 
('issuer'), ('serial'), ('chain-id'), ('owner-trust'), ('subkeys'), ('subkey'), 
('keyid'), ('is_cardkey'), ('curve'), ('secret'), ('name'), ('comment');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;

Attachment: signature.asc
Description: PGP signature

_______________________________________________
oXygen-user mailing list
oXygen-user@oxygenxml.com
https://www.oxygenxml.com/mailman/listinfo/oxygen-user

Reply via email to