Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "MoDisco/Components/XML"

(Definition)
(km3 definition)
Line 13: Line 13:
  
 
=== km3 definition ===
 
=== km3 definition ===
+
 
 
  package XML {
 
  package XML {
 
+
  abstract class Node {
abstract class Node {
+
  attribute name : String;
attribute name : String;
+
  reference parent[0-1] : Element oppositeOf children;
reference parent[0-1] : Element oppositeOf children;
+
  }
}
+
  class Attribute extends Node {
 
+
  attribute value : String;
class Attribute extends Node {
+
  }
attribute value : String;
+
  class Text extends Node {
}
+
  }
 
+
  class Element extends Node {
class Text extends Node {
+
  reference children[*] ordered container : Node oppositeOf parent;
+
  }
}
+
  class Root extends Element {
 
+
  reference namespaces[*] ordered container : Namespace;
class Element extends Node {
+
  reference dtd[0-1] container : DocumentTypeDeclaration;
reference children[*] ordered container : Node oppositeOf parent;
+
  }
}
+
  class Namespace extends Attribute {
 
+
  }
class Root extends Element {
+
  class Comment extends Node {
reference namespaces[*] ordered container : Namespace;
+
  }
reference dtd[0-1] container : DocumentTypeDeclaration;
+
  class DocumentTypeDeclaration extends Node {
}
+
  attribute publicID[0-1] : String;
 
+
  attribute systemID[0-1] : String;
class Namespace extends Attribute {
+
  }
+
  class CDATA extends Text {
}
+
  }
 
+
  class ProcessingInstruction extends Node {
class Comment extends Node {
+
  attribute data : String;
+
  }
}
+
}
 
+
package PrimitiveTypes {
class DocumentTypeDeclaration extends Node {
+
  datatype Boolean;
attribute publicID[0-1] : String;
+
  datatype Integer;
attribute systemID[0-1] : String;
+
  datatype String;
}
+
}
 
+
class CDATA extends Text {
+
+
}
+
+
class ProcessingInstruction extends Node {
+
attribute data : String;
+
}
+
}
+
 
+
package PrimitiveTypes {
+
datatype Boolean;
+
datatype Integer;
+
datatype String;
+
}
+
  
 
== Requirements ==
 
== Requirements ==

Revision as of 13:07, 14 August 2009

The Generic XML Metamodel represents a subset of concepts defined in W3C XML Recommendation.

Its purpose is to represent XML content without taking care of conformance to concepts described in a Document Type Definition(DTD) or in a XML Schema Description (XSD) (i.e. without having a metamodel dedicated to one or many DTD/XSD).

It is an alternative to the metamodel definition provided with EMF plugins (nsuri : http://www.eclipse.org/emf/2003/XMLType) : we think that a more understandable model navigation, without the use of the Extended Ecore Modeling FeatureMap type, can be proposed to the end user. In return, some filtering (on node children) might be more time expensive.

Definition

Ecore Generic XML metamodel definition

W3C XML Recommendation describes those concepts in document and logical structures sections. Concepts for Document Types Declarations are not managed here.

km3 definition

package XML {
 abstract class Node {
  attribute name : String;
  reference parent[0-1] : Element oppositeOf children;
 }
 class Attribute extends Node {
  attribute value : String;
 }
 class Text extends Node {
 }
 class Element extends Node {
  reference children[*] ordered container : Node oppositeOf parent;
 }
 class Root extends Element {
  reference namespaces[*] ordered container : Namespace;
  reference dtd[0-1] container : DocumentTypeDeclaration;
 }
 class Namespace extends Attribute {
 }
 class Comment extends Node {
 }
 class DocumentTypeDeclaration extends Node {
  attribute publicID[0-1] : String;
  attribute systemID[0-1] : String;
 }
 class CDATA extends Text {
 }
 class ProcessingInstruction extends Node {
  attribute data : String;
 }
}
package PrimitiveTypes {
 datatype Boolean;
 datatype Integer;
 datatype String;
}

Requirements

To use the plug-in you need:

  • JDK 1.5 or above
  • a version of Eclipse 3.5 or above with the following set of plug-ins installed
  • EMF 2.5.0 or higher

Team

Fabien Giquel (Mia-Software)


Associated Discoverers

The Generic XML discoverer : XML Discoverer


Install

Install from SVN

  • connect to the SVN repository with anonymous access :
URL = https://dev.eclipse.org/svnroot/modeling/org.eclipse.gmt.modisco
  • navigate in repository following 'plugins/trunk' path.
  • check-out the project named 'org.eclipse.gmt.modisco.infra.xml.core' .
  • Use "export" menu to export this project as a plugin (Deployable plugins and fragments) in your Eclipse installation. Don't forget to choose "Package plug-ins as individual jar archives" option.
  • restart Eclipse to take in account this plug-in

Back to the top