remove more duplicate classes; add additional values functions; clean up tests
This commit is contained in:
@ -4,13 +4,20 @@ import { hpsMeasureValue } from "../values";
|
||||
|
||||
// This represents element type CT_OnOff, which indicate a boolean value.
|
||||
//
|
||||
// A value of 1 or true specifies that the property shall be explicitly applied.
|
||||
// This is the default value for this attribute, and is implied when the parent
|
||||
// element is present, but this attribute is omitted.
|
||||
// A value of 0 or false specifies that the property shall be explicitly turned off.
|
||||
//
|
||||
// <xsd:complexType name="CT_OnOff">
|
||||
// <xsd:attribute name="val" type="s:ST_OnOff"/>
|
||||
// </xsd:complexType>
|
||||
export class OnOffElement extends XmlComponent {
|
||||
constructor(name: string, val: boolean | undefined = true) {
|
||||
super(name);
|
||||
this.root.push(new Attributes({ val }));
|
||||
if (val !== true) {
|
||||
this.root.push(new Attributes({ val }));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,3 +32,15 @@ export class HpsMeasureElement extends XmlComponent {
|
||||
this.root.push(new Attributes({ val: hpsMeasureValue(val) }));
|
||||
}
|
||||
}
|
||||
|
||||
// This represents element type CT_String, which indicate a string value.
|
||||
//
|
||||
// <xsd:complexType name="CT_String">
|
||||
// <xsd:attribute name="val" type="s:ST_String" use="required"/>
|
||||
// </xsd:complexType>
|
||||
export class StringValueElement extends XmlComponent {
|
||||
constructor(name: string, val: string) {
|
||||
super(name);
|
||||
this.root.push(new Attributes({ val }));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user