123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- <?xml version='1.0' encoding='iso-8859-1'?>
- <!doctype html public '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
- <html xmlns='http://www.w3c.org/1999/xhtml' lang='en-us'>
- <head>
- <title>
- xmlschema.c
- </title>
- <meta http-equiv='content-type' content='text/html;iso-8859-1'/>
- <meta name='generator' content='motley-tools 1.9.4 13:40:33 Feb 18 2015'/>
- <meta name='author' content='cmaier@cmassoc.net'/>
- <meta name='robots' content='noindex,nofollow'/>
- <link href='toolkit.css' rel='stylesheet' type='text/css'/>
- </head>
- <body>
- <div class='headerlink'>
- [<a href='xmlscan.c.html' title=' xmlscan.c '>PREV</a>]
- [<a href='toolkit.html' title=' Index '>HOME</a>]
- [<a href='xmlselect.c.html' title=' xmlselect.c '>NEXT</a>]
- </div>
- <pre>
- /*====================================================================*
- *
- * void xmlschema ();
- *
- * node.h
- *
- * print an XML schema on stdout that is compatible with function
- * xmledit; the schema should be used to validate files before any
- * attempt is make to parse them;
- *
- * Motley Tools by Charles Maier <cmaier@cmassoc.net>;
- * Copyright (c) 2001-2006 by Charles Maier Associates;
- * Licensed under the Internet Software Consortium License;
- *
- *--------------------------------------------------------------------*/
- #ifndef XMLSCHEMA_SOURCE
- #define XMLSCHEMA_SOURCE
- #include "../nodes/node.h"
- #include "../tools/format.h"
- void xmlschema ()
- {
- unsigned margin = 0;
- output (margin, "<?xml version='%s' encoding='%s'?>", XML_VERSION, XML_CHARSET);
- output (margin++, "<xs:schema xmlns:xs='%s' elementFormDefault='%s'>", XML_SCHEMA, "qualified");
- output (margin++, "<xs:element name='%s'>", DATA_OBJECT);
- output (margin++, "<xs:complexType>");
- #if 0
- output (margin, "<xs:attribute name='%s' use='optional' type='xs:NCName'/>", DATA_NAME);
- output (margin, "<xs:attribute name='%s' use='optional' type='xs:string'/>", DATA_TEXT);
- #endif
- output (margin++, "<xs:sequence>");
- output (margin, "<xs:element maxOccurs='unbounded' ref='%s'/>", DATA_MEMBER);
- output (margin--, "</xs:sequence>");
- output (margin--, "</xs:complexType>");
- output (margin--, "</xs:element>");
- output (margin++, "<xs:element name='%s'>", DATA_MEMBER);
- output (margin++, "<xs:complexType>");
- output (margin, "<xs:attribute name='%s' use='required' type='xs:NCName'/>", DATA_NAME);
- #if 0
- output (margin, "<xs:attribute name='%s' use='optional' type='xs:string'/>", DATA_TEXT);
- #endif
- output (margin++, "<xs:sequence>");
- output (margin++, "<xs:sequence>");
- output (margin, "<xs:element ref='%s'/>", DATA_OFFSET);
- output (margin, "<xs:element ref='%s'/>", DATA_LENGTH);
- output (margin--, "</xs:sequence>");
- output (margin++, "<xs:choice>");
- output (margin, "<xs:element ref='%s'/>", DATA_STRUCT);
- output (margin, "<xs:element ref='%s'/>", DATA_STRING);
- output (margin, "<xs:element ref='%s'/>", DATA_HUGE);
- output (margin, "<xs:element ref='%s'/>", DATA_LONG);
- output (margin, "<xs:element ref='%s'/>", DATA_WORD);
- output (margin, "<xs:element ref='%s'/>", DATA_BYTE);
- output (margin--, "</xs:choice>");
- output (margin--, "</xs:sequence>");
- output (margin--, "</xs:complexType>");
- output (margin--, "</xs:element>");
- output (margin, "<xs:element name='%s' type='xs:positiveInteger'/>", DATA_LENGTH);
- output (margin, "<xs:element name='%s' type='xs:hexBinary'/>", DATA_OFFSET);
- output (margin++, "<xs:element name='%s'>", DATA_STRUCT);
- output (margin++, "<xs:complexType>");
- #if 0
- output (margin, "<xs:attribute name='%s' use='optional' type='xs:NCName'/>", DATA_NAME);
- output (margin, "<xs:attribute name='%s' use='optional' type='xs:string'/>", DATA_TEXT);
- #endif
- output (margin++, "<xs:choice maxOccurs='unbounded'>");
- output (margin, "<xs:element ref='%s'/>", DATA_BYTE);
- output (margin, "<xs:element ref='%s'/>", DATA_MEMORY);
- output (margin--, "</xs:choice>");
- output (margin--, "</xs:complexType>");
- output (margin--, "</xs:element>");
- output (margin, "<xs:element name='%s' type='xs:string'/>", DATA_STRING);
- output (margin, "<xs:element name='%s' type='xs:hexBinary'/>", DATA_MEMORY);
- output (margin, "<xs:element name='%s' type='xs:unsignedLong'/>", DATA_HUGE);
- output (margin, "<xs:element name='%s' type='xs:unsignedInt'/>", DATA_LONG);
- output (margin, "<xs:element name='%s' type='xs:unsignedShort'/>", DATA_WORD);
- output (margin, "<xs:element name='%s' type='xs:unsignedByte'/>", DATA_BYTE);
- output (margin--, "</xs:schema>");
- return;
- }
- #endif
- </pre>
- <div class='footerlink'>
- [<a href='xmlscan.c.html' title=' xmlscan.c '>PREV</a>]
- [<a href='toolkit.html' title=' Index '>HOME</a>]
- [<a href='xmlselect.c.html' title=' xmlselect.c '>NEXT</a>]
- </div>
- </body>
- </html>
|