-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxsd2hrc.html
117 lines (104 loc) · 4.42 KB
/
xsd2hrc.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?xml version="1.0" encoding="windows-1251"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="ru" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>XML Schema to HRC</title>
<link href="styles/styles.css" rel="stylesheet" type="text/css"/>
<link rel="icon" href="images/logo-small.png"/>
<style type="text/css">
.bigleft{
text-align: left;
font-size: 20pt;
font-weight: bold;
color:#A00000;
float: left;
margin-right: 10pt;
margin-left: -8pt;
margin-bottom: 10pt;
}
</style>
</head>
<body>
<div class='back'><a href='index.html'><img alt='back' src='images/back.png' width='40' height='18'/></a></div>
<h1>XMLSchema linking</h1>
<div class="bigleft"><xs:</div>
<p>Colorer library package contains scripts and
settings, which allows you to integrate it with XML language
editing process and add to Colorer features of an on-fly
XML validation.
Colorer package includes XSLT Scripts for producing transformations
of XML Schemas 1.0 into the HRC language.
Resulted HRC files could be used by Colorer and provide
syntax checking and document's logical structure validation.
</p>
<h2>Including support</h2>
<p>Colorer includes following XML languages and their schemas:</p>
<ul>
<li>XHTML 1.0 (Strict, Transitional)</li>
<li>XSLT 1.0, XSLFO 1.0</li>
<li>XMLSchema 1.0</li>
<li>OASIS DocBook 4.1</li>
<li>Relax NG 1.0</li>
<li>WSC, WSF</li>
<li>Sun's web.xml</li>
</ul>
<p>
To add others language support, you must use those language's
XSD description and transform it through the xsd2hrc.xsl transformation.
Colorer package includes DTD to XMLSchema converter
(<code>xsd2hrc/schemas/dtd/dtd2xsd/dtd2xsd.pl</code>), so you can
use DTD descriptions also.
</p>
<h2>xsd2hrc.xsl</h2>
<p>This transformation (<code>/bin/xsd2hrc/xsd2hrc.xsl</code>) generates HRC syntax files
to parse XML files from appropriate XML Schema description of these files type.
Generated HRC syntax conforms XML Schema Recomendations,
except some syntax and logic looses. Most of them can't be implemented
due to HRC context-free grammar model limitations.</p>
<h2>Limitations</h2>
<ul>
<li>Poor namespace checks. It is assumed, that some set of
frequently used ns prefixes (including empty and any prefixes)
is provided for each namespace. This set can be easily changed.</li>
<li>Elements order check looses.
Ignoring difference in <code>xs:sequence, xs:choose, xs:all</code>,
treating any of them as <code><xs:choose minOccurs="0" maxOccurs="unbounded"></code></li>
<li><code>xs:list/xs:union</code> membertypes order has no importance in xmlschema,
but can greatly affect syntax results in HRC.</li>
<li>Limited <code>xs:import</code> support. Using it implies, that there is
an already defined HRC type for imported schema, and
importing schema just refers it with the valid hrc type prefix,
obtained from HRC catalog file using the @targetNamespace attribute
of the prototype definition element.</li>
<li>Ignoring difference in <code>xs:union</code>, <code>xs:list</code>.</li>
<li><code>xs:simpleType/xs:restriction</code> is just reference to base type
except then using <code>xs:enumeration</code> and <code>xs:pattern</code> facets.</li>
<li>Lax buildin simpleTypes support. Treating all of them as lists.</li>
<li>Unsupported substitution groups, <code>xsi:type</code> instance element identification.</li>
<li>Missed keys and unique constrains checks.</li>
<li>No <code>xs:redefine</code> support.</li>
</ul>
<h2>TODO:</h2>
<ul>
<li>'fixed' on attr decls</li>
<li>xs:redefine features</li>
<li>substitution groups??</li>
<li>different hrc regions assign for different xml elements?</li>
<li>additional special region indention</li>
</ul>
<div class="bigleft"></xs:</div>
<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://sourceforge.net/apps/piwik/colorer/" : "http://sourceforge.net/apps/piwik/colorer/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
piwik_action_name = '';
piwik_idsite = 1;
piwik_url = pkBaseURL + "piwik.php";
piwik_log(piwik_action_name, piwik_idsite, piwik_url);
</script>
<object><noscript><p><img src="http://sourceforge.net/apps/piwik/colorer/piwik.php?idsite=1" alt="piwik"/></p></noscript></object>
<!-- End Piwik Tag -->
</body>
</html>