Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space WBRIDGE and version 7.2.0
Div
Classe2e-refDiv

Otp
Floatingfalse

Rp

Mapping of UML classes to XML documents is controlled by stereotypes assigned to class attributes and association ends. Tagged value Class To XML Default Root Name on the composite controls the name that will be assigned to the root element (see Frontend Components).

...

StereotypeDescriptionTagged Values
(Description see below)
<<XML>>Set this basic stereotype on class level to be able to apply the stereotypes listed below to the attributes.xmlNamespace
xmlElementName
isMixed
isOrdered
<<XMLElement>>UML properties are mapped to XML elements.xmlNamespace
xmlForm
xmlFormat
isNillable
<<XMLAttribute>>

UML properties having a simple type are mapped to XML attributes.
If the property type is complex, the compiler will report an error.

xmlNamespace
xmlForm
xmlFormat
<<E2EAttribute>>This stereotype can be used to specify an order for  the generation of XML elements.order
<<XMLNamespace>>UML properties having a simple type are mapped to XML namespaces.
The prefix of the namespace is given by the property name. If the same namespace is declared more than once, the runtime will suppress namespaces further down the XML hierarchy, if prefix and namespace are identical. If not, the xUML Runtime will throw an exception.
 
<<XMLCharacters>>UML properties having a simple type are serialized as a character stream.xmlFormat

...

Tagged ValueLevelDescriptionAllowed Values 
classToXMLDefaultRootNameComposite

Multiexcerpt include
MultiExcerptNameclassToXMLDefaultRootName
PageWithExcerptFrontend Components

Note
iconfalse

If this tagged value is set to other values than "Default", tagged values xmlElementName and xmlNamespace on the <<XML>> class are disregarded.


Default

Multiexcerpt include
MultiExcerptNamerootName_Default
PageWithExcerptFrontend Components

Type Name

Multiexcerpt include
MultiExcerptNamerootName_Type
PageWithExcerptFrontend Components

Variable Name

Multiexcerpt include
MultiExcerptNamerootName_Variable
PageWithExcerptFrontend Components

xmlNamespaceClassSpecify the XML namespace.a valid namespace
xmlElementNameClassSpecify the name of the XML root element.a valid element name 
isMixedClassSpecify whether the XML contains mixed (static and variable) content. For more information on mixed content, refer to Mixed Content.trueXML contains mixed content.
falseXML does not contain mixed content (default).
isOrderedClassSpecify whether the class attributes should be serialized to XML using the order tag that has been specified on the attributes.trueSerialize in order of order tags from the attributes.
falseSerialize in order of attributes on class.
xmlNamespaceAttribute

Each XML attribute and element may have its own namespace.

If the tagged value contains an URI, the runtime will automatically generate a unique prefix. For example: A tagged value xmlNamespace = "http://e2e.ch" on the UML property anElement will result in the XML document <ns0:anElement xmlns:ns0="http://e2e.ch">.
However, it is possible to define the prefix by using the following syntax: 'xmlns:' <prefix name>  '=' <namespace uri>. For example, the tagged value xmlNamespace = 'xmlns:typens="http://e2e.ch"' of the UML property anElement will lead to the following XML fragment: <typens:anElement xmlns:typens="http://e2e.ch">.
an URI
a valid xlmns syntax
xmlFormAttribute

Depending on this tagged value, XML elements or attributes may not be qualified by a namespace prefix even if they have one.

qualified

The element or attribute must always be qualified by a namespace prefix. Default for XML elements.

unqualifiedNo namespace prefixes are allowed (for details see http://www.w3.org/TR/xmlschema-0/#NS). Default for XML attributes.
xmlFormatAttribute

If numbers and date/time types are parsed or composed, the XML parser respectively composer expects simple date types following the XML schema specification. However, legacy XML documents may contain different number and date/time formats. In this case, the tagged value xmlFormat may hold a format string. If numbers are parsed or composed use the format strings defined in section Number Formatting. If date/time expressions must be parsed or composed, use the format strings defined in Date and Time Formatting.

Use xmlFormat = "CDATA" together with stereotype <<XMLElement>> to compose strings as CDATA with classToXML() . Parse CDATA elements works out of the box, you do not need to set xmlFormat.
a valid format string (see Number Formatting or Date and Time Formatting)
CDATAcompose string as CDATA
isNillableAttribute

By default, UML properties that are NULL are not serialized into XML documents. However, if it is necessary to do so, isNillable must be set to true. In this case, the UML properties being NULL will look like: <aProperty xsi:nil="true"></aProperty>.

Noteinfo
iconfalse

Some client code generators will use this attribute in the WSDL file for type generation. If false they will generate simple types, if true they will generate complex types.

trueserialize NULL properties
false (default)do not serialize NULL properties
orderAttributeUse this tagged value of <<E2EAttribute>> to specify the order in which the XML elements will be generated to the XML document.a valid float

...

With the three XML stereotypes, one has the flexibility to map XML structures in different ways. You can define very compact class diagrams for simple XML structures, but you have also the possibility to map complex XML data structures graphically.

Noteinfo
iconfalse

If an XML Schema is provided, you can import it with the Builder. It will generate all classes and relations according the XSD import rules described in XML Schema Import Rules. For how to use the E2E XSD Importer refer to Importing WSDL or XSD.