1
1
mirror of https://github.com/dgis/xsddiagram.git synced 2024-07-14 13:50:26 +03:00

Additions:

- Accept all kind of https certificates when the xsd dependencies (import or include) point to a TLS/SSL url.
- Prompt the user to authenticate when the xsd dependencies (import or include) point toward a secured url.
- Add the corresponding command line "-u USERNAME" and "-p PASSWORD" options to authenticate the url download.
- It is now possible to drag'n drop an url pointing to a xsd file on the main window.

Merge branch 'master' of https://github.com/dgis/xsddiagram

Conflicts:
	ReadMe.txt
This commit is contained in:
dgis 2012-12-01 17:40:00 +01:00
commit 4b1f230cdc
26 changed files with 20310 additions and 2164 deletions

114
AboutForm.Designer.cs generated
View File

@ -28,62 +28,64 @@ namespace XSDDiagram
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutForm));
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.richTextBox = new System.Windows.Forms.RichTextBox();
this.buttonOk = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// pictureBox1
//
this.pictureBox1.Image = global::XSDDiagram.Properties.Resources.XSDDiagram;
this.pictureBox1.Location = new System.Drawing.Point(12, 12);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(32, 32);
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// richTextBox
//
this.richTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.richTextBox.BackColor = System.Drawing.SystemColors.ControlLight;
this.richTextBox.Location = new System.Drawing.Point(50, 12);
this.richTextBox.Name = "richTextBox";
this.richTextBox.ReadOnly = true;
this.richTextBox.Size = new System.Drawing.Size(464, 218);
this.richTextBox.TabIndex = 1;
this.richTextBox.TabStop = false;
this.richTextBox.Text = "";
//
// buttonOk
//
this.buttonOk.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOk.Location = new System.Drawing.Point(226, 236);
this.buttonOk.Name = "buttonOk";
this.buttonOk.Size = new System.Drawing.Size(75, 23);
this.buttonOk.TabIndex = 0;
this.buttonOk.Text = "OK";
this.buttonOk.UseVisualStyleBackColor = true;
//
// AboutForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(526, 271);
this.Controls.Add(this.buttonOk);
this.Controls.Add(this.richTextBox);
this.Controls.Add(this.pictureBox1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MinimizeBox = false;
this.Name = "AboutForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "About...";
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutForm));
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.richTextBox = new System.Windows.Forms.RichTextBox();
this.buttonOk = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// pictureBox1
//
this.pictureBox1.Image = global::XSDDiagram.Properties.Resources.XSDDiagram;
this.pictureBox1.Location = new System.Drawing.Point(12, 12);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(32, 32);
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// richTextBox
//
this.richTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.richTextBox.BackColor = System.Drawing.SystemColors.ControlLight;
this.richTextBox.Location = new System.Drawing.Point(50, 12);
this.richTextBox.Name = "richTextBox";
this.richTextBox.ReadOnly = true;
this.richTextBox.Size = new System.Drawing.Size(464, 218);
this.richTextBox.TabIndex = 1;
this.richTextBox.TabStop = false;
this.richTextBox.Text = "";
//
// buttonOk
//
this.buttonOk.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOk.Location = new System.Drawing.Point(226, 236);
this.buttonOk.Name = "buttonOk";
this.buttonOk.Size = new System.Drawing.Size(75, 23);
this.buttonOk.TabIndex = 0;
this.buttonOk.Text = "OK";
this.buttonOk.UseVisualStyleBackColor = true;
//
// AboutForm
//
this.AcceptButton = this.buttonOk;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.buttonOk;
this.ClientSize = new System.Drawing.Size(526, 271);
this.Controls.Add(this.buttonOk);
this.Controls.Add(this.richTextBox);
this.Controls.Add(this.pictureBox1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MinimizeBox = false;
this.Name = "AboutForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "About...";
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
}

View File

@ -28,51 +28,52 @@ namespace XSDDiagram
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ErrorReportForm));
this.textBoxReport = new System.Windows.Forms.TextBox();
this.buttonOK = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// textBoxReport
//
this.textBoxReport.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBoxReport.Location = new System.Drawing.Point(12, 12);
this.textBoxReport.Multiline = true;
this.textBoxReport.Name = "textBoxReport";
this.textBoxReport.ReadOnly = true;
this.textBoxReport.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.textBoxReport.Size = new System.Drawing.Size(495, 332);
this.textBoxReport.TabIndex = 0;
//
// buttonOK
//
this.buttonOK.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOK.Location = new System.Drawing.Point(222, 350);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.TabIndex = 1;
this.buttonOK.Text = "OK";
this.buttonOK.UseVisualStyleBackColor = true;
//
// ErrorReportForm
//
this.AcceptButton = this.buttonOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(519, 385);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.textBoxReport);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MinimizeBox = false;
this.Name = "ErrorReportForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Error Report";
this.Load += new System.EventHandler(this.ErrorReportForm_Load);
this.ResumeLayout(false);
this.PerformLayout();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ErrorReportForm));
this.textBoxReport = new System.Windows.Forms.TextBox();
this.buttonOK = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// textBoxReport
//
this.textBoxReport.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBoxReport.Location = new System.Drawing.Point(12, 12);
this.textBoxReport.Multiline = true;
this.textBoxReport.Name = "textBoxReport";
this.textBoxReport.ReadOnly = true;
this.textBoxReport.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.textBoxReport.Size = new System.Drawing.Size(495, 332);
this.textBoxReport.TabIndex = 0;
//
// buttonOK
//
this.buttonOK.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOK.Location = new System.Drawing.Point(222, 350);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.TabIndex = 1;
this.buttonOK.Text = "OK";
this.buttonOK.UseVisualStyleBackColor = true;
//
// ErrorReportForm
//
this.AcceptButton = this.buttonOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.buttonOK;
this.ClientSize = new System.Drawing.Size(519, 385);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.textBoxReport);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MinimizeBox = false;
this.Name = "ErrorReportForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Error Report";
this.Load += new System.EventHandler(this.ErrorReportForm_Load);
this.ResumeLayout(false);
this.PerformLayout();
}

View File

@ -1,165 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@ -45,8 +45,8 @@
this.buttonOK.Location = new System.Drawing.Point(64, 152);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.TabIndex = 0;
this.buttonOK.Text = "OK";
this.buttonOK.TabIndex = 4;
this.buttonOK.Text = "&OK";
this.buttonOK.UseVisualStyleBackColor = true;
//
// buttonCancel
@ -56,8 +56,8 @@
this.buttonCancel.Location = new System.Drawing.Point(145, 152);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 1;
this.buttonCancel.Text = "Cancel";
this.buttonCancel.TabIndex = 5;
this.buttonCancel.Text = "&Cancel";
this.buttonCancel.UseVisualStyleBackColor = true;
//
// textBoxUsername
@ -65,7 +65,7 @@
this.textBoxUsername.Location = new System.Drawing.Point(98, 90);
this.textBoxUsername.Name = "textBoxUsername";
this.textBoxUsername.Size = new System.Drawing.Size(174, 20);
this.textBoxUsername.TabIndex = 2;
this.textBoxUsername.TabIndex = 1;
//
// textBoxPassword
//
@ -81,8 +81,8 @@
this.labelUsername.Location = new System.Drawing.Point(12, 93);
this.labelUsername.Name = "labelUsername";
this.labelUsername.Size = new System.Drawing.Size(55, 13);
this.labelUsername.TabIndex = 4;
this.labelUsername.Text = "Username";
this.labelUsername.TabIndex = 0;
this.labelUsername.Text = "&Username";
//
// labelPassword
//
@ -90,8 +90,8 @@
this.labelPassword.Location = new System.Drawing.Point(12, 119);
this.labelPassword.Name = "labelPassword";
this.labelPassword.Size = new System.Drawing.Size(53, 13);
this.labelPassword.TabIndex = 5;
this.labelPassword.Text = "Password";
this.labelPassword.TabIndex = 2;
this.labelPassword.Text = "&Password";
//
// textBoxLabel
//
@ -102,11 +102,14 @@
this.textBoxLabel.ReadOnly = true;
this.textBoxLabel.Size = new System.Drawing.Size(257, 71);
this.textBoxLabel.TabIndex = 6;
this.textBoxLabel.TabStop = false;
//
// LoginPromptForm
//
this.AcceptButton = this.buttonOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(284, 187);
this.Controls.Add(this.textBoxLabel);
this.Controls.Add(this.labelPassword);

File diff suppressed because it is too large Load Diff

View File

@ -33,6 +33,8 @@ namespace XSDDiagram
public static bool ForceHugeImageGeneration { get; private set; }
public static bool RequestHelp { get; private set; }
public static bool IsRunningOnMono { get; private set; }
public static string Username { get; private set; }
public static string Password { get; private set; }
static Options()
{
@ -125,6 +127,16 @@ namespace XSDDiagram
{
ForceHugeImageGeneration = true;
}
else if (string.Compare("-u", argument, true) == 0)
{
if (currentArgument < arguments.Count)
Username = args[currentArgument++];
}
else if (string.Compare("-p", argument, true) == 0)
{
if (currentArgument < arguments.Count)
Password = args[currentArgument++];
}
else
InputFile = argument;
}

View File

@ -33,14 +33,14 @@ namespace XSDDiagram
//static extern bool AllocConsole();
static string usage = @"XSD Diagram, version {0}
Usage: {1} [-o output.svg] [-so EXTENSION] [-r RootElement]* [-e N] [-z N] [file.xsd]
Usage: {1} [-o output.svg] [-os EXTENSION] [-r RootElement]* [-e N] [-z N] [-y] [-u USERNAME] [-p PASSWORD] [file.xsd]
-o FILE
specifies the output image. Only '.svg' or '.png' are allowed.
specifies the output image. '.png','.jpg', '.svg' ('.emf' on Windows) are allowed.
If not present, the GUI is shown.
-so EXTENSION
-os EXTENSION
specifies the output image is streamed through the standard
output. EXTENSION can be: png, jpg, svg or emf (emf on Windows only).
output. EXTENSION can be: png, jpg, svg.
If not present, the GUI is shown.
-r ELEMENT
specifies the root element of the tree.
@ -51,14 +51,23 @@ Usage: {1} [-o output.svg] [-so EXTENSION] [-r RootElement]* [-e N] [-z N] [file
-z N
specifies the zoom percentage from 10% to 1000% (only for .png image).
Work only with the '-o', '-os png' or '-os jpg' option.
-y
force huge image generation without user prompt.
-u USERNAME
specifies a username to authenticate when a xsd dependency
(import or include) is a secured url.
-p PASSWORD
specifies a password to authenticate when a xsd dependency
(import or include) is a secured url.
Example 1:
> XSDDiagram.exe -o file.png -r TotoRoot -e 3 -z 200 ./folder1/toto.xsd
> XSDDiagramConsole.exe -o file.png -r TotoRoot -e 3 -z 200 ./folder1/toto.xsd
will generate a PNG image from a diagram with a root element
'TotoRoot' and expanding the tree from the root until the 3rd level.
Example 2:
> XSDDiagramConsole.exe ./folder1/toto.xsd
> XSDDiagram.exe ./folder1/toto.xsd
will load the xsd file in the GUI window.
Example 3:
@ -67,7 +76,7 @@ Example 3:
'TotoRoot' and expanding the tree from the root until the 2nd level.
Example 4:
> XSDDiagram.exe -os svg -r TotoRoot -e 3 ./folder1/toto.xsd
> XSDDiagramConsole.exe -os svg -r TotoRoot -e 3 ./folder1/toto.xsd
will write a SVG image in the standard output from a diagram with a root element
'TotoRoot' and expanding the tree from the root until the 3rd level.
";
@ -99,6 +108,20 @@ Example 4:
Log("Loading the file: {0}\n", Options.InputFile);
Schema schema = new Schema();
schema.RequestCredential += delegate(string url, string realm, int attemptCount, out string username, out string password)
{
username = password = "";
if(!string.IsNullOrEmpty(Options.Username))
{
if (attemptCount > 1)
return false;
username = Options.Username;
password = Options.Password;
return true;
}
return false;
};
schema.LoadSchema(Options.InputFile);
if (schema.LoadError.Count > 0)

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("0.11.0.0")]
[assembly: AssemblyFileVersion("0.11.0.0")]
[assembly: AssemblyVersion("0.12.0.0")]
[assembly: AssemblyFileVersion("0.12.0.0")]

View File

@ -1,182 +1,197 @@
XSD Diagram is a free xml schema definition diagram viewer (http://regis.cosnier.free.fr).
Version 0.12 Copyright (c) 2006-2012 Regis Cosnier, All Rights Reserved.
This program is free software and may be distributed
according to the terms of the GNU General Public License (GPL).
FEATURES:
- GPL (Part of the source code are dual licensed with LGPL and MS-PL)
- Need of the Microsoft Framework.NET 2.0 (if not already install) or Mono
- Display the elements, the groups and the attributes
- Show the text/HTML documentation of element and attribute when available
- Print the diagram
- Export the diagram to SVG, PNG, JPG and EMF (EMF only with Windows)
- Zoom the diagram with the mouse wheel while holding the control key
- XML validation based on the loaded XSD file
- Registration in the Windows Explorer contextual menu
- Drag'n drop a file from explorer
- Command line image generation
QUICK START:
- Open an xsd file.
- The xsd file and all its dependencies files are loaded in tab pages.
- Either:
- Select a toplevel element in the toolbar (The first one is already selected).
- Push the add button to put the element on the diagram
- Or double click in the right panel list.
- Then, on the diagram element, click on the + box.
COMMAND LINE USAGE:
> XSDDiagram.exe [-o output.svg] [-so EXTENSION] [-r RootElement]* [-e N] [-z N] [file.xsd]
or on Windows use 'XSDDiagramConsole.exe' instead of 'XSDDiagram.exe' if you need the console:
> XSDDiagramConsole.exe [-o output.svg] [-so EXTENSION] [-r RootElement]* [-e N] [-z N] [file.xsd]
Options:
-o FILE
specifies the output image. Only '.svg' or '.png' are allowed.
If not present, the GUI is shown.
-so EXTENSION
specifies the output image is streamed through the standard
output. EXTENSION can be: png, jpg or svg.
If not present, the GUI is shown.
-r ELEMENT
specifies the root element of the tree.
You can put several -r options = several root elements in the tree.
-e N
specifies the expand level (from 0 to what you want).
Be carefull, the result image can be huge.
-z N
specifies the zoom percentage from 10% to 1000% (only for .png image).
Work only with the '-o', '-os png' or '-os jpg' option.
-y
Force huge image generation without user prompt.
Example 1:
> XSDDiagramConsole.exe -o file.png -r TotoRoot -e 3 -z 200 ./folder1/toto.xsd
will generate a PNG image from a diagram with a root element
'TotoRoot' and expanding the tree from the root until the 3rd level.
Example 2:
> XSDDiagram.exe ./folder1/toto.xsd
will load the xsd file in the GUI window.
Example 3:
> XSDDiagram.exe -r TotoRoot -e 2 ./folder1/toto.xsd
will load the xsd file in the GUI window with a root element
'TotoRoot' and expanding the tree from the root until the 2nd level.
Example 4:
> XSDDiagramConsole.exe -os svg -r TotoRoot -e 3 ./folder1/toto.xsd
will write a SVG image in the standard output from a diagram with a root element
'TotoRoot' and expanding the tree from the root until the 3rd level.
TODO LIST:
- Tooltips above the diagram element with a summary (xpath/attributes/doc) (display 200ms after the mouse move -> avoid 100 %CPU)
o The optional display of attributes inside the diagram
- Columns in the element/attributes tabs for restrictions (length/pattern/enumerations)
- Element selection in the diagram + move from one element to another with the arrow key
- Multi-selection (i.e.: to remove several element at once)
- Save the current UI state (open file/diagram/zoom/...)
- Download xsd by specifying an Url instead of loading it from the file system
- XML sample (skeleton) generation (the ability to generate random test XML files complying with the open schema)
- Download .dtd dependency file
- On Linux, the horizontal and vertical scrollbars don't appear correctly.
CHANGES:
version 0.12 (2012-12-01)
- Accept all kind of https certificates when the xsd dependencies (import or include) point to a TLS/SSL url.
- Prompt the user to authenticate when the xsd dependencies (import or include) point toward a secured url.
version 0.11 (2012-07-22)
- Remove the "Order" attributes in the source file XmlSchema.cs which are imcompatible with mono > 2.6!
- Add the option "-y" to force huge image generation without user prompt.
- Fix some hashtable to dictionary issues due to the previous refactoring.
version 0.10 (2011-12-18)
- Refactor within a core library "XSDDiagrams.dll" under the LGPL/MS-PL license.
- Add the XSD Diagrams core library, thanks to Paul's refactoring !
- Add the XML validation operation using the currently loaded XSD schema in the Tools menu.
- When the WebBrowser is not available, use a TextBox instead (For Mono without WebBrowser support).
- Mono version 2.10 does not work anymore with XML deserialization :-(
version 0.9 (2011-05-17)
- Allow to expand restriction type (Thanks to Hermann).
- Fix an unicode issue with infinity character when building xsd diagram on linux.
version 0.8 (2010-10-31)
- Add support for JPG.
- Add command line options to generate PNG, JPG or SVG image without the GUI window.
version 0.7 (2010-07-14)
- Inversion of the mouse wheel direction to zoom
- Add the SVG diagram export
- Add the Tiago Daitx's code about the PNG diagram export
- Improve the diagram quality
version 0.6 (2010-06-27)
- Fix the print function.
- Add as much as possible the support for Mono 2.6.3 on Linux.
- Fix the import/include opening on Linux.
- Fix the print font clipping bug on Linux.
- Fix the tab page selection corruption on Linux.
- On Linux, the export to EMF does not work because it seems the libgdiplus does not support this feature.
version 0.5 (2008-11-11)
- The element panel has been added again. This is not very user friendly because this should not be editable.
- The contextual menu in element list has an entry: "Add to diagramm" + drag'n drop on the diagram.
version 0.4 (2007-03-10)
- Add contextual menu in the panels to copy the list/selected line in the clipboard
- Displays enumerate type in a new panel
- The element panel has been removed
- The combobox must be wider or the same size as the widest element
- Fix an exception if no printer install when clicking on print setup/preview
- Fix an exception if selecting the attribute '*' in the XMLSchema.xsd schema file
- Fix a bug about bad simple content element displays
- Fix Ctrl+Tab that did not work in the browser view
- Fix some attributes not display
- Fix an exception on loading a dependent xml document
- Fix when selecting a browser view, the browser should have the focus
- Fix some zoom bound issues
version 0.3 (2006-11-20)
- Allow to edit the attributes label in order to copy a label in the clipboard
- Put *.xsd as default load extension
- Put xpath (/) instead of chevrons in the path
- Add the abstract element support
- Zoom accuracy
- Fix some bugs (sequence/choice/group not always display in complexType)
version 0.2 (2006-10-09)
- Automatic download of non local import
- Print per page
- Vast virtual scrolling diagram
- Top/Center/Bottom alignments
- Put chevrons in the path
- Fix some bugs (simple type and documentation space)
version 0.1 (2006-09-14)
- First version
LICENSE:
Copyright (c) 2006-2012 Regis COSNIER, All Rights Reserved.
This program is free software and may be distributed
according to the terms of the GNU General Public License (GPL).
XSD Diagram is a free xml schema definition diagram viewer (http://regis.cosnier.free.fr).
Version 0.14 Copyright (c) 2006-2012 Regis Cosnier, All Rights Reserved.
This program is free software and may be distributed
according to the terms of the GNU General Public License (GPL).
FEATURES:
- GPL (Part of the source code are dual licensed with LGPL and MS-PL)
- Need of the Microsoft Framework.NET 2.0 (if not already install) or Mono
- Display the elements, the groups and the attributes
- Show the text/HTML documentation of element and attribute when available
- Print the diagram
- Export the diagram to SVG, PNG, JPG and EMF (EMF only with Windows)
- Zoom the diagram with the mouse wheel while holding the control key
- XML validation based on the loaded XSD file
- Registration in the Windows Explorer contextual menu
- Drag'n drop a xsd file or url on the main window header
- Command line image generation
QUICK START:
- Open an xsd file.
- The xsd file and all its dependencies files are loaded in tab pages.
- Either:
- Select a toplevel element in the toolbar (The first one is already selected).
- Push the add button to put the element on the diagram
- Or double click in the right panel list.
- Then, on the diagram element, click on the + box.
COMMAND LINE USAGE:
> XSDDiagram.exe [-o output.svg] [-os EXTENSION] [-r RootElement]* [-e N] [-z N] [-y] [-u USERNAME] [-p PASSWORD] [file.xsd]
or on Windows use 'XSDDiagramConsole.exe' instead of 'XSDDiagram.exe' if you need the console:
> XSDDiagramConsole.exe [-o output.svg] [-os EXTENSION] [-r RootElement]* [-e N] [-z N] [-y] [-u USERNAME] [-p PASSWORD] [file.xsd]
Options:
-o FILE
specifies the output image. '.png','.jpg', '.svg' ('.emf' on Windows) are allowed.
If not present, the GUI is shown.
-os EXTENSION
specifies the output image is streamed through the standard
output. EXTENSION can be: png, jpg, svg.
If not present, the GUI is shown.
-r ELEMENT
specifies the root element of the tree.
You can put several -r options = several root elements in the tree.
-e N
specifies the expand level (from 0 to what you want).
Be carefull, the result image can be huge.
-z N
specifies the zoom percentage from 10% to 1000% (only for .png image).
Work only with the '-o', '-os png' or '-os jpg' option.
-y
force huge image generation without user prompt.
-u USERNAME
specifies a username to authenticate when a xsd dependency
(import or include) is a secured url.
-p PASSWORD
specifies a password to authenticate when a xsd dependency
(import or include) is a secured url.
Example 1:
> XSDDiagramConsole.exe -o file.png -r TotoRoot -e 3 -z 200 ./folder1/toto.xsd
will generate a PNG image from a diagram with a root element
'TotoRoot' and expanding the tree from the root until the 3rd level.
Example 2:
> XSDDiagram.exe ./folder1/toto.xsd
will load the xsd file in the GUI window.
Example 3:
> XSDDiagram.exe -r TotoRoot -e 2 ./folder1/toto.xsd
will load the xsd file in the GUI window with a root element
'TotoRoot' and expanding the tree from the root until the 2nd level.
Example 4:
> XSDDiagramConsole.exe -os svg -r TotoRoot -e 3 ./folder1/toto.xsd
will write a SVG image in the standard output from a diagram with a root element
'TotoRoot' and expanding the tree from the root until the 3rd level.
TODO LIST:
- BUG: There is a bug when printing with margin!
- BUG: On Linux, the horizontal and vertical scrollbars don't appear correctly.
- Add the attributes to the element in the diagram (suggested by bob)
- Tooltips above the diagram element with a summary (xpath/attributes/doc) (display 200ms after the mouse move -> avoid 100 %CPU)
o The optional display of attributes inside the diagram
- Columns in the element/attributes tabs for restrictions (length/pattern/enumerations)
- Element selection in the diagram + move from one element to another with the arrow key
- Multi-selection (i.e.: to remove several element at once)
- Save the current UI state (open file/diagram/zoom/...)
- XML sample (skeleton) generation (the ability to generate random test XML files complying with the open schema)
- Download .dtd dependency file
CHANGES:
version 0.14 (2012-12-01)
- Accept all kind of https certificates when the xsd dependencies (import or include) point to a TLS/SSL url.
- Prompt the user to authenticate when the xsd dependencies (import or include) point toward a secured url.
- Add the corresponding command line "-u USERNAME" and "-p PASSWORD" options to authenticate the url download.
- It is now possible to drag'n drop an url pointing to a xsd file on the main window.
version 0.13
version 0.12 (2012-09-19)
- Improve the error message in case the image is too big to be generated.
- Some element (complex type derived from a restriction) could cause an exception. These element are now display but can not be expanded.
version 0.11 (2012-07-22)
- Remove the "Order" attributes in the source file XmlSchema.cs which are imcompatible with mono > 2.6!
- Add the option "-y" to force huge image generation without user prompt.
- Fix some hashtable to dictionary issues due to the previous refactoring.
version 0.10 (2011-12-18)
- Refactor within a core library "XSDDiagrams.dll" under the LGPL/MS-PL license.
- Add the XSD Diagrams core library, thanks to Paul's refactoring !
- Add the XML validation operation using the currently loaded XSD schema in the Tools menu.
- When the WebBrowser is not available, use a TextBox instead (For Mono without WebBrowser support).
- Mono version 2.10 does not work anymore with XML deserialization :-(
version 0.9 (2011-05-17)
- Allow to expand restriction type (Thanks to Hermann).
- Fix an unicode issue with infinity character when building xsd diagram on linux.
version 0.8 (2010-10-31)
- Add support for JPG.
- Add command line options to generate PNG, JPG or SVG image without the GUI window.
version 0.7 (2010-07-14)
- Inversion of the mouse wheel direction to zoom
- Add the SVG diagram export
- Add the Tiago Daitx's code about the PNG diagram export
- Improve the diagram quality
version 0.6 (2010-06-27)
- Fix the print function.
- Add as much as possible the support for Mono 2.6.3 on Linux.
- Fix the import/include opening on Linux.
- Fix the print font clipping bug on Linux.
- Fix the tab page selection corruption on Linux.
- On Linux, the export to EMF does not work because it seems the libgdiplus does not support this feature.
version 0.5 (2008-11-11)
- The element panel has been added again. This is not very user friendly because this should not be editable.
- The contextual menu in element list has an entry: "Add to diagramm" + drag'n drop on the diagram.
version 0.4 (2007-03-10)
- Add contextual menu in the panels to copy the list/selected line in the clipboard
- Displays enumerate type in a new panel
- The element panel has been removed
- The combobox must be wider or the same size as the widest element
- Fix an exception if no printer install when clicking on print setup/preview
- Fix an exception if selecting the attribute '*' in the XMLSchema.xsd schema file
- Fix a bug about bad simple content element displays
- Fix Ctrl+Tab that did not work in the browser view
- Fix some attributes not display
- Fix an exception on loading a dependent xml document
- Fix when selecting a browser view, the browser should have the focus
- Fix some zoom bound issues
version 0.3 (2006-11-20)
- Allow to edit the attributes label in order to copy a label in the clipboard
- Put *.xsd as default load extension
- Put xpath (/) instead of chevrons in the path
- Add the abstract element support
- Zoom accuracy
- Fix some bugs (sequence/choice/group not always display in complexType)
version 0.2 (2006-10-09)
- Automatic download of non local import
- Print per page
- Vast virtual scrolling diagram
- Top/Center/Bottom alignments
- Put chevrons in the path
- Fix some bugs (simple type and documentation space)
version 0.1 (2006-09-14)
- First version
LICENSE:
Copyright (c) 2006-2012 Regis COSNIER, All Rights Reserved.
This program is free software and may be distributed
according to the terms of the GNU General Public License (GPL).

11046
Tests/COLLADASchema_141.xsd Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
[InternetShortcut]
URL=https://github.com/dgis/xsddiagram/issues/1

2422
Tests/issues/1/javaee_6.xsd Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,737 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://java.sun.com/xml/ns/javaee"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="1.3">
<xsd:annotation>
<xsd:documentation>
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
The contents of this file are subject to the terms of either the
GNU General Public License Version 2 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with
the License. You can obtain a copy of the License at
https://glassfish.dev.java.net/public/CDDL+GPL.html or
glassfish/bootstrap/legal/LICENSE.txt. See the License for the
specific language governing permissions and limitations under the
License.
When distributing the software, include this License Header
Notice in each file and include the License file at
glassfish/bootstrap/legal/LICENSE.txt. Sun designates this
particular file as subject to the "Classpath" exception as
provided by Sun in the GPL Version 2 section of the License file
that accompanied this code. If applicable, add the following
below the License Header, with the fields enclosed by brackets []
replaced by your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
Contributor(s):
If you wish your version of this file to be governed by only the
CDDL or only the GPL Version 2, indicate your decision by adding
"[Contributor] elects to include this software in this
distribution under the [CDDL or GPL Version 2] license." If you
don't indicate a single choice of license, a recipient has the
option to distribute your version of this file under either the
CDDL, the GPL Version 2 or to extend the choice of license to its
licensees as provided above. However, if you add GPL Version 2
code and therefore, elected the GPL Version 2 license, then the
option applies only if the new code is made subject to such
option by the copyright holder.
</xsd:documentation>
</xsd:annotation>
<xsd:annotation>
<xsd:documentation>
(C) Copyright International Business Machines Corporation 2002
</xsd:documentation>
</xsd:annotation>
<!-- **************************************************** -->
<xsd:complexType name="service-refType">
<xsd:annotation>
<xsd:documentation>
The service-ref element declares a reference to a Web
service. It contains optional description, display name and
icons, a declaration of the required Service interface,
an optional WSDL document location, an optional set
of JAX-RPC mappings, an optional QName for the service element,
an optional set of Service Endpoint Interfaces to be resolved
by the container to a WSDL port, and an optional set of handlers.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:group ref="javaee:descriptionGroup"/>
<xsd:element name="service-ref-name"
type="javaee:jndi-nameType">
<xsd:annotation>
<xsd:documentation>
The service-ref-name element declares logical name that the
components in the module use to look up the Web service. It
is recommended that all service reference names start with
"service/".
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="service-interface"
type="javaee:fully-qualified-classType">
<xsd:annotation>
<xsd:documentation>
The service-interface element declares the fully qualified class
name of the JAX-RPC Service interface the client depends on.
In most cases the value will be javax.xml.rpc.Service. A JAX-RPC
generated Service Interface class may also be specified.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="service-ref-type"
type="javaee:fully-qualified-classType"
minOccurs="0"
maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
The service-ref-type element declares the type of the service-ref
element that is injected or returned when a JNDI lookup is done.
This must be either a fully qualified name of Service class or
the fully qualified name of service endpoint interface class.
This is only used with JAX-WS runtime where the corresponding
@WebServiceRef annotation can be used to denote both a Service
or a Port.
If this is not specified, then the type of service-ref element
that is injected or returned when a JNDI lookup is done is
always a Service interface/class.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="wsdl-file"
type="javaee:xsdAnyURIType"
minOccurs="0"
maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
The wsdl-file element contains the URI location of a WSDL
file. The location is relative to the root of the module.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="jaxrpc-mapping-file"
type="javaee:pathType"
minOccurs="0"
maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
The jaxrpc-mapping-file element contains the name of a file that
describes the JAX-RPC mapping between the Java interaces used by
the application and the WSDL description in the wsdl-file. The
file name is a relative path within the module file.
This is not required when JAX-WS based runtime is used.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="service-qname"
type="javaee:xsdQNameType"
minOccurs="0"
maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
The service-qname element declares the specific WSDL service
element that is being refered to. It is not specified if no
wsdl-file is declared.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="port-component-ref"
type="javaee:port-component-refType"
minOccurs="0"
maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
The port-component-ref element declares a client dependency
on the container for resolving a Service Endpoint Interface
to a WSDL port. It optionally associates the Service Endpoint
Interface with a particular port-component. This is only used
by the container for a Service.getPort(Class) method call.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:choice>
<xsd:element name="handler"
type="javaee:handlerType"
minOccurs="0"
maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
Declares the handler for a port-component. Handlers can
access the init-param name/value pairs using the
HandlerInfo interface. If port-name is not specified, the
handler is assumed to be associated with all ports of the
service.
To be used with JAX-RPC based runtime only.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="handler-chains"
type="javaee:handler-chainsType"
minOccurs="0"
maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
To be used with JAX-WS based runtime only.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:choice>
<xsd:group ref="javaee:resourceGroup"/>
</xsd:sequence>
<xsd:attribute name="id"
type="xsd:ID"/>
</xsd:complexType>
<!-- **************************************************** -->
<xsd:complexType name="port-component-refType">
<xsd:annotation>
<xsd:documentation>
The port-component-ref element declares a client dependency
on the container for resolving a Service Endpoint Interface
to a WSDL port. It optionally associates the Service Endpoint
Interface with a particular port-component. This is only used
by the container for a Service.getPort(Class) method call.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="service-endpoint-interface"
type="javaee:fully-qualified-classType">
<xsd:annotation>
<xsd:documentation>
The service-endpoint-interface element defines a fully qualified
Java class that represents the Service Endpoint Interface of a
WSDL port.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="enable-mtom"
type="javaee:true-falseType"
minOccurs="0"
maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
Used to enable or disable SOAP MTOM/XOP mechanism on the client
side for a port-component.
Not to be specified for JAX-RPC runtime
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="mtom-threshold"
type="javaee:xsdNonNegativeIntegerType"
minOccurs="0"
maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
When MTOM is enabled, binary data above this size in bytes
should be XOP encoded or sent as attachment. Default value is 0.
Not to be specified for JAX-RPC runtime
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="addressing"
type="javaee:addressingType"
minOccurs="0"
maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
This specifies the WS-Addressing requirements for a JAX-WS
web service. It corresponds to javax.xml.ws.soap.Addressing
annotation or its feature javax.xml.ws.soap.AddressingFeature.
See the addressingType for more information.
Not to be specified for JAX-RPC runtime
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="respect-binding"
type="javaee:respect-bindingType"
minOccurs="0"
maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
Corresponds to the javax.xml.ws.RespectBinding annotation
or its corresponding javax.xml.ws.RespectBindingFeature web
service feature. This is used to control whether a JAX-WS
implementation must respect/honor the contents of the
wsdl:binding in the WSDL that is associated with the service.
Not to be specified for JAX-RPC runtime
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="port-component-link"
type="javaee:string"
minOccurs="0"
maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
The port-component-link element links a port-component-ref
to a specific port-component required to be made available
by a service reference.
The value of a port-component-link must be the
port-component-name of a port-component in the same module
or another module in the same application unit. The syntax
for specification follows the syntax defined for ejb-link
in the EJB 2.0 specification.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id"
type="xsd:ID"/>
</xsd:complexType>
<!-- **************************************************** -->
<xsd:complexType name="handler-chainsType">
<xsd:annotation>
<xsd:documentation>
The handler-chains element defines the handlerchains associated with this
service or service endpoint.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="handler-chain"
type="javaee:handler-chainType"
minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="id"
type="xsd:ID"/>
</xsd:complexType>
<!-- **************************************************** -->
<xsd:complexType name="handler-chainType">
<xsd:annotation>
<xsd:documentation>
The handler-chain element defines the handlerchain.
Handlerchain can be defined such that the handlers in the
handlerchain operate,all ports of a service, on a specific
port or on a list of protocol-bindings. The choice of elements
service-name-pattern, port-name-pattern and protocol-bindings
are used to specify whether the handlers in handler-chain are
for a service, port or protocol binding. If none of these
choices are specified with the handler-chain element then the
handlers specified in the handler-chain will be applied on
everything.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:choice minOccurs="0"
maxOccurs="1">
<xsd:element name="service-name-pattern"
type="javaee:qname-pattern"/>
<xsd:element name="port-name-pattern"
type="javaee:qname-pattern"/>
<xsd:element name="protocol-bindings"
type="javaee:protocol-bindingListType"/>
</xsd:choice>
<xsd:element name="handler"
type="javaee:handlerType"
minOccurs="1"
maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="id"
type="xsd:ID"/>
</xsd:complexType>
<xsd:simpleType name="protocol-bindingListType">
<xsd:annotation>
<xsd:documentation>
Defines the type used for specifying a list of
protocol-bindingType(s). For e.g.
##SOAP11_HTTP ##SOAP12_HTTP ##XML_HTTP
</xsd:documentation>
</xsd:annotation>
<xsd:list itemType="javaee:protocol-bindingType"/>
</xsd:simpleType>
<xsd:simpleType name="protocol-bindingType">
<xsd:annotation>
<xsd:documentation>
Defines the type used for specifying the URI for the
protocol binding used by the port-component. For
portability one could use one of the following tokens that
alias the standard binding types:
##SOAP11_HTTP
##SOAP11_HTTP_MTOM
##SOAP12_HTTP
##SOAP12_HTTP_MTOM
##XML_HTTP
Other specifications could define tokens that start with ##
to alias new standard binding URIs that are introduced.
</xsd:documentation>
</xsd:annotation>
<xsd:union memberTypes="xsd:anyURI javaee:protocol-URIAliasType"/>
</xsd:simpleType>
<xsd:simpleType name="protocol-URIAliasType">
<xsd:annotation>
<xsd:documentation>
Defines the type that is used for specifying tokens that
start with ## which are used to alias existing standard
protocol bindings and support aliases for new standard
binding URIs that are introduced in future specifications.
The following tokens alias the standard protocol binding
URIs:
##SOAP11_HTTP = "http://schemas.xmlsoap.org/wsdl/soap/http"
##SOAP11_HTTP_MTOM =
"http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true"
##SOAP12_HTTP = "http://www.w3.org/2003/05/soap/bindings/HTTP/"
##SOAP12_HTTP_MTOM =
"http://www.w3.org/2003/05/soap/bindings/HTTP/?mtom=true"
##XML_HTTP = "http://www.w3.org/2004/08/wsdl/http"
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:token">
<xsd:pattern value="##.+"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="qname-pattern">
<xsd:annotation>
<xsd:documentation>
This is used to specify the QName pattern in the
attribute service-name-pattern and port-name-pattern in
the handler-chain element
For example, the various forms acceptable here for
service-name-pattern attribute in handler-chain element
are :
Exact Name: service-name-pattern="ns1:EchoService"
In this case, handlers specified in this
handler-chain element will apply to all ports with
this exact service name. The namespace prefix must
have been declared in a namespace declaration
attribute in either the start-tag of the element
where the prefix is used or in an an ancestor
element (i.e. an element in whose content the
prefixed markup occurs)
Pattern : service-name-pattern="ns1:EchoService*"
In this case, handlers specified in this
handler-chain element will apply to all ports whose
Service names are like EchoService1, EchoServiceFoo
etc. The namespace prefix must have been declared in
a namespace declaration attribute in either the
start-tag of the element where the prefix is used or
in an an ancestor element (i.e. an element in whose
content the prefixed markup occurs)
Wild Card : service-name-pattern="*"
In this case, handlers specified in this handler-chain
element will apply to ports of all service names.
The same can be applied to port-name attribute in
handler-chain element.
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:token">
<xsd:pattern value="\*|([\i-[:]][\c-[:]]*:)?[\i-[:]][\c-[:]]*\*?"/>
</xsd:restriction>
</xsd:simpleType>
<!-- **************************************************** -->
<xsd:complexType name="addressingType">
<xsd:annotation>
<xsd:documentation>
This specifies the WS-Addressing requirements for a JAX-WS web service.
It corresponds to javax.xml.ws.soap.Addressing annotation or its
feature javax.xml.ws.soap.AddressingFeature.
If the "enabled" element is "true", WS-Addressing is enabled.
It means that the endpoint supports WS-Addressing but does not require
its use. The default value for "enabled" is "true".
If the WS-Addressing is enabled and the "required" element is "true",
it means that the endpoint requires WS-Addressing. The default value
for "required" is "false".
If WS-Addressing is enabled, the "responses" element determines
if an endpoint requires the use of only anonymous responses,
or only non-anonymous responses, or all. The value of the "responses"
element must be one of the following:
ANONYMOUS
NON_ANONYMOUS
ALL
The default value for the "responses" is ALL.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="enabled"
type="javaee:true-falseType"
minOccurs="0"
maxOccurs="1"/>
<xsd:element name="required"
type="javaee:true-falseType"
minOccurs="0"
maxOccurs="1"/>
<xsd:element name="responses"
type="javaee:addressing-responsesType"
minOccurs="0"
maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
<!-- **************************************************** -->
<xsd:complexType name="addressing-responsesType">
<xsd:annotation>
<xsd:documentation>
If WS-Addressing is enabled, this type determines if an endpoint
requires the use of only anonymous responses, or only non-anonymous
responses, or all.
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:restriction base="javaee:string">
<xsd:enumeration value="ANONYMOUS"/>
<xsd:enumeration value="NON_ANONYMOUS"/>
<xsd:enumeration value="ALL"/>
</xsd:restriction>
</xsd:simpleContent>
</xsd:complexType>
<!-- **************************************************** -->
<xsd:complexType name="respect-bindingType">
<xsd:annotation>
<xsd:documentation>
Corresponds to the javax.xml.ws.RespectBinding annotation
or its corresponding javax.xml.ws.RespectBindingFeature web
service feature. This is used to control whether a JAX-WS
implementation must respect/honor the contents of the
wsdl:binding in the WSDL that is associated with the service.
If the "enabled" element is "true", wsdl:binding in the
associated WSDL, if any, must be respected/honored.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="enabled"
type="javaee:true-falseType"
minOccurs="0"
maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
<!-- **************************************************** -->
<xsd:complexType name="handlerType">
<xsd:annotation>
<xsd:documentation>
Declares the handler for a port-component, service-ref. Handlers can
access the init-param name/value pairs using the HandlerInfo interface.
Used in: port-component, service-ref
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:group ref="javaee:descriptionGroup"/>
<xsd:element name="handler-name"
type="javaee:string">
<xsd:annotation>
<xsd:documentation>
Defines the name of the handler. The name must be unique within the
module.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="handler-class"
type="javaee:fully-qualified-classType">
<xsd:annotation>
<xsd:documentation>
Defines a fully qualified class name for the handler implementation.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="init-param"
type="javaee:param-valueType"
minOccurs="0"
maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
Not to be specified for JAX-WS runtime
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="soap-header"
type="javaee:xsdQNameType"
minOccurs="0"
maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
Defines the QName of a SOAP header that will be processed by the
handler.
Not to be specified for JAX-WS runtime
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="soap-role"
type="javaee:string"
minOccurs="0"
maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
The soap-role element contains a SOAP actor definition that the
Handler will play as a role.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="port-name"
type="javaee:string"
minOccurs="0"
maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
The port-name element defines the WSDL port-name that a
handler should be associated with. If port-name is not
specified, the handler is assumed to be associated with
all ports of the service.
Not to be specified for JAX-WS runtime
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id"
type="xsd:ID"/>
</xsd:complexType>
<xsd:group name="service-refGroup">
<xsd:sequence>
<xsd:element name="service-ref"
type="javaee:service-refType"
minOccurs="0"
maxOccurs="unbounded">
<xsd:key name="service-ref_handler-name-key">
<xsd:annotation>
<xsd:documentation>
Defines the name of the handler. The name must be unique
within the module.
</xsd:documentation>
</xsd:annotation>
<xsd:selector xpath="javaee:handler"/>
<xsd:field xpath="javaee:handler-name"/>
</xsd:key>
</xsd:element>
</xsd:sequence>
</xsd:group>
</xsd:schema>

389
Tests/issues/1/jsp_2_2.xsd Normal file
View File

@ -0,0 +1,389 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://java.sun.com/xml/ns/javaee"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="2.2">
<xsd:annotation>
<xsd:documentation>
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
The contents of this file are subject to the terms of either the
GNU General Public License Version 2 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with
the License. You can obtain a copy of the License at
https://glassfish.dev.java.net/public/CDDL+GPL.html or
glassfish/bootstrap/legal/LICENSE.txt. See the License for the
specific language governing permissions and limitations under the
License.
When distributing the software, include this License Header
Notice in each file and include the License file at
glassfish/bootstrap/legal/LICENSE.txt. Sun designates this
particular file as subject to the "Classpath" exception as
provided by Sun in the GPL Version 2 section of the License file
that accompanied this code. If applicable, add the following
below the License Header, with the fields enclosed by brackets []
replaced by your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
Contributor(s):
If you wish your version of this file to be governed by only the
CDDL or only the GPL Version 2, indicate your decision by adding
"[Contributor] elects to include this software in this
distribution under the [CDDL or GPL Version 2] license." If you
don't indicate a single choice of license, a recipient has the
option to distribute your version of this file under either the
CDDL, the GPL Version 2 or to extend the choice of license to its
licensees as provided above. However, if you add GPL Version 2
code and therefore, elected the GPL Version 2 license, then the
option applies only if the new code is made subject to such
option by the copyright holder.
</xsd:documentation>
</xsd:annotation>
<xsd:annotation>
<xsd:documentation>
This is the XML Schema for the JSP 2.2 deployment descriptor
types. The JSP 2.2 schema contains all the special
structures and datatypes that are necessary to use JSP files
from a web application.
The contents of this schema is used by the web-common_3_0.xsd
file to define JSP specific content.
</xsd:documentation>
</xsd:annotation>
<xsd:annotation>
<xsd:documentation>
The following conventions apply to all Java EE
deployment descriptor elements unless indicated otherwise.
- In elements that specify a pathname to a file within the
same JAR file, relative filenames (i.e., those not
starting with "/") are considered relative to the root of
the JAR file's namespace. Absolute filenames (i.e., those
starting with "/") also specify names in the root of the
JAR file's namespace. In general, relative names are
preferred. The exception is .war files where absolute
names are preferred for consistency with the Servlet API.
</xsd:documentation>
</xsd:annotation>
<xsd:include schemaLocation="javaee_6.xsd"/>
<!-- **************************************************** -->
<xsd:complexType name="jsp-configType">
<xsd:annotation>
<xsd:documentation>
The jsp-configType is used to provide global configuration
information for the JSP files in a web application. It has
two subelements, taglib and jsp-property-group.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="taglib"
type="javaee:taglibType"
minOccurs="0"
maxOccurs="unbounded"/>
<xsd:element name="jsp-property-group"
type="javaee:jsp-property-groupType"
minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="id"
type="xsd:ID"/>
</xsd:complexType>
<!-- **************************************************** -->
<xsd:complexType name="jsp-fileType">
<xsd:annotation>
<xsd:documentation>
The jsp-file element contains the full path to a JSP file
within the web application beginning with a `/'.
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:restriction base="javaee:pathType"/>
</xsd:simpleContent>
</xsd:complexType>
<!-- **************************************************** -->
<xsd:complexType name="jsp-property-groupType">
<xsd:annotation>
<xsd:documentation>
The jsp-property-groupType is used to group a number of
files so they can be given global property information.
All files so described are deemed to be JSP files. The
following additional properties can be described:
- Control whether EL is ignored.
- Control whether scripting elements are invalid.
- Indicate pageEncoding information.
- Indicate that a resource is a JSP document (XML).
- Prelude and Coda automatic includes.
- Control whether the character sequence #{ is allowed
when used as a String literal.
- Control whether template text containing only
whitespaces must be removed from the response output.
- Indicate the default contentType information.
- Indicate the default buffering model for JspWriter
- Control whether error should be raised for the use of
undeclared namespaces in a JSP page.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:group ref="javaee:descriptionGroup"/>
<xsd:element name="url-pattern"
type="javaee:url-patternType"
maxOccurs="unbounded"/>
<xsd:element name="el-ignored"
type="javaee:true-falseType"
minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Can be used to easily set the isELIgnored
property of a group of JSP pages. By default, the
EL evaluation is enabled for Web Applications using
a Servlet 2.4 or greater web.xml, and disabled
otherwise.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="page-encoding"
type="javaee:string"
minOccurs="0">
<xsd:annotation>
<xsd:documentation>
The valid values of page-encoding are those of the
pageEncoding page directive. It is a
translation-time error to name different encodings
in the pageEncoding attribute of the page directive
of a JSP page and in a JSP configuration element
matching the page. It is also a translation-time
error to name different encodings in the prolog
or text declaration of a document in XML syntax and
in a JSP configuration element matching the document.
It is legal to name the same encoding through
mulitple mechanisms.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="scripting-invalid"
type="javaee:true-falseType"
minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Can be used to easily disable scripting in a
group of JSP pages. By default, scripting is
enabled.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="is-xml"
type="javaee:true-falseType"
minOccurs="0">
<xsd:annotation>
<xsd:documentation>
If true, denotes that the group of resources
that match the URL pattern are JSP documents,
and thus must be interpreted as XML documents.
If false, the resources are assumed to not
be JSP documents, unless there is another
property group that indicates otherwise.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="include-prelude"
type="javaee:pathType"
minOccurs="0"
maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
The include-prelude element is a context-relative
path that must correspond to an element in the
Web Application. When the element is present,
the given path will be automatically included (as
in an include directive) at the beginning of each
JSP page in this jsp-property-group.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="include-coda"
type="javaee:pathType"
minOccurs="0"
maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
The include-coda element is a context-relative
path that must correspond to an element in the
Web Application. When the element is present,
the given path will be automatically included (as
in an include directive) at the end of each
JSP page in this jsp-property-group.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="deferred-syntax-allowed-as-literal"
type="javaee:true-falseType"
minOccurs="0">
<xsd:annotation>
<xsd:documentation>
The character sequence #{ is reserved for EL expressions.
Consequently, a translation error occurs if the #{
character sequence is used as a String literal, unless
this element is enabled (true). Disabled (false) by
default.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="trim-directive-whitespaces"
type="javaee:true-falseType"
minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Indicates that template text containing only whitespaces
must be removed from the response output. It has no
effect on JSP documents (XML syntax). Disabled (false)
by default.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="default-content-type"
type="javaee:string"
minOccurs="0">
<xsd:annotation>
<xsd:documentation>
The valid values of default-content-type are those of the
contentType page directive. It specifies the default
response contentType if the page directive does not include
a contentType attribute.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="buffer"
type="javaee:string"
minOccurs="0">
<xsd:annotation>
<xsd:documentation>
The valid values of buffer are those of the
buffer page directive. It specifies if buffering should be
used for the output to response, and if so, the size of the
buffer to use.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="error-on-undeclared-namespace"
type="javaee:true-falseType"
minOccurs="0">
<xsd:annotation>
<xsd:documentation>
The default behavior when a tag with unknown namespace is used
in a JSP page (regular syntax) is to silently ignore it. If
set to true, then an error must be raised during the translation
time when an undeclared tag is used in a JSP page. Disabled
(false) by default.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id"
type="xsd:ID"/>
</xsd:complexType>
<!-- **************************************************** -->
<xsd:complexType name="taglibType">
<xsd:annotation>
<xsd:documentation>
The taglibType defines the syntax for declaring in
the deployment descriptor that a tag library is
available to the application. This can be done
to override implicit map entries from TLD files and
from the container.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="taglib-uri"
type="javaee:string">
<xsd:annotation>
<xsd:documentation>
A taglib-uri element describes a URI identifying a
tag library used in the web application. The body
of the taglib-uri element may be either an
absolute URI specification, or a relative URI.
There should be no entries in web.xml with the
same taglib-uri value.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="taglib-location"
type="javaee:pathType">
<xsd:annotation>
<xsd:documentation>
the taglib-location element contains the location
(as a resource relative to the root of the web
application) where to find the Tag Library
Description file for the tag library.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id"
type="xsd:ID"/>
</xsd:complexType>
</xsd:schema>

View File

@ -0,0 +1,272 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://java.sun.com/xml/ns/javaee"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="3.0">
<xsd:annotation>
<xsd:documentation>
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved.
The contents of this file are subject to the terms of either the
GNU General Public License Version 2 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with
the License. You can obtain a copy of the License at
https://glassfish.dev.java.net/public/CDDL+GPL.html or
glassfish/bootstrap/legal/LICENSE.txt. See the License for the
specific language governing permissions and limitations under the
License.
When distributing the software, include this License Header
Notice in each file and include the License file at
glassfish/bootstrap/legal/LICENSE.txt. Sun designates this
particular file as subject to the "Classpath" exception as
provided by Sun in the GPL Version 2 section of the License file
that accompanied this code. If applicable, add the following
below the License Header, with the fields enclosed by brackets []
replaced by your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
Contributor(s):
If you wish your version of this file to be governed by only the
CDDL or only the GPL Version 2, indicate your decision by adding
"[Contributor] elects to include this software in this
distribution under the [CDDL or GPL Version 2] license." If you
don't indicate a single choice of license, a recipient has the
option to distribute your version of this file under either the
CDDL, the GPL Version 2 or to extend the choice of license to its
licensees as provided above. However, if you add GPL Version 2
code and therefore, elected the GPL Version 2 license, then the
option applies only if the new code is made subject to such
option by the copyright holder.
</xsd:documentation>
</xsd:annotation>
<xsd:annotation>
<xsd:documentation>
<![CDATA[[
This is the XML Schema for the Servlet 3.0 deployment descriptor.
The deployment descriptor must be named "WEB-INF/web.xml" in the
web application's war file. All Servlet deployment descriptors
must indicate the web application schema by using the Java EE
namespace:
http://java.sun.com/xml/ns/javaee
and by indicating the version of the schema by
using the version element as shown below:
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="..."
version="3.0">
...
</web-app>
The instance documents may indicate the published version of
the schema using the xsi:schemaLocation attribute for Java EE
namespace with the following location:
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd
]]>
</xsd:documentation>
</xsd:annotation>
<xsd:annotation>
<xsd:documentation>
The following conventions apply to all Java EE
deployment descriptor elements unless indicated otherwise.
- In elements that specify a pathname to a file within the
same JAR file, relative filenames (i.e., those not
starting with "/") are considered relative to the root of
the JAR file's namespace. Absolute filenames (i.e., those
starting with "/") also specify names in the root of the
JAR file's namespace. In general, relative names are
preferred. The exception is .war files where absolute
names are preferred for consistency with the Servlet API.
</xsd:documentation>
</xsd:annotation>
<xsd:include schemaLocation="web-common_3_0.xsd"/>
<!-- **************************************************** -->
<xsd:element name="web-app"
type="javaee:web-appType">
<xsd:annotation>
<xsd:documentation>
The web-app element is the root of the deployment
descriptor for a web application. Note that the sub-elements
of this element can be in the arbitrary order. Because of
that, the multiplicity of the elements of distributable,
session-config, welcome-file-list, jsp-config, login-config,
and locale-encoding-mapping-list was changed from "?" to "*"
in this schema. However, the deployment descriptor instance
file must not contain multiple elements of session-config,
jsp-config, and login-config. When there are multiple elements of
welcome-file-list or locale-encoding-mapping-list, the container
must concatenate the element contents. The multiple occurence
of the element distributable is redundant and the container
treats that case exactly in the same way when there is only
one distributable.
</xsd:documentation>
</xsd:annotation>
<xsd:unique name="web-common-servlet-name-uniqueness">
<xsd:annotation>
<xsd:documentation>
The servlet element contains the name of a servlet.
The name must be unique within the web application.
</xsd:documentation>
</xsd:annotation>
<xsd:selector xpath="javaee:servlet"/>
<xsd:field xpath="javaee:servlet-name"/>
</xsd:unique>
<xsd:unique name="web-common-filter-name-uniqueness">
<xsd:annotation>
<xsd:documentation>
The filter element contains the name of a filter.
The name must be unique within the web application.
</xsd:documentation>
</xsd:annotation>
<xsd:selector xpath="javaee:filter"/>
<xsd:field xpath="javaee:filter-name"/>
</xsd:unique>
<xsd:unique name="web-common-ejb-local-ref-name-uniqueness">
<xsd:annotation>
<xsd:documentation>
The ejb-local-ref-name element contains the name of an EJB
reference. The EJB reference is an entry in the web
application's environment and is relative to the
java:comp/env context. The name must be unique within
the web application.
It is recommended that name is prefixed with "ejb/".
</xsd:documentation>
</xsd:annotation>
<xsd:selector xpath="javaee:ejb-local-ref"/>
<xsd:field xpath="javaee:ejb-ref-name"/>
</xsd:unique>
<xsd:unique name="web-common-ejb-ref-name-uniqueness">
<xsd:annotation>
<xsd:documentation>
The ejb-ref-name element contains the name of an EJB
reference. The EJB reference is an entry in the web
application's environment and is relative to the
java:comp/env context. The name must be unique within
the web application.
It is recommended that name is prefixed with "ejb/".
</xsd:documentation>
</xsd:annotation>
<xsd:selector xpath="javaee:ejb-ref"/>
<xsd:field xpath="javaee:ejb-ref-name"/>
</xsd:unique>
<xsd:unique name="web-common-resource-env-ref-uniqueness">
<xsd:annotation>
<xsd:documentation>
The resource-env-ref-name element specifies the name of
a resource environment reference; its value is the
environment entry name used in the web application code.
The name is a JNDI name relative to the java:comp/env
context and must be unique within a web application.
</xsd:documentation>
</xsd:annotation>
<xsd:selector xpath="javaee:resource-env-ref"/>
<xsd:field xpath="javaee:resource-env-ref-name"/>
</xsd:unique>
<xsd:unique name="web-common-message-destination-ref-uniqueness">
<xsd:annotation>
<xsd:documentation>
The message-destination-ref-name element specifies the name of
a message destination reference; its value is the
environment entry name used in the web application code.
The name is a JNDI name relative to the java:comp/env
context and must be unique within a web application.
</xsd:documentation>
</xsd:annotation>
<xsd:selector xpath="javaee:message-destination-ref"/>
<xsd:field xpath="javaee:message-destination-ref-name"/>
</xsd:unique>
<xsd:unique name="web-common-res-ref-name-uniqueness">
<xsd:annotation>
<xsd:documentation>
The res-ref-name element specifies the name of a
resource manager connection factory reference. The name
is a JNDI name relative to the java:comp/env context.
The name must be unique within a web application.
</xsd:documentation>
</xsd:annotation>
<xsd:selector xpath="javaee:resource-ref"/>
<xsd:field xpath="javaee:res-ref-name"/>
</xsd:unique>
<xsd:unique name="web-common-env-entry-name-uniqueness">
<xsd:annotation>
<xsd:documentation>
The env-entry-name element contains the name of a web
application's environment entry. The name is a JNDI
name relative to the java:comp/env context. The name
must be unique within a web application.
</xsd:documentation>
</xsd:annotation>
<xsd:selector xpath="javaee:env-entry"/>
<xsd:field xpath="javaee:env-entry-name"/>
</xsd:unique>
<xsd:key name="web-common-role-name-key">
<xsd:annotation>
<xsd:documentation>
A role-name-key is specified to allow the references
from the security-role-refs.
</xsd:documentation>
</xsd:annotation>
<xsd:selector xpath="javaee:security-role"/>
<xsd:field xpath="javaee:role-name"/>
</xsd:key>
<xsd:keyref name="web-common-role-name-references"
refer="javaee:web-common-role-name-key">
<xsd:annotation>
<xsd:documentation>
The keyref indicates the references from
security-role-ref to a specified role-name.
</xsd:documentation>
</xsd:annotation>
<xsd:selector xpath="javaee:servlet/javaee:security-role-ref"/>
<xsd:field xpath="javaee:role-link"/>
</xsd:keyref>
</xsd:element>
</xsd:schema>

File diff suppressed because it is too large Load Diff

287
Tests/issues/1/xml.xsd Normal file
View File

@ -0,0 +1,287 @@
<?xml version='1.0'?>
<?xml-stylesheet href="../2008/09/xsd.xsl" type="text/xsl"?>
<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns ="http://www.w3.org/1999/xhtml"
xml:lang="en">
<xs:annotation>
<xs:documentation>
<div>
<h1>About the XML namespace</h1>
<div class="bodytext">
<p>
This schema document describes the XML namespace, in a form
suitable for import by other schema documents.
</p>
<p>
See <a href="http://www.w3.org/XML/1998/namespace.html">
http://www.w3.org/XML/1998/namespace.html</a> and
<a href="http://www.w3.org/TR/REC-xml">
http://www.w3.org/TR/REC-xml</a> for information
about this namespace.
</p>
<p>
Note that local names in this namespace are intended to be
defined only by the World Wide Web Consortium or its subgroups.
The names currently defined in this namespace are listed below.
They should not be used with conflicting semantics by any Working
Group, specification, or document instance.
</p>
<p>
See further below in this document for more information about <a
href="#usage">how to refer to this schema document from your own
XSD schema documents</a> and about <a href="#nsversioning">the
namespace-versioning policy governing this schema document</a>.
</p>
</div>
</div>
</xs:documentation>
</xs:annotation>
<xs:attribute name="lang">
<xs:annotation>
<xs:documentation>
<div>
<h3>lang (as an attribute name)</h3>
<p>
denotes an attribute whose value
is a language code for the natural language of the content of
any element; its value is inherited. This name is reserved
by virtue of its definition in the XML specification.</p>
</div>
<div>
<h4>Notes</h4>
<p>
Attempting to install the relevant ISO 2- and 3-letter
codes as the enumerated possible values is probably never
going to be a realistic possibility.
</p>
<p>
See BCP 47 at <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt">
http://www.rfc-editor.org/rfc/bcp/bcp47.txt</a>
and the IANA language subtag registry at
<a href="http://www.iana.org/assignments/language-subtag-registry">
http://www.iana.org/assignments/language-subtag-registry</a>
for further information.
</p>
<p>
The union allows for the 'un-declaration' of xml:lang with
the empty string.
</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:union memberTypes="xs:language">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="space">
<xs:annotation>
<xs:documentation>
<div>
<h3>space (as an attribute name)</h3>
<p>
denotes an attribute whose
value is a keyword indicating what whitespace processing
discipline is intended for the content of the element; its
value is inherited. This name is reserved by virtue of its
definition in the XML specification.</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:NCName">
<xs:enumeration value="default"/>
<xs:enumeration value="preserve"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="base" type="xs:anyURI"> <xs:annotation>
<xs:documentation>
<div>
<h3>base (as an attribute name)</h3>
<p>
denotes an attribute whose value
provides a URI to be used as the base for interpreting any
relative URIs in the scope of the element on which it
appears; its value is inherited. This name is reserved
by virtue of its definition in the XML Base specification.</p>
<p>
See <a
href="http://www.w3.org/TR/xmlbase/">http://www.w3.org/TR/xmlbase/</a>
for information about this attribute.
</p>
</div>
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="id" type="xs:ID">
<xs:annotation>
<xs:documentation>
<div>
<h3>id (as an attribute name)</h3>
<p>
denotes an attribute whose value
should be interpreted as if declared to be of type ID.
This name is reserved by virtue of its definition in the
xml:id specification.</p>
<p>
See <a
href="http://www.w3.org/TR/xml-id/">http://www.w3.org/TR/xml-id/</a>
for information about this attribute.
</p>
</div>
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attributeGroup name="specialAttrs">
<xs:attribute ref="xml:base"/>
<xs:attribute ref="xml:lang"/>
<xs:attribute ref="xml:space"/>
<xs:attribute ref="xml:id"/>
</xs:attributeGroup>
<xs:annotation>
<xs:documentation>
<div>
<h3>Father (in any context at all)</h3>
<div class="bodytext">
<p>
denotes Jon Bosak, the chair of
the original XML Working Group. This name is reserved by
the following decision of the W3C XML Plenary and
XML Coordination groups:
</p>
<blockquote>
<p>
In appreciation for his vision, leadership and
dedication the W3C XML Plenary on this 10th day of
February, 2000, reserves for Jon Bosak in perpetuity
the XML name "xml:Father".
</p>
</blockquote>
</div>
</div>
</xs:documentation>
</xs:annotation>
<xs:annotation>
<xs:documentation>
<div xml:id="usage" id="usage">
<h2><a name="usage">About this schema document</a></h2>
<div class="bodytext">
<p>
This schema defines attributes and an attribute group suitable
for use by schemas wishing to allow <code>xml:base</code>,
<code>xml:lang</code>, <code>xml:space</code> or
<code>xml:id</code> attributes on elements they define.
</p>
<p>
To enable this, such a schema must import this schema for
the XML namespace, e.g. as follows:
</p>
<pre>
&lt;schema . . .>
. . .
&lt;import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
</pre>
<p>
or
</p>
<pre>
&lt;import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
</pre>
<p>
Subsequently, qualified reference to any of the attributes or the
group defined below will have the desired effect, e.g.
</p>
<pre>
&lt;type . . .>
. . .
&lt;attributeGroup ref="xml:specialAttrs"/>
</pre>
<p>
will define a type which will schema-validate an instance element
with any of those attributes.
</p>
</div>
</div>
</xs:documentation>
</xs:annotation>
<xs:annotation>
<xs:documentation>
<div id="nsversioning" xml:id="nsversioning">
<h2><a name="nsversioning">Versioning policy for this schema document</a></h2>
<div class="bodytext">
<p>
In keeping with the XML Schema WG's standard versioning
policy, this schema document will persist at
<a href="http://www.w3.org/2009/01/xml.xsd">
http://www.w3.org/2009/01/xml.xsd</a>.
</p>
<p>
At the date of issue it can also be found at
<a href="http://www.w3.org/2001/xml.xsd">
http://www.w3.org/2001/xml.xsd</a>.
</p>
<p>
The schema document at that URI may however change in the future,
in order to remain compatible with the latest version of XML
Schema itself, or with the XML namespace itself. In other words,
if the XML Schema or XML namespaces change, the version of this
document at <a href="http://www.w3.org/2001/xml.xsd">
http://www.w3.org/2001/xml.xsd
</a>
will change accordingly; the version at
<a href="http://www.w3.org/2009/01/xml.xsd">
http://www.w3.org/2009/01/xml.xsd
</a>
will not change.
</p>
<p>
Previous dated (and unchanging) versions of this schema
document are at:
</p>
<ul>
<li><a href="http://www.w3.org/2009/01/xml.xsd">
http://www.w3.org/2009/01/xml.xsd</a></li>
<li><a href="http://www.w3.org/2007/08/xml.xsd">
http://www.w3.org/2007/08/xml.xsd</a></li>
<li><a href="http://www.w3.org/2004/10/xml.xsd">
http://www.w3.org/2004/10/xml.xsd</a></li>
<li><a href="http://www.w3.org/2001/03/xml.xsd">
http://www.w3.org/2001/03/xml.xsd</a></li>
</ul>
</div>
</div>
</xs:documentation>
</xs:annotation>
</xs:schema>

View File

@ -0,0 +1,2 @@
[InternetShortcut]
URL=https://github.com/dgis/xsddiagram/issues/2

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -113,6 +113,12 @@
<DependentUpon>ErrorReportForm.cs</DependentUpon>
</Compile>
<Compile Include="FileShellExtension.cs" />
<Compile Include="LoginPromptForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="LoginPromptForm.Designer.cs">
<DependentUpon>LoginPromptForm.cs</DependentUpon>
</Compile>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
@ -141,6 +147,9 @@
<SubType>Designer</SubType>
<DependentUpon>ErrorReportForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="LoginPromptForm.resx">
<DependentUpon>LoginPromptForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainForm.resx">
<SubType>Designer</SubType>
<DependentUpon>MainForm.cs</DependentUpon>

View File

@ -20,7 +20,6 @@
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<Commandlineparameters>-r COLLADA -e 3 -z 200 /home/dgis/Downloads/collada_schema_1_4.xsd</Commandlineparameters>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
</PropertyGroup>
@ -65,7 +64,6 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Commandlineparameters>-r COLLADA -e 3 -z 200 -y /home/dgis/Downloads/collada_schema_1_4.xsd</Commandlineparameters>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>

Binary file not shown.

View File

@ -51,7 +51,7 @@ namespace XSDDiagram
public IList<string> LoadError { get { return loadError; } }
public IList<string> XsdFilenames { get { return listOfXsdFilename; } }
public delegate bool RequestCredentialEventHandler(string url, string realm, out string username, out string password);
public delegate bool RequestCredentialEventHandler(string url, string realm, int attemptCount, out string username, out string password);
public event RequestCredentialEventHandler RequestCredential;
public void LoadSchema(string fileName)
@ -65,7 +65,16 @@ namespace XSDDiagram
this.loadError.Clear();
this.listOfXsdFilename.Clear();
ImportSchema(fileName);
string url = fileName.Trim();
if (url.IndexOf("http://") == 0 || url.IndexOf("https://") == 0)
{
string basePath = Path.GetTempPath(); //Environment.CurrentDirectory;
string f = LoadSchemaFromUrl(basePath, url);
if (f != null)
fileName = f;
}
ImportSchema(fileName);
}
private void ImportSchema(string fileName)
@ -130,60 +139,9 @@ namespace XSDDiagram
string url = schemaLocation.Trim();
if (url.IndexOf("http://") == 0 || url.IndexOf("https://") == 0)
{
Uri uri = new Uri(url);
if (uri.Segments.Length > 0)
{
string fileNameToImport = uri.Segments[uri.Segments.Length - 1];
loadedFileName = basePath + Path.DirectorySeparatorChar + fileNameToImport;
if (!File.Exists(loadedFileName))
{
WebClient webClient = new WebClient();
bool tryAgain = false;
do
{
try
{
//webClient.DownloadFile(uri, loadedFileName);
tryAgain = false;
string importedXsdFile = webClient.DownloadString(uri);
string importedXsdFileWithoutDTD = new Regex(@"<!DOCTYPE[^>]*>", RegexOptions.Singleline | RegexOptions.IgnoreCase).Replace(importedXsdFile, String.Empty);
using (StreamWriter outfile = new StreamWriter(loadedFileName))
{
outfile.Write(importedXsdFileWithoutDTD);
}
}
catch (WebException ex)
{
if (ex.Response is HttpWebResponse)
{
HttpWebResponse response = ex.Response as HttpWebResponse;
if (response != null && RequestCredential != null && (response.StatusCode == HttpStatusCode.Unauthorized || response.StatusCode == HttpStatusCode.Forbidden))
{
string username = "", password = "";
if (RequestCredential(url, "", out username, out password))
{
webClient.Credentials = new System.Net.NetworkCredential(username, password);
tryAgain = true;
}
}
}
if (!tryAgain)
{
this.loadError.Add("Cannot load the dependency: " + uri.ToString() + ", error: " + ex.ToString());
loadedFileName = null;
}
}
catch (Exception ex)
{
this.loadError.Add("Cannot load the dependency: " + uri.ToString() + ", error: " + ex.ToString());
loadedFileName = null;
}
}
while (tryAgain);
}
}
string f = LoadSchemaFromUrl(basePath, url);
if (f != null)
loadedFileName = f;
}
}
@ -249,6 +207,217 @@ namespace XSDDiagram
}
}
private string LoadSchemaFromUrl(string basePath, string url)
{
Uri uri = new Uri(url);
if (uri.Segments.Length > 0)
{
string fileNameToImport = uri.Segments[uri.Segments.Length - 1];
string loadedFileName = Path.Combine(basePath, fileNameToImport);
if (!File.Exists(loadedFileName))
{
WebClient webClient = new WebClient();
bool tryAgain = false;
int attemptCount = 0;
do
{
try
{
//webClient.DownloadFile(uri, loadedFileName);
tryAgain = false;
string importedXsdFile = webClient.DownloadString(uri);
string importedXsdFileWithoutDTD = new Regex(@"<!DOCTYPE[^>]*>", RegexOptions.Singleline | RegexOptions.IgnoreCase).Replace(importedXsdFile, String.Empty);
using (StreamWriter outfile = new StreamWriter(loadedFileName))
{
outfile.Write(importedXsdFileWithoutDTD);
}
}
catch (WebException ex)
{
if (ex.Response is HttpWebResponse)
{
HttpWebResponse response = ex.Response as HttpWebResponse;
if (response != null && RequestCredential != null && (response.StatusCode == HttpStatusCode.Unauthorized || response.StatusCode == HttpStatusCode.Forbidden))
{
string username = "", password = "";
if (RequestCredential(url, "", ++attemptCount, out username, out password))
{
webClient.Credentials = new System.Net.NetworkCredential(username, password);
tryAgain = true;
}
}
}
if (!tryAgain)
{
this.loadError.Add("Cannot load the dependency: " + uri.ToString() + ", error: " + ex.ToString());
loadedFileName = null;
}
}
catch (Exception ex)
{
this.loadError.Add("Cannot load the dependency: " + uri.ToString() + ", error: " + ex.ToString());
loadedFileName = null;
}
}
while (tryAgain);
}
return loadedFileName;
}
return null;
}
//private void ParseSchema(string fileName, XMLSchema.schema schemaDOM)
//{
// string basePath = Path.GetDirectoryName(fileName);
// if (schemaDOM.Items != null)
// {
// foreach (XMLSchema.openAttrs openAttrs in schemaDOM.Items)
// {
// string loadedFileName = "";
// string schemaLocation = "";
// if (openAttrs is XMLSchema.include)
// {
// XMLSchema.include include = openAttrs as XMLSchema.include;
// if (include.schemaLocation != null)
// schemaLocation = include.schemaLocation;
// }
// else if (openAttrs is XMLSchema.import)
// {
// XMLSchema.import import = openAttrs as XMLSchema.import;
// if (import.schemaLocation != null)
// schemaLocation = import.schemaLocation;
// }
// if (!string.IsNullOrEmpty(schemaLocation))
// {
// loadedFileName = basePath + Path.DirectorySeparatorChar + schemaLocation.Replace('/', Path.DirectorySeparatorChar);
// string url = schemaLocation.Trim();
// if (url.IndexOf("http://") == 0 || url.IndexOf("https://") == 0)
// {
// Uri uri = new Uri(url);
// if (uri.Segments.Length > 0)
// {
// string fileNameToImport = uri.Segments[uri.Segments.Length - 1];
// loadedFileName = basePath + Path.DirectorySeparatorChar + fileNameToImport;
// if (!File.Exists(loadedFileName))
// {
// WebClient webClient = new WebClient();
// bool tryAgain = false;
// int attemptCount = 0;
// do
// {
// try
// {
// //webClient.DownloadFile(uri, loadedFileName);
// tryAgain = false;
// string importedXsdFile = webClient.DownloadString(uri);
// string importedXsdFileWithoutDTD = new Regex(@"<!DOCTYPE[^>]*>", RegexOptions.Singleline | RegexOptions.IgnoreCase).Replace(importedXsdFile, String.Empty);
// using (StreamWriter outfile = new StreamWriter(loadedFileName))
// {
// outfile.Write(importedXsdFileWithoutDTD);
// }
// }
// catch (WebException ex)
// {
// if (ex.Response is HttpWebResponse)
// {
// HttpWebResponse response = ex.Response as HttpWebResponse;
// if (response != null && RequestCredential != null && (response.StatusCode == HttpStatusCode.Unauthorized || response.StatusCode == HttpStatusCode.Forbidden))
// {
// string username = "", password = "";
// if (RequestCredential(url, "", ++attemptCount, out username, out password))
// {
// webClient.Credentials = new System.Net.NetworkCredential(username, password);
// tryAgain = true;
// }
// }
// }
// if (!tryAgain)
// {
// this.loadError.Add("Cannot load the dependency: " + uri.ToString() + ", error: " + ex.ToString());
// loadedFileName = null;
// }
// }
// catch (Exception ex)
// {
// this.loadError.Add("Cannot load the dependency: " + uri.ToString() + ", error: " + ex.ToString());
// loadedFileName = null;
// }
// }
// while (tryAgain);
// }
// }
// }
// }
// if (!string.IsNullOrEmpty(loadedFileName))
// ImportSchema(loadedFileName);
// }
// }
// string nameSpace = schemaDOM.targetNamespace;
// if (schemaDOM.Items1 != null)
// {
// foreach (XMLSchema.openAttrs openAttrs in schemaDOM.Items1)
// {
// if (openAttrs is XMLSchema.element)
// {
// XMLSchema.element element = openAttrs as XMLSchema.element;
// XSDObject xsdObject = new XSDObject(fileName, element.name, nameSpace, "element", element);
// this.hashtableElementsByName[xsdObject.FullName] = xsdObject;
// if (this.firstElement == null)
// this.firstElement = xsdObject;
// elements.Add(xsdObject);
// }
// else if (openAttrs is XMLSchema.group)
// {
// XMLSchema.group group = openAttrs as XMLSchema.group;
// XSDObject xsdObject = new XSDObject(fileName, group.name, nameSpace, "group", group);
// this.hashtableElementsByName[xsdObject.FullName] = xsdObject;
// elements.Add(xsdObject);
// }
// else if (openAttrs is XMLSchema.simpleType)
// {
// XMLSchema.simpleType simpleType = openAttrs as XMLSchema.simpleType;
// XSDObject xsdObject = new XSDObject(fileName, simpleType.name, nameSpace, "simpleType", simpleType);
// this.hashtableElementsByName[xsdObject.FullName] = xsdObject;
// elements.Add(xsdObject);
// }
// else if (openAttrs is XMLSchema.complexType)
// {
// XMLSchema.complexType complexType = openAttrs as XMLSchema.complexType;
// XSDObject xsdObject = new XSDObject(fileName, complexType.name, nameSpace, "complexType", complexType);
// this.hashtableElementsByName[xsdObject.FullName] = xsdObject;
// elements.Add(xsdObject);
// }
// else if (openAttrs is XMLSchema.attribute)
// {
// XMLSchema.attribute attribute = openAttrs as XMLSchema.attribute;
// XSDAttribute xsdAttribute = new XSDAttribute(fileName, attribute.name, nameSpace, "attribute", attribute.@ref != null, attribute.@default, attribute.use.ToString(), attribute);
// this.hashtableAttributesByName[xsdAttribute.FullName] = xsdAttribute;
// }
// else if (openAttrs is XMLSchema.attributeGroup)
// {
// XMLSchema.attributeGroup attributeGroup = openAttrs as XMLSchema.attributeGroup;
// XSDAttributeGroup xsdAttributeGroup = new XSDAttributeGroup(fileName, attributeGroup.name, nameSpace, "attributeGroup", attributeGroup is XMLSchema.attributeGroupRef, attributeGroup);
// this.hashtableAttributesByName[xsdAttributeGroup.FullName] = xsdAttributeGroup;
// }
// }
// }
//}
void schemaSerializer_UnknownAttribute(object sender, XmlAttributeEventArgs e)
{
this.loadError.Add("Unkonwn attribute (" + e.LineNumber + ", " + e.LinePosition + "): " + e.Attr.Name);

View File

@ -114,7 +114,7 @@ namespace XSDDiagram.Rendering
String.Format("Do you agree to generate a {0}x{1} image?", bbox.Width, bbox.Height));
if (bypassAlert)
{
Bitmap bitmap = new Bitmap(bbox.Width, bbox.Height);
Bitmap bitmap = new Bitmap(bbox.Width, bbox.Height);
Graphics graphics = Graphics.FromImage(bitmap);
graphics.FillRectangle(Brushes.White, 0, 0, bbox.Width, bbox.Height);
DiagramGdiRenderer.Draw(_diagram, graphics);

11
test.bat Normal file
View File

@ -0,0 +1,11 @@
start "" /wait XSDDiagram.exe -r COLLADA -e 3 http://www.khronos.org/files/collada_schema_1_4_1.xsd
start "" /wait XSDDiagram.exe Tests\COLLADASchema_141.xsd
start "" /wait XSDDiagram.exe -r sphere -r COLLADA -e 3 Tests\COLLADASchema_141.xsd
start "" /wait XSDDiagramConsole.exe -o Tests\file.png -r COLLADA -e 3 -z 200 Tests\COLLADASchema_141.xsd
start "" /wait XSDDiagramConsole.exe -o Tests\file.jpg -r COLLADA -e 3 -z 200 Tests\COLLADASchema_141.xsd
start "" /wait XSDDiagramConsole.exe -o Tests\file.emf -r COLLADA -e 3 Tests\COLLADASchema_141.xsd
start "" /wait XSDDiagramConsole.exe -o Tests\file.svg -r COLLADA -e 3 Tests\COLLADASchema_141.xsd
XSDDiagramConsole.exe -os png -r COLLADA -e 3 -y Tests\COLLADASchema_141.xsd > Tests\stdout.png
XSDDiagramConsole.exe -os jpg -r COLLADA -e 3 -y Tests\COLLADASchema_141.xsd > Tests\stdout.jpg
XSDDiagramConsole.exe -os svg -r COLLADA -e 3 -y Tests\COLLADASchema_141.xsd > Tests\stdout.svg
@pause