October 08, 2008

Document Info

IPCOM #
000157944D
Published
Subscription feature
Number of pages
3
Language
Subscription feature
Format(s)
PDF
(HTML)



 

Modeling XSD:key and XSD:keyref Using EMF

Disclosed is a mechanism for supporting xsd:key and xsd:keyref in Eclipse Modeling Framework (EMF). Eclipse Modeling Framework models XSD:element as a feature/property, and XSD:complexType element as a containment reference. This disclosure models XSD:keyref element as a non-containment reference so that EMF users now can model non-containment references in XML Schema Definition (XSD).

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.

Page 1 of 3

Modeling XSD:key and XSD:keyref Using EMF

Eclipse Modeling Framework (EMF) provides org.eclipse.xsd.XSDPackage#getDOMElement() to interpret XSD:element, XSD:key, and XSD:keyref information is available as in Document Object Model (DOM) Element.

EMF also provides org.eclipse.xsd.ecore.XSDEcoreBuilder to convert loaded XML Schema Definition (XSD) to EMF classes and features/properties. This disclosure provides XsdEcoreBuilder (Fig. 1) to support XSD:key and XSD:keyref.

Figure 1

The modeling of XSD:key and XSD:keyref using EMF is the most important part.

EMF provides org.eclipse.emf.ecore.EReference for reference. This disclosure provides KeyReference (Fig. 2) to model XSD:keyref and XSD:key.

Figure 2

1

[This page contains 2 pictures or other non-text objects]

Page 2 of 3

e.g.
targetNamespace="OrderNamespace" xmlns:tns="OrderNamespace"
xmlns:bo="
http://www.ibm.com/xmlns/prod/websphere/wbi/BusinessObject/6.0.0
">


(Fig. 3) It produces:

2

Page 3 of 3

Figure 3

Now, the programming model:


EObject instanceOrderRole = ...

EClass OrderRole = instanceOrderRole.eClass(); // EMF API
Object reference = OrderRole.getEStructuralFeature( "record");
// EMF API
KeyReference record = (KeyReference)reference;

EClass type = record.getEReferenceType(); // EMF API
// order is the return, while EMF returns OrderKeyref which is
wr...

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 63% of the total text.

Disclosed by IBM

Previewing pages 1-3 of 3
page 1 of 3 page 2 of 3 page 3 of 3


Keep up to date with our RSS newsfeed  Download/view the live RSS feed of current documents