1
1
mirror of https://github.com/dgis/xsddiagram.git synced 2024-08-16 14:00:40 +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

2
AboutForm.Designer.cs generated
View File

@ -71,8 +71,10 @@ namespace XSDDiagram
//
// 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);

View File

@ -62,6 +62,7 @@ namespace XSDDiagram
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);

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);

View File

@ -53,6 +53,7 @@ namespace XSDDiagram
private TextBox textBoxAnnotation;
private WebBrowser webBrowserDocumentation;
private bool webBrowserSupported = true;
private string backupUsername = "", backupPassword = "";
public MainForm()
{
@ -75,7 +76,8 @@ namespace XSDDiagram
this.panelDiagram.DiagramControl.Paint += new PaintEventHandler(DiagramControl_Paint);
this.schema.RequestCredential += schema_RequestCredential;
this.backupUsername = Options.Username;
this.backupPassword = Options.Password;
if (Options.IsRunningOnMono)
{
try
@ -89,9 +91,7 @@ namespace XSDDiagram
}
}
string backupUsername = "", backupPassword = "";
bool schema_RequestCredential(string url, string realm, out string username, out string password)
bool schema_RequestCredential(string url, string realm, int attemptCount, out string username, out string password)
{
string label = "The file '" + url + "' requires a username and password.";
LoginPromptForm dlg = new LoginPromptForm(label);
@ -169,16 +169,25 @@ namespace XSDDiagram
private void MainForm_DragDrop(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
if (e.Data.GetDataPresent("UniformResourceLocator"))
{
string url = e.Data.GetData(DataFormats.Text, true) as string;
if (!string.IsNullOrEmpty(url))
LoadSchema(url.Trim());
}
else if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
if(files != null && files.Length > 0)
LoadSchema(files[0]);
}
}
private void MainForm_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
if (e.Data.GetDataPresent(DataFormats.FileDrop)
|| e.Data.GetDataPresent("UniformResourceLocator")
)
e.Effect = DragDropEffects.Move;
else
e.Effect = DragDropEffects.None;
@ -200,6 +209,16 @@ namespace XSDDiagram
exporter.Export(outputFilename, g1, new DiagramAlertHandler(SaveAlert));
g1.Dispose();
}
catch (System.ArgumentException ex)
{
MessageBox.Show("You have reach the system limit.\r\nPlease remove some element from the diagram to make it smaller.");
System.Diagnostics.Trace.WriteLine(ex.ToString());
}
catch (System.Runtime.InteropServices.ExternalException ex)
{
MessageBox.Show("You have reach the system limit.\r\nPlease remove some element from the diagram to make it smaller.");
System.Diagnostics.Trace.WriteLine(ex.ToString());
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);

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,6 +1,6 @@
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.
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).
@ -17,7 +17,7 @@ FEATURES:
- 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
- Drag'n drop a xsd file or url on the main window header
- Command line image generation
@ -34,20 +34,20 @@ QUICK START:
COMMAND LINE USAGE:
> XSDDiagram.exe [-o output.svg] [-so EXTENSION] [-r RootElement]* [-e N] [-z N] [file.xsd]
> 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] [-so EXTENSION] [-r RootElement]* [-e N] [-z N] [file.xsd]
> 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. 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 or svg.
output. EXTENSION can be: png, jpg, svg.
If not present, the GUI is shown.
-r ELEMENT
specifies the root element of the tree.
@ -59,7 +59,14 @@ Options:
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.
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
@ -81,26 +88,34 @@ Example 4:
'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/...)
- 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)
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!

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,6 +65,15 @@ namespace XSDDiagram
this.loadError.Clear();
this.listOfXsdFilename.Clear();
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);
}
@ -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);

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