...
If an object contains one or more objects, its start and end tags are terminated with a windows EOL (ASCII 0x0D 0x0A) sequence.
- If an object contains only a value, the start tag, value, and end tag are on one line terminated by a CRLF sequence.
These recommendations are for cosmetic purposes only. The actual whitespace used is irrelevant; End-Of-Lines can be of any type desired and arbitrary spaces and tabs (or none at all) can be used.
Examples
Figure 2 is the UML definition of a GuideTargetPosition object, which is composed of an XPosition and a YPosition object (GuideTargetPosition contains the XPosition and YPosition objects). The XPosition and YPosition position objects are peers; each contains a single value.
The XML representation of GuideTargetPosition as represented in Figure 2: UML representation of GuideTargetPosition is
Code Block |
---|
<GuideTargetPosition> |
<XPosition_mm> |
<xPosition_mm>10</xPosition_mm> |
</XPosition_mm> |
<YPosition_mm> |
<yPosition_mm>2.2</yPosition_mm> |
</YPosition_mm> |
</GuideTargetPosition> |
If an object inherits an attribute (value) from a parent class, the attribute will be a peer of any other member objects that may exist; the attribute and the member objects will be “peer children” of the parent object. Acontrivedexampleisshownbelow;letussupposethatGuideTargetPositioninheritsan attribute named “Numeric” from its parent class TCSGuiderStatus. The definition and XML representations are almost the same as above; note that the TCSGuiderStatus node now contains the “Numeric” attribute.
The XML representation of the UML representation in Figure 3: UML representation of GuideTargetPosition if it had a parent attribute is
Code Block |
---|
<GuideTargetPosition> |
<Numeric>2.34</Numeric> |
<XPosition_mm> |
<xPosition_mm>10</xPosition_mm> |
</XPosition_mm> |
<YPosition_mm> |
<yPosition_mm>2.2</yPosition_mm> |
</YPosition_mm> |
</GuideTargetPosition> |