Visual Basic 6 Sample : Simple Hierarchy
| Schema Summary This sample shows a number of elements within a Hierarchy. It includes local (anonymous) & global complex types. It also shows how collections are manipulated within sequences & choices. Schema Details This schema contains 2 globally defined elements AddressType, ItemType and Invoice. All of these objects can be used as the documentElement (root element) in a valid XML document. The Invoice object also contains a sequence, the sequence contains a number of child elements; InvoiceNo is a primitive DeliveryAddress is a element that conforms to the global element AddressType. BillingAddress is an optional (the corresponding property on the Invoice object may contain a null because of this) element that conforms to the global element AddressType. Item is a collection of elements conforming to the global element ItemType. Payment is a locally defined element, it in turn contains a choice of; an element 'VISA' or a collection of 'Vouchers' elements or an element 'Cash' which is untyped within the schema, and represented as a string within the generated code. Sample Description The sample builds on the previous sample, and demonstrates how to deal with a choice that contains a collection of elements. |
Sample XML File
<?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="..\Schema\SimpleHierarchy.xsd">
<InvoiceNo>564</InvoiceNo>
<DeliveryAddress>
<Forename>Joe</Forename>
<Surname>Bloggs</Surname>
<AddresLine1>23 Summers lane</AddresLine1>
<AddresLine2>Wintersville</AddresLine2>
<AddresLine5>Stoke</AddresLine5>
<PostCode>SK4 8LS</PostCode>
</DeliveryAddress>
<BillingAddress>
<Forename>Jane</Forename>
<Surname>Doe</Surname>
<AddresLine1>Acme Account</AddresLine1>
<AddresLine2>Acme House</AddresLine2>
<AddresLine3>523 Hogarth Lane</AddresLine3>
<AddresLine5>Collegeville</AddresLine5>
<PostCode>CL5 4UT</PostCode>
</BillingAddress>
<Item>
<StockCode>6896</StockCode>
<Description>A4 Paper (white)</Description>
<UnitCost>495</UnitCost>
<Quantity>15</Quantity>
</Item>
<Item>
<StockCode>5161</StockCode>
<Description>Paper Clips (Large)</Description>
<UnitCost>54</UnitCost>
<Quantity>10</Quantity>
</Item>
<Payment>
<Vouchers VoucherNo="546487951" VoucherValue="5000"/>
<Vouchers VoucherNo="654646466" VoucherValue="500"/>
<Vouchers VoucherNo="654649849" VoucherValue="2500"/>
</Payment>
</Invoice>
|
Const FilePath = SamplePath + "SimpleHierarchy\\Samples\\Sample2.xml"
' Create Invoice object
Dim invoice As New SimpleHiarchyLib.invoice
' Load data into the object from a file
invoice.FromXmlFile FilePath
' Now we can look at the data
Trace "Invoice No = " &; invoice.InvoiceNo
' look at the billing address
' The billing address is optional, so we need to check it has been provided
If Not invoice.BillingAddress Is Nothing Then
Trace "Billing Addresss"
Trace " Forename = " &; invoice.BillingAddress.Forename
Trace " Surname = " &; invoice.BillingAddress.Surname
Trace " Address Line 1 = " &; invoice.BillingAddress.AddresLine1
Trace " Address Line 2 = " &; invoice.BillingAddress.AddresLine2
' AddresLine3 &; AddresLine4 are optional, so check they are valid before using them
If invoice.BillingAddress.IsValidAddresLine3 Then
Trace " Address Line 3 = " &; invoice.BillingAddress.AddresLine3
End If
If invoice.BillingAddress.IsValidAddresLine4 Then
Trace " Address Line 4 = " &; invoice.BillingAddress.AddresLine4
End If
Trace " Address Line 5 = " &; invoice.BillingAddress.AddresLine5
Trace " Postcode = " &; invoice.BillingAddress.PostCode
End If
' look at the Shipping address
Trace "Billing Addresss"
Trace " Forename = " &; invoice.DeliveryAddress.Forename
Trace " Surname = " &; invoice.DeliveryAddress.Surname
Trace " Address Line 1 = " &; invoice.DeliveryAddress.AddresLine1
Trace " Address Line 2 = " &; invoice.DeliveryAddress.AddresLine2
' AddresLine3 &; AddresLine4 are optional, so check they are valid before using them
If invoice.DeliveryAddress.IsValidAddresLine3 Then
Trace " Address Line 3 = " &; invoice.DeliveryAddress.AddresLine3
End If
If invoice.DeliveryAddress.IsValidAddresLine4 Then
Trace " Address Line 4 = " &; invoice.DeliveryAddress.AddresLine4
End If
Trace " Address Line 5 = " &; invoice.DeliveryAddress.AddresLine5
Trace " Postcode = " &; invoice.DeliveryAddress.PostCode
' look at all the items in the invoice
Trace "There are " &; invoice.Item.Count & " items in the order"
Dim itm As SimpleHiarchyLib.ItemType
For Each itm In invoice.Item
Trace "Item"
Trace " StockCode = " &; itm.StockCode
Trace " Description = " &; itm.Description
Trace " UnitCost = " &; itm.UnitCost
Trace " Quantity = " &; itm.Quantity
Next itm
' now look at the Payment method, this is a choice in the schema,
' so only one option is posible
If invoice.Payment.ChoiceSelectedElement = "Cash" Then
Trace "The invoice was paid in Cash"
ElseIf invoice.Payment.ChoiceSelectedElement = "VISA" Then
Trace "The invoice was paid with a VISA Card"
Trace " Card Number = " &; invoice.Payment.VISA.CardNo
Trace " Card Expiry = " &; invoice.Payment.VISA.Expiry
ElseIf invoice.Payment.ChoiceSelectedElement = "Vouchers" Then
Trace "The invoice was paid with Vouchers"
Dim v As SimpleHiarchyLib.Vouchers
For Each v In invoice.Payment.Vouchers
Trace "Voucher"
Trace " Number = " &; v.VoucherNo
Trace " Value = " &; v.VoucherValue
Next v
Else
Trace "Unknown selected element " &; invoice.Payment.ChoiceSelectedElement
End If
|
' Create Invoice object Dim invoice As New SimpleHiarchyLib.invoice ' Now we can look at the data invoice.InvoiceNo = 564 ' because the BillingAddress is optional, we need to populate ' this property before using it. Set invoice.BillingAddress = New SimpleHiarchyLib.AddressType invoice.BillingAddress.Forename = "Joe" invoice.BillingAddress.Surname = "Bloggs" invoice.BillingAddress.AddresLine1 = "23 Summers lane" invoice.BillingAddress.AddresLine2 = "Wintersville" invoice.BillingAddress.AddresLine5 = "Stoke" invoice.BillingAddress.PostCode = "SK4 8LS" Set invoice.DeliveryAddress = New SimpleHiarchyLib.AddressType invoice.DeliveryAddress.Forename = "Jane" invoice.DeliveryAddress.Surname = "Doe" invoice.DeliveryAddress.AddresLine1 = "Acme Account" invoice.DeliveryAddress.AddresLine2 = "Acme House" ' This is an optional field, setting it makes it appear in the output xml invoice.DeliveryAddress.AddresLine3 = "523 Hogarth Lane" invoice.DeliveryAddress.AddresLine5 = "Collegeville" invoice.DeliveryAddress.PostCode = "CL5 4UT" ' We will add 2 items of the collection we will add each one ' in a different ways, for demonstration purposes. ' Ask the collection to add an item. This creates a new item ' and adds it to the collection in one step. The new object is returned. Dim itm1 As SimpleHiarchyLib.ItemType Set itm1 = invoice.Item.AddNew itm1.StockCode = 6896 itm1.Description = "A4 Paper (white)" itm1.UnitCost = 495 itm1.Quantity = 15 ' Create an new item and add it to the collection Dim itm2 As New SimpleHiarchyLib.ItemType invoice.Item.Add itm2 itm2.StockCode = 5161 itm2.Description = "Paper Clips (Large)" itm2.UnitCost = 54 itm2.Quantity = 10 Dim v1 As SimpleHiarchyLib.Vouchers Dim v2 As SimpleHiarchyLib.Vouchers Dim v3 As SimpleHiarchyLib.Vouchers Set v1 = invoice.Payment.Vouchers.AddNew Set v2 = invoice.Payment.Vouchers.AddNew Set v3 = invoice.Payment.Vouchers.AddNew v1.VoucherNo = 546487951 v1.VoucherValue = 5000 v2.VoucherNo = 654646466 v2.VoucherValue = 500 v3.VoucherNo = 654649849 v3.VoucherValue = 2500 ' Now we can look at the XML from this object Trace invoice.ToXml(True, XmlFormatting_Indented, XmlEncoding_UTF8)
|
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:complexType name="AddressType">
<xs:sequence>
<xs:element name="Forename" type="xs:string"/>
<xs:element name="Surname" type="xs:string"/>
<xs:element name="AddresLine1" type="xs:string"/>
<xs:element name="AddresLine2" type="xs:string"/>
<xs:element name="AddresLine3" type="xs:string" minOccurs="0"/>
<xs:element name="AddresLine4" type="xs:string" minOccurs="0"/>
<xs:element name="AddresLine5" type="xs:string"/>
<xs:element name="PostCode" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ItemType">
<xs:sequence>
<xs:element name="StockCode" type="xs:unsignedLong"/>
<xs:element name="Description" type="xs:string"/>
<xs:element name="UnitCost" type="xs:long"/>
<xs:element name="Quantity" type="xs:unsignedInt"/>
</xs:sequence>
</xs:complexType>
<xs:element name="Invoice">
<xs:complexType>
<xs:sequence>
<xs:element name="InvoiceNo" type="xs:unsignedInt"/>
<xs:element name="DeliveryAddress" type="AddressType"/>
<xs:element name="BillingAddress" type="AddressType" minOccurs="0"/>
<xs:element name="Item" type="ItemType" maxOccurs="unbounded"/>
<xs:element name="Payment">
<xs:complexType>
<xs:choice>
<xs:element name="VISA">
<xs:complexType>
<xs:attribute name="CardNo" type="xs:string" use="required"/>
<xs:attribute name="Expiry" type="xs:gYearMonth" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="Vouchers" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="VoucherNo" type="xs:unsignedLong" use="required"/>
<xs:attribute name="VoucherValue" type="xs:unsignedLong" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="Cash"/>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
|
![]() |
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "AddressType"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
'**********************************************************************************************
'* Copyright (c) 2001-2025 Liquid Technologies Limited. All rights reserved.
'* See www.liquid-technologies.com for product details.
'*
'* Please see products End User License Agreement for distribution permissions.
'*
'* WARNING: THIS FILE IS GENERATED
'* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten
'*
'* Generation : by Liquid XML Data Binder 19.0.14.11049
'* Using Schema: SimpleHierarchy.xsd
'**********************************************************************************************
Private m_ElementName As String
Private mvarForename As String
Private mvarSurname As String
Private mvarAddresLine1 As String
Private mvarAddresLine2 As String
Private mvarIsValidAddresLine3 As Boolean
Private mvarAddresLine3 As String
Private mvarIsValidAddresLine4 As Boolean
Private mvarAddresLine4 As String
Private mvarAddresLine5 As String
Private mvarPostCode As String
' ##HAND_CODED_BLOCK_START ID="Additional Variable Declarations"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
' Add Additional Variable Declarations...
' ##HAND_CODED_BLOCK_END ID="Additional Variable Declarations"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
Implements LtXmlComLib21.XmlObjectBase
Implements LtXmlComLib21.XmlGeneratedClass
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''' Properties '''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Property Get ElementName() As String
ElementName = m_elementName
End Property
' Summary:
' Represents a mandatory Element in the XML document
'
' Remarks:
'
' This property is represented as an Element in the XML.
' It is mandatory and therefore must be populated within the XML.
' It is defaulted to .
Public Property Get Forename As String
Forename = mvarForename
End Property
Public Property Let Forename(ByVal value As String)
' Apply whitespace rules appropriately
value = LtXmlComLib21.WhitespaceUtils.PreserveWhitespace(value)
mvarForename = value
End Property
' Summary:
' Represents a mandatory Element in the XML document
'
' Remarks:
'
' This property is represented as an Element in the XML.
' It is mandatory and therefore must be populated within the XML.
' It is defaulted to .
Public Property Get Surname As String
Surname = mvarSurname
End Property
Public Property Let Surname(ByVal value As String)
' Apply whitespace rules appropriately
value = LtXmlComLib21.WhitespaceUtils.PreserveWhitespace(value)
mvarSurname = value
End Property
' Summary:
' Represents a mandatory Element in the XML document
'
' Remarks:
'
' This property is represented as an Element in the XML.
' It is mandatory and therefore must be populated within the XML.
' It is defaulted to .
Public Property Get AddresLine1 As String
AddresLine1 = mvarAddresLine1
End Property
Public Property Let AddresLine1(ByVal value As String)
' Apply whitespace rules appropriately
value = LtXmlComLib21.WhitespaceUtils.PreserveWhitespace(value)
mvarAddresLine1 = value
End Property
' Summary:
' Represents a mandatory Element in the XML document
'
' Remarks:
'
' This property is represented as an Element in the XML.
' It is mandatory and therefore must be populated within the XML.
' It is defaulted to .
Public Property Get AddresLine2 As String
AddresLine2 = mvarAddresLine2
End Property
Public Property Let AddresLine2(ByVal value As String)
' Apply whitespace rules appropriately
value = LtXmlComLib21.WhitespaceUtils.PreserveWhitespace(value)
mvarAddresLine2 = value
End Property
' Summary:
' Represents an optional Element in the XML document
'
' Remarks:
'
' This property is represented as an Element in the XML.
' It is optional, initially it is not valid.
Public Property Get AddresLine3 As String
if mvarIsValidAddresLine3 = false then
Err.Raise ERR_INVALID_STATE, "AddressType.AddresLine3", "The Property AddresLine3 is not valid. Set AddresLine3Valid = true"
end if
AddresLine3 = mvarAddresLine3
End Property
Public Property Let AddresLine3(ByVal value As String)
' Apply whitespace rules appropriately
value = LtXmlComLib21.WhitespaceUtils.PreserveWhitespace(value)
mvarIsValidAddresLine3 = true
mvarAddresLine3 = value
End Property
' Summary:
' Indicates if AddresLine3 contains a valid value.
' Remarks:
' true if the value for AddresLine3 is valid, false if not.
' If this is set to true then the property is considered valid, and assigned its
' default value ().
' If its set to false then its made invalid, and subsequent calls to get AddresLine3
' will raise an exception.
Public Property Get IsValidAddresLine3 As Boolean
IsValidAddresLine3 = mvarIsValidAddresLine3
End Property
Public Property Let IsValidAddresLine3(ByVal value As Boolean)
if value <> mvarIsValidAddresLine3 then
mvarAddresLine3 = LtXmlComLib21.Conversions.stringFromString("", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Preserve)
mvarIsValidAddresLine3 = value
End if
End Property
' Summary:
' Represents an optional Element in the XML document
'
' Remarks:
'
' This property is represented as an Element in the XML.
' It is optional, initially it is not valid.
Public Property Get AddresLine4 As String
if mvarIsValidAddresLine4 = false then
Err.Raise ERR_INVALID_STATE, "AddressType.AddresLine4", "The Property AddresLine4 is not valid. Set AddresLine4Valid = true"
end if
AddresLine4 = mvarAddresLine4
End Property
Public Property Let AddresLine4(ByVal value As String)
' Apply whitespace rules appropriately
value = LtXmlComLib21.WhitespaceUtils.PreserveWhitespace(value)
mvarIsValidAddresLine4 = true
mvarAddresLine4 = value
End Property
' Summary:
' Indicates if AddresLine4 contains a valid value.
' Remarks:
' true if the value for AddresLine4 is valid, false if not.
' If this is set to true then the property is considered valid, and assigned its
' default value ().
' If its set to false then its made invalid, and subsequent calls to get AddresLine4
' will raise an exception.
Public Property Get IsValidAddresLine4 As Boolean
IsValidAddresLine4 = mvarIsValidAddresLine4
End Property
Public Property Let IsValidAddresLine4(ByVal value As Boolean)
if value <> mvarIsValidAddresLine4 then
mvarAddresLine4 = LtXmlComLib21.Conversions.stringFromString("", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Preserve)
mvarIsValidAddresLine4 = value
End if
End Property
' Summary:
' Represents a mandatory Element in the XML document
'
' Remarks:
'
' This property is represented as an Element in the XML.
' It is mandatory and therefore must be populated within the XML.
' It is defaulted to .
Public Property Get AddresLine5 As String
AddresLine5 = mvarAddresLine5
End Property
Public Property Let AddresLine5(ByVal value As String)
' Apply whitespace rules appropriately
value = LtXmlComLib21.WhitespaceUtils.PreserveWhitespace(value)
mvarAddresLine5 = value
End Property
' Summary:
' Represents a mandatory Element in the XML document
'
' Remarks:
'
' This property is represented as an Element in the XML.
' It is mandatory and therefore must be populated within the XML.
' It is defaulted to .
Public Property Get PostCode As String
PostCode = mvarPostCode
End Property
Public Property Let PostCode(ByVal value As String)
' Apply whitespace rules appropriately
value = LtXmlComLib21.WhitespaceUtils.PreserveWhitespace(value)
mvarPostCode = value
End Property
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''' Standard Methods '''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Sub ToXmlFile(ByVal FileName As String, Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib21.XmlFormatting = LtXmlComLib21.XmlFormatting_Indented, Optional encoding As LtXmlComLib21.XmlEncoding = LtXmlComLib21.XmlEncoding_UTF8, Optional EOL As LtXmlComLib21.EOLType = LtXmlComLib21.EOLType.EOLType_CRLF, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing)
RegisterProduct
LtXmlComLib21.XmlObjectBaseHelper.ToXmlFile Me, FileName, includeDocHeader, formatting, encoding, EOL, context
End Sub
Public Function ToXml(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib21.XmlFormatting = LtXmlComLib21.XmlFormatting_Indented, Optional EOL As LtXmlComLib21.EOLType = LtXmlComLib21.EOLType.EOLType_LF, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing) As String
RegisterProduct
ToXml = LtXmlComLib21.XmlObjectBaseHelper.ToXml(Me, includeDocHeader, formatting, EOL, context)
End Function
Public Function ToXmlStream(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib21.XmlFormatting = LtXmlComLib21.XmlFormatting_Indented, Optional encoding As LtXmlComLib21.XmlEncoding = LtXmlComLib21.XmlEncoding_UTF8, Optional EOL As LtXmlComLib21.EOLType = LtXmlComLib21.EOLType.EOLType_LF, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing) As Variant
RegisterProduct
ToXmlStream = LtXmlComLib21.XmlObjectBaseHelper.ToXmlStream(Me, includeDocHeader, formatting, encoding, EOL, context)
End Function
Public Sub FromXml(ByVal xmlIn As String, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing)
RegisterProduct
LtXmlComLib21.XmlObjectBaseHelper.FromXml Me, xmlIn, context
End Sub
Public Sub FromXmlFile(ByVal FileName As String, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing)
RegisterProduct
LtXmlComLib21.XmlObjectBaseHelper.FromXmlFile Me, FileName, context
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''' Private Methods ''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Summary:
' Constructor for AddressType
' Remarks:
' The class is created with all the mandatory fields populated with the
' default data.
' All Collection object are created.
' However any 1-n relationships (these are represented as collections) are
' empty. To comply with the schema these must be populated before the xml
' obtained from ToXml is valid against the schema SimpleHierarchy.xsd
Private Sub Class_Initialize()
m_elementName = "AddressType"
XmlGeneratedClass_Init
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''' Implementation of XmlObjectBase '''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub XmlObjectBase_PrivateSetElementName(ByVal vNewValue As String)
m_ElementName = vNewValue
End Sub
Private Property Get XmlObjectBase_ElementName() As String
XmlObjectBase_ElementName = m_ElementName
End Property
Private Property Get XmlObjectBase_TargetNamespace() As String
XmlObjectBase_TargetNamespace = ""
End Property
Private Function XmlObjectBase_IsSuitableSubstitution(ByVal InterfaceName As String) As Boolean
XmlObjectBase_IsSuitableSubstitution = false
if InterfaceName = "AddressType" _
then XmlObjectBase_IsSuitableSubstitution = true
End Function
Private Property Get XmlObjectBase_Namespace() As String
XmlObjectBase_Namespace = ""
End Property
Private Function XmlObjectBase_FromXmlInt(ByVal XMLParent As MSXML2.IXMLDOMElement, ByVal XMLChild As MSXML2.IXMLDOMElement, ByVal context As LtXmlComLib21.XmlSerializationContext, ByVal isOptionalChoice As Boolean) As MSXML2.IXMLDOMElement
Set XmlObjectBase_FromXmlInt = XmlGeneratedClassHelper.FromXml(Me, XMLParent, XMLChild, context, isOptionalChoice)
End Function
Private Sub XmlObjectBase_ToXmlInt(ByVal xmlOut As LtXmlComLib21.XmlTextWriter, ByVal bRegisterNamespaces As Boolean, ByVal NamespaceUri As String, ByVal context As LtXmlComLib21.XmlSerializationContext, ByVal isOptionalChoice As Boolean)
XmlGeneratedClassHelper.ToXml Me, xmlOut, bRegisterNamespaces, NamespaceUri, context, isOptionalChoice
End Sub
Private Sub XmlObjectBase_AttributesToXmlInt(ByVal xmlOut As LtXmlComLib21.XmlTextWriter, ByVal context As LtXmlComLib21.XmlSerializationContext)
XmlGeneratedClassHelper.AttributesToXml Me, xmlOut, context
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''' Implementation of XmlGeneratedClass '''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Summary:
' Initializes the class
' Remarks:
' The Creates all the mandatory fields (populated with the default data)
' All Collection object are created.
' However any 1-n relationships (these are represented as collections) are
' empty. To comply with the schema these must be populated before the xml
' obtained from ToXml is valid against the schema SimpleHierarchy.xsd.
Private Sub XmlGeneratedClass_Init()
mvarForename = LtXmlComLib21.Conversions.stringFromString("", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Preserve)
mvarSurname = LtXmlComLib21.Conversions.stringFromString("", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Preserve)
mvarAddresLine1 = LtXmlComLib21.Conversions.stringFromString("", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Preserve)
mvarAddresLine2 = LtXmlComLib21.Conversions.stringFromString("", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Preserve)
mvarAddresLine3 = LtXmlComLib21.Conversions.stringFromString("", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Preserve)
mvarIsValidAddresLine3 = false
mvarAddresLine4 = LtXmlComLib21.Conversions.stringFromString("", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Preserve)
mvarIsValidAddresLine4 = false
mvarAddresLine5 = LtXmlComLib21.Conversions.stringFromString("", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Preserve)
mvarPostCode = LtXmlComLib21.Conversions.stringFromString("", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Preserve)
' Force Init ClassInfo
Dim classInfo As LtXmlComLib21.ClassInfo
Set classInfo = XmlGeneratedClass_ClassInfo
' ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
' Add Additional Init Settings...
' ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
End Sub
Private Property Get XmlGeneratedClass_ClassInfo() As LtXmlComLib21.ClassInfo
If g_ClsDataAddressType Is Nothing Then
Set g_ClsDataAddressType = New LtXmlComLib21.ClassInfo
g_ClsDataAddressType.GroupType = LtXmlComLib21.XmlGroupType.Sequence
g_ClsDataAddressType.ElementType = LtXmlComLib21.XmlElementType.Element
g_ClsDataAddressType.ElementName = "AddressType"
g_ClsDataAddressType.ElementNamespaceURI = ""
g_ClsDataAddressType.FromXmlFailIfAttributeUnknown = true
g_ClsDataAddressType.IsClassDerived = false
g_ClsDataAddressType.PrimitiveDataType = LtXmlComLib21.XmlDataType.type_none
g_ClsDataAddressType.PrimitiveFormatOverride = ""
g_ClsDataAddressType.OutputPrimitiveClassAsTextProperty = False
Set g_ClsDataAddressType.ClassFactory = General.CF
g_ClsDataAddressType.AddElmSeqPrimMnd "Forename", "", "Forename", XmlDataType.type_string, "", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Preserve, "", -1, -1, "", "", "", "", -1
g_ClsDataAddressType.AddElmSeqPrimMnd "Surname", "", "Surname", XmlDataType.type_string, "", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Preserve, "", -1, -1, "", "", "", "", -1
g_ClsDataAddressType.AddElmSeqPrimMnd "AddresLine1", "", "AddresLine1", XmlDataType.type_string, "", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Preserve, "", -1, -1, "", "", "", "", -1
g_ClsDataAddressType.AddElmSeqPrimMnd "AddresLine2", "", "AddresLine2", XmlDataType.type_string, "", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Preserve, "", -1, -1, "", "", "", "", -1
g_ClsDataAddressType.AddElmSeqPrimOpt "AddresLine3", "", "AddresLine3", "IsValidAddresLine3", XmlDataType.type_string, "", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Preserve, "", -1, -1, "", "", "", "", -1
g_ClsDataAddressType.AddElmSeqPrimOpt "AddresLine4", "", "AddresLine4", "IsValidAddresLine4", XmlDataType.type_string, "", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Preserve, "", -1, -1, "", "", "", "", -1
g_ClsDataAddressType.AddElmSeqPrimMnd "AddresLine5", "", "AddresLine5", XmlDataType.type_string, "", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Preserve, "", -1, -1, "", "", "", "", -1
g_ClsDataAddressType.AddElmSeqPrimMnd "PostCode", "", "PostCode", XmlDataType.type_string, "", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Preserve, "", -1, -1, "", "", "", "", -1
End If
Set XmlGeneratedClass_ClassInfo = g_ClsDataAddressType
End Property
' ##HAND_CODED_BLOCK_START ID="Additional Methods/Properties"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
' Add Additional Methods/Properties Here...
' ##HAND_CODED_BLOCK_END ID="Additional Methods/Properties"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
|
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "Invoice"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
'**********************************************************************************************
'* Copyright (c) 2001-2025 Liquid Technologies Limited. All rights reserved.
'* See www.liquid-technologies.com for product details.
'*
'* Please see products End User License Agreement for distribution permissions.
'*
'* WARNING: THIS FILE IS GENERATED
'* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten
'*
'* Generation : by Liquid XML Data Binder 19.0.14.11049
'* Using Schema: SimpleHierarchy.xsd
'**********************************************************************************************
Private m_ElementName As String
Private mvarInvoiceNo As Long
Private mvarDeliveryAddress As SimpleHiarchyLib.AddressType
Private mvarBillingAddress As SimpleHiarchyLib.AddressType
Private WithEvents mvarItem As SimpleHiarchyLib.ItemTypeCol
Private mvarPayment As SimpleHiarchyLib.Payment
' ##HAND_CODED_BLOCK_START ID="Additional Variable Declarations"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
' Add Additional Variable Declarations...
' ##HAND_CODED_BLOCK_END ID="Additional Variable Declarations"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
Implements LtXmlComLib21.XmlObjectBase
Implements LtXmlComLib21.XmlGeneratedClass
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''' Properties '''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Property Get ElementName() As String
ElementName = m_elementName
End Property
' Summary:
' Represents a mandatory Element in the XML document
'
' Remarks:
'
' This property is represented as an Element in the XML.
' It is mandatory and therefore must be populated within the XML.
' It is defaulted to 0.
Public Property Get InvoiceNo As Long
InvoiceNo = mvarInvoiceNo
End Property
Public Property Let InvoiceNo(ByVal value As Long)
mvarInvoiceNo = value
End Property
' Summary:
' Represents a mandatory Element in the XML document
'
' Remarks:
'
' This property is represented as an Element in the XML.
' It is mandatory and therefore must be populated within the XML.
' If this property is set, then the object will be COPIED. If the property is set to null an exception is raised.
Public Property Get DeliveryAddress As SimpleHiarchyLib.AddressType
Set DeliveryAddress = mvarDeliveryAddress
End Property
Public Property Set DeliveryAddress(Byval value As SimpleHiarchyLib.AddressType)
LtXmlComLib21.XmlObjectBaseHelper.Throw_IfPropertyIsNull value, "DeliveryAddress"
if not value is nothing then
CastToXmlObjectBase(value).PrivateSetElementName "DeliveryAddress"
end if
' LtXmlComLib21.XmlObjectBaseHelper.Throw_IfElementNameDiffers value, "DeliveryAddress"
Set mvarDeliveryAddress = value
End Property
' Summary:
' Represents an optional Element in the XML document
'
' Remarks:
'
' This property is represented as an Element in the XML.
' It is optional, initially it is null.
Public Property Get BillingAddress As SimpleHiarchyLib.AddressType
Set BillingAddress = mvarBillingAddress
End Property
Public Property Set BillingAddress(ByVal value As SimpleHiarchyLib.AddressType)
if value is Nothing then
Set mvarBillingAddress = Nothing
else
CastToXmlObjectBase(value).PrivateSetElementName "BillingAddress"
' LtXmlComLib21.XmlObjectBaseHelper.Throw_IfElementNameDiffers value, "BillingAddress"
Set mvarBillingAddress = value
End If
End Property
' Summary:
' A collection of Items
'
' Remarks:
'
' This property is represented as an Element in the XML.
' This collection may contain 1 to Many objects.
Public Property Get Item As SimpleHiarchyLib.ItemTypeCol
Set Item = mvarItem
End Property
' Summary:
' Represents a mandatory Element in the XML document
'
' Remarks:
'
' This property is represented as an Element in the XML.
' It is mandatory and therefore must be populated within the XML.
' If this property is set, then the object will be COPIED. If the property is set to null an exception is raised.
Public Property Get Payment As SimpleHiarchyLib.Payment
Set Payment = mvarPayment
End Property
Public Property Set Payment(Byval value As SimpleHiarchyLib.Payment)
LtXmlComLib21.XmlObjectBaseHelper.Throw_IfPropertyIsNull value, "Payment"
if not value is nothing then
CastToXmlObjectBase(value).PrivateSetElementName "Payment"
end if
' LtXmlComLib21.XmlObjectBaseHelper.Throw_IfElementNameDiffers value, "Payment"
Set mvarPayment = value
End Property
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''' Standard Methods '''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Sub ToXmlFile(ByVal FileName As String, Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib21.XmlFormatting = LtXmlComLib21.XmlFormatting_Indented, Optional encoding As LtXmlComLib21.XmlEncoding = LtXmlComLib21.XmlEncoding_UTF8, Optional EOL As LtXmlComLib21.EOLType = LtXmlComLib21.EOLType.EOLType_CRLF, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing)
RegisterProduct
LtXmlComLib21.XmlObjectBaseHelper.ToXmlFile Me, FileName, includeDocHeader, formatting, encoding, EOL, context
End Sub
Public Function ToXml(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib21.XmlFormatting = LtXmlComLib21.XmlFormatting_Indented, Optional EOL As LtXmlComLib21.EOLType = LtXmlComLib21.EOLType.EOLType_LF, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing) As String
RegisterProduct
ToXml = LtXmlComLib21.XmlObjectBaseHelper.ToXml(Me, includeDocHeader, formatting, EOL, context)
End Function
Public Function ToXmlStream(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib21.XmlFormatting = LtXmlComLib21.XmlFormatting_Indented, Optional encoding As LtXmlComLib21.XmlEncoding = LtXmlComLib21.XmlEncoding_UTF8, Optional EOL As LtXmlComLib21.EOLType = LtXmlComLib21.EOLType.EOLType_LF, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing) As Variant
RegisterProduct
ToXmlStream = LtXmlComLib21.XmlObjectBaseHelper.ToXmlStream(Me, includeDocHeader, formatting, encoding, EOL, context)
End Function
Public Sub FromXml(ByVal xmlIn As String, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing)
RegisterProduct
LtXmlComLib21.XmlObjectBaseHelper.FromXml Me, xmlIn, context
End Sub
Public Sub FromXmlFile(ByVal FileName As String, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing)
RegisterProduct
LtXmlComLib21.XmlObjectBaseHelper.FromXmlFile Me, FileName, context
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''' Private Methods ''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Summary:
' Constructor for Invoice
' Remarks:
' The class is created with all the mandatory fields populated with the
' default data.
' All Collection object are created.
' However any 1-n relationships (these are represented as collections) are
' empty. To comply with the schema these must be populated before the xml
' obtained from ToXml is valid against the schema SimpleHierarchy.xsd
Private Sub Class_Initialize()
m_elementName = "Invoice"
XmlGeneratedClass_Init
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''' Implementation of XmlObjectBase '''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub XmlObjectBase_PrivateSetElementName(ByVal vNewValue As String)
m_ElementName = vNewValue
End Sub
Private Property Get XmlObjectBase_ElementName() As String
XmlObjectBase_ElementName = m_ElementName
End Property
Private Property Get XmlObjectBase_TargetNamespace() As String
XmlObjectBase_TargetNamespace = ""
End Property
Private Function XmlObjectBase_IsSuitableSubstitution(ByVal InterfaceName As String) As Boolean
XmlObjectBase_IsSuitableSubstitution = false
if InterfaceName = "Invoice" _
then XmlObjectBase_IsSuitableSubstitution = true
End Function
Private Property Get XmlObjectBase_Namespace() As String
XmlObjectBase_Namespace = ""
End Property
Private Function XmlObjectBase_FromXmlInt(ByVal XMLParent As MSXML2.IXMLDOMElement, ByVal XMLChild As MSXML2.IXMLDOMElement, ByVal context As LtXmlComLib21.XmlSerializationContext, ByVal isOptionalChoice As Boolean) As MSXML2.IXMLDOMElement
Set XmlObjectBase_FromXmlInt = XmlGeneratedClassHelper.FromXml(Me, XMLParent, XMLChild, context, isOptionalChoice)
End Function
Private Sub XmlObjectBase_ToXmlInt(ByVal xmlOut As LtXmlComLib21.XmlTextWriter, ByVal bRegisterNamespaces As Boolean, ByVal NamespaceUri As String, ByVal context As LtXmlComLib21.XmlSerializationContext, ByVal isOptionalChoice As Boolean)
XmlGeneratedClassHelper.ToXml Me, xmlOut, bRegisterNamespaces, NamespaceUri, context, isOptionalChoice
End Sub
Private Sub XmlObjectBase_AttributesToXmlInt(ByVal xmlOut As LtXmlComLib21.XmlTextWriter, ByVal context As LtXmlComLib21.XmlSerializationContext)
XmlGeneratedClassHelper.AttributesToXml Me, xmlOut, context
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''' Implementation of XmlGeneratedClass '''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Summary:
' Initializes the class
' Remarks:
' The Creates all the mandatory fields (populated with the default data)
' All Collection object are created.
' However any 1-n relationships (these are represented as collections) are
' empty. To comply with the schema these must be populated before the xml
' obtained from ToXml is valid against the schema SimpleHierarchy.xsd.
Private Sub XmlGeneratedClass_Init()
mvarInvoiceNo = LtXmlComLib21.Conversions.ui4FromString("0", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Collapse)
Set mvarDeliveryAddress = CF.CreateNamedClass(ClsName_AddressType, "DeliveryAddress")
Set mvarBillingAddress = Nothing
Set mvarItem = CF.CreateClassCollection(ClsName_ItemTypeCol, "Item", "", 1, -1)
Set mvarPayment = CF.CreateNamedClass(ClsName_Payment, "Payment")
' Force Init ClassInfo
Dim classInfo As LtXmlComLib21.ClassInfo
Set classInfo = XmlGeneratedClass_ClassInfo
' ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
' Add Additional Init Settings...
' ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
End Sub
Private Property Get XmlGeneratedClass_ClassInfo() As LtXmlComLib21.ClassInfo
If g_ClsDataInvoice Is Nothing Then
Set g_ClsDataInvoice = New LtXmlComLib21.ClassInfo
g_ClsDataInvoice.GroupType = LtXmlComLib21.XmlGroupType.Sequence
g_ClsDataInvoice.ElementType = LtXmlComLib21.XmlElementType.Element
g_ClsDataInvoice.ElementName = "Invoice"
g_ClsDataInvoice.ElementNamespaceURI = ""
g_ClsDataInvoice.FromXmlFailIfAttributeUnknown = true
g_ClsDataInvoice.IsClassDerived = false
g_ClsDataInvoice.PrimitiveDataType = LtXmlComLib21.XmlDataType.type_none
g_ClsDataInvoice.PrimitiveFormatOverride = ""
g_ClsDataInvoice.OutputPrimitiveClassAsTextProperty = False
Set g_ClsDataInvoice.ClassFactory = General.CF
g_ClsDataInvoice.AddElmSeqPrimMnd "InvoiceNo", "", "InvoiceNo", XmlDataType.type_ui4, "", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Collapse, "", -1, -1, "", "", "", "", -1
g_ClsDataInvoice.AddElmSeqClsMnd "DeliveryAddress", "", "DeliveryAddress", LtXmlComLib21.XmlElementType.Element, true
g_ClsDataInvoice.AddElmSeqClsOpt "BillingAddress", "", "BillingAddress", LtXmlComLib21.XmlElementType.Element, ClsName_AddressType
g_ClsDataInvoice.AddElmSeqClsCol "Item", "", "Item", LtXmlComLib21.XmlElementType.Element
g_ClsDataInvoice.AddElmSeqClsMnd "Payment", "", "Payment", LtXmlComLib21.XmlElementType.Element, true
End If
Set XmlGeneratedClass_ClassInfo = g_ClsDataInvoice
End Property
' ##HAND_CODED_BLOCK_START ID="Additional Methods/Properties"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
' Add Additional Methods/Properties Here...
' ##HAND_CODED_BLOCK_END ID="Additional Methods/Properties"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
|
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "Payment"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
'**********************************************************************************************
'* Copyright (c) 2001-2025 Liquid Technologies Limited. All rights reserved.
'* See www.liquid-technologies.com for product details.
'*
'* Please see products End User License Agreement for distribution permissions.
'*
'* WARNING: THIS FILE IS GENERATED
'* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten
'*
'* Generation : by Liquid XML Data Binder 19.0.14.11049
'* Using Schema: SimpleHierarchy.xsd
'**********************************************************************************************
Private m_ElementName As String
Private m_validElement As String
Private mvarVISA As SimpleHiarchyLib.VISA
Private WithEvents mvarVouchers As SimpleHiarchyLib.VouchersCol
Private mvarCash As LtXmlComLib21.Element
' ##HAND_CODED_BLOCK_START ID="Additional Variable Declarations"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
' Add Additional Variable Declarations...
' ##HAND_CODED_BLOCK_END ID="Additional Variable Declarations"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
Implements LtXmlComLib21.XmlObjectBase
Implements LtXmlComLib21.XmlGeneratedClass
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''' Properties '''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Property Get ElementName() As String
ElementName = m_elementName
End Property
' Summary:
' Represents an optional Element in the XML document
'
' Remarks:
'
' This property is represented as an Element in the XML.
' It is optional, initially it is null.
' Only one Element within this class may be set at a time, setting this property when another element is already set will raise an exception. setting this property to null will allow another element to be selected
Public Property Get VISA As SimpleHiarchyLib.VISA
Set VISA = mvarVISA
End Property
Public Property Set VISA(ByVal value As SimpleHiarchyLib.VISA)
' Ensure only on element is populated at a time
ClearChoice "VISA" ' remove selection
if value is Nothing then
Set mvarVISA = Nothing
else
CastToXmlObjectBase(value).PrivateSetElementName "VISA"
' LtXmlComLib21.XmlObjectBaseHelper.Throw_IfElementNameDiffers value, "VISA"
Set mvarVISA = value
End If
End Property
' Summary:
' A collection of Voucherss
'
' Remarks:
'
' This property is represented as an Element in the XML.
' This collection may contain 1 to Many objects.
' Only one Element within this class may be set at a time. This collection (as a whole is counted as an element) may contain 0 or 1 to Many entries. Emptying the collection allows a different element to be the selected one. If there is already a selected element, and an item is added to this collection then an exception will be raised
Public Property Get Vouchers As SimpleHiarchyLib.VouchersCol
Set Vouchers = mvarVouchers
End Property
' gets called when the collection changes (allows us to determine if this choice is selected or not)
Private Sub mvarVouchers_OnCollectionChange()
' The class represents a choice, so prevent more than one element from being selected
if m_validElement <> "Vouchers" then
ClearChoice IIf(mvarVouchers.Count = 0,"","Vouchers") ' remove selection
end if
LtXmlComLib21.XmlObjectBaseHelper.Choice_CollectionChanged "Vouchers", mvarVouchers.Count, m_validElement
End Sub
' Summary:
' Represents an optional untyped element in the XML document
'
' Remarks:
'
' It is optional, initially it is null.
' Only one Element within this class may be set at a time, setting this property when another element is already set will raise an exception. setting this property to null will allow another element to be selected
Public Property Get Cash As LtXmlComLib21.Element
Set Cash = mvarCash
End Property
Public Property Set Cash(ByVal value As LtXmlComLib21.Element)
ClearChoice "Cash" ' remove selection
LtXmlComLib21.XmlObjectBaseHelper.Throw_IfPropertyIsNull value, "Cash"
LtXmlComLib21.XmlObjectBaseHelper.TestNamespace value.Namespace, "##any", ""
Set mvarCash = value
End Property
Public Property Get ChoiceSelectedElement As String
ChoiceSelectedElement = m_validElement
End Property
friend Property Let ChoiceSelectedElement (ByVal value As String)
m_validElement = value
End Property
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''' Standard Methods '''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Sub ToXmlFile(ByVal FileName As String, Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib21.XmlFormatting = LtXmlComLib21.XmlFormatting_Indented, Optional encoding As LtXmlComLib21.XmlEncoding = LtXmlComLib21.XmlEncoding_UTF8, Optional EOL As LtXmlComLib21.EOLType = LtXmlComLib21.EOLType.EOLType_CRLF, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing)
RegisterProduct
LtXmlComLib21.XmlObjectBaseHelper.ToXmlFile Me, FileName, includeDocHeader, formatting, encoding, EOL, context
End Sub
Public Function ToXml(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib21.XmlFormatting = LtXmlComLib21.XmlFormatting_Indented, Optional EOL As LtXmlComLib21.EOLType = LtXmlComLib21.EOLType.EOLType_LF, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing) As String
RegisterProduct
ToXml = LtXmlComLib21.XmlObjectBaseHelper.ToXml(Me, includeDocHeader, formatting, EOL, context)
End Function
Public Function ToXmlStream(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib21.XmlFormatting = LtXmlComLib21.XmlFormatting_Indented, Optional encoding As LtXmlComLib21.XmlEncoding = LtXmlComLib21.XmlEncoding_UTF8, Optional EOL As LtXmlComLib21.EOLType = LtXmlComLib21.EOLType.EOLType_LF, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing) As Variant
RegisterProduct
ToXmlStream = LtXmlComLib21.XmlObjectBaseHelper.ToXmlStream(Me, includeDocHeader, formatting, encoding, EOL, context)
End Function
Public Sub FromXml(ByVal xmlIn As String, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing)
RegisterProduct
LtXmlComLib21.XmlObjectBaseHelper.FromXml Me, xmlIn, context
End Sub
Public Sub FromXmlFile(ByVal FileName As String, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing)
RegisterProduct
LtXmlComLib21.XmlObjectBaseHelper.FromXmlFile Me, FileName, context
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''' Private Methods ''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Summary:
' Constructor for Payment
' Remarks:
' The class is created with all the mandatory fields populated with the
' default data.
' All Collection object are created.
' However any 1-n relationships (these are represented as collections) are
' empty. To comply with the schema these must be populated before the xml
' obtained from ToXml is valid against the schema SimpleHierarchy.xsd
Private Sub Class_Initialize()
m_elementName = "Payment"
XmlGeneratedClass_Init
End Sub
' Summary:
' Selects the given element as the selected choice
Private Sub ClearChoice(ByVal SelectedElement as String)
Set mvarVISA = Nothing
if not mvarVouchers is nothing then
if "Vouchers" <> SelectedElement then
mvarVouchers.Clear
end if
end if
Set mvarCash = Nothing
m_validElement = selectedElement
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''' Implementation of XmlObjectBase '''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub XmlObjectBase_PrivateSetElementName(ByVal vNewValue As String)
m_ElementName = vNewValue
End Sub
Private Property Get XmlObjectBase_ElementName() As String
XmlObjectBase_ElementName = m_ElementName
End Property
Private Property Get XmlObjectBase_TargetNamespace() As String
XmlObjectBase_TargetNamespace = ""
End Property
Private Function XmlObjectBase_IsSuitableSubstitution(ByVal InterfaceName As String) As Boolean
XmlObjectBase_IsSuitableSubstitution = false
if InterfaceName = "Payment" _
then XmlObjectBase_IsSuitableSubstitution = true
End Function
Private Property Get XmlObjectBase_Namespace() As String
XmlObjectBase_Namespace = ""
End Property
Private Function XmlObjectBase_FromXmlInt(ByVal XMLParent As MSXML2.IXMLDOMElement, ByVal XMLChild As MSXML2.IXMLDOMElement, ByVal context As LtXmlComLib21.XmlSerializationContext, ByVal isOptionalChoice As Boolean) As MSXML2.IXMLDOMElement
Set XmlObjectBase_FromXmlInt = XmlGeneratedClassHelper.FromXml(Me, XMLParent, XMLChild, context, isOptionalChoice)
End Function
Private Sub XmlObjectBase_ToXmlInt(ByVal xmlOut As LtXmlComLib21.XmlTextWriter, ByVal bRegisterNamespaces As Boolean, ByVal NamespaceUri As String, ByVal context As LtXmlComLib21.XmlSerializationContext, ByVal isOptionalChoice As Boolean)
XmlGeneratedClassHelper.ToXml Me, xmlOut, bRegisterNamespaces, NamespaceUri, context, isOptionalChoice
End Sub
Private Sub XmlObjectBase_AttributesToXmlInt(ByVal xmlOut As LtXmlComLib21.XmlTextWriter, ByVal context As LtXmlComLib21.XmlSerializationContext)
XmlGeneratedClassHelper.AttributesToXml Me, xmlOut, context
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''' Implementation of XmlGeneratedClass '''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Summary:
' Initializes the class
' Remarks:
' The Creates all the mandatory fields (populated with the default data)
' All Collection object are created.
' However any 1-n relationships (these are represented as collections) are
' empty. To comply with the schema these must be populated before the xml
' obtained from ToXml is valid against the schema SimpleHierarchy.xsd.
Private Sub XmlGeneratedClass_Init()
Set mvarVISA = Nothing
Set mvarVouchers = CF.CreateClassCollection(ClsName_VouchersCol, "Vouchers", "", 1, -1)
Set mvarCash = Nothing
m_validElement = ""
' Force Init ClassInfo
Dim classInfo As LtXmlComLib21.ClassInfo
Set classInfo = XmlGeneratedClass_ClassInfo
' ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
' Add Additional Init Settings...
' ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
End Sub
Private Property Get XmlGeneratedClass_ClassInfo() As LtXmlComLib21.ClassInfo
If g_ClsDataPayment Is Nothing Then
Set g_ClsDataPayment = New LtXmlComLib21.ClassInfo
g_ClsDataPayment.GroupType = LtXmlComLib21.XmlGroupType.Choice
g_ClsDataPayment.ElementType = LtXmlComLib21.XmlElementType.Element
g_ClsDataPayment.ElementName = "Payment"
g_ClsDataPayment.ElementNamespaceURI = ""
g_ClsDataPayment.FromXmlFailIfAttributeUnknown = true
g_ClsDataPayment.IsClassDerived = false
g_ClsDataPayment.PrimitiveDataType = LtXmlComLib21.XmlDataType.type_none
g_ClsDataPayment.PrimitiveFormatOverride = ""
g_ClsDataPayment.OutputPrimitiveClassAsTextProperty = False
Set g_ClsDataPayment.ClassFactory = General.CF
g_ClsDataPayment.AddElmChoiceClsOpt "VISA", "", "VISA", LtXmlComLib21.XmlElementType.Element, ClsName_VISA
g_ClsDataPayment.AddElmChoiceClsCol "Vouchers", "", "Vouchers", LtXmlComLib21.XmlElementType.Element
g_ClsDataPayment.AddElmChoiceUntpdOpt "Cash", "", "Cash", "##any", ""
End If
Set XmlGeneratedClass_ClassInfo = g_ClsDataPayment
End Property
' ##HAND_CODED_BLOCK_START ID="Additional Methods/Properties"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
' Add Additional Methods/Properties Here...
' ##HAND_CODED_BLOCK_END ID="Additional Methods/Properties"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
|
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "VISA"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
'**********************************************************************************************
'* Copyright (c) 2001-2025 Liquid Technologies Limited. All rights reserved.
'* See www.liquid-technologies.com for product details.
'*
'* Please see products End User License Agreement for distribution permissions.
'*
'* WARNING: THIS FILE IS GENERATED
'* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten
'*
'* Generation : by Liquid XML Data Binder 19.0.14.11049
'* Using Schema: SimpleHierarchy.xsd
'**********************************************************************************************
Private m_ElementName As String
Private mvarCardNo As String
Private mvarExpiry As LtXmlComLib21.DateTime
' ##HAND_CODED_BLOCK_START ID="Additional Variable Declarations"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
' Add Additional Variable Declarations...
' ##HAND_CODED_BLOCK_END ID="Additional Variable Declarations"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
Implements LtXmlComLib21.XmlObjectBase
Implements LtXmlComLib21.XmlGeneratedClass
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''' Properties '''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Property Get ElementName() As String
ElementName = m_elementName
End Property
' Summary:
' Represents a mandatory Attribute in the XML document
'
' Remarks:
'
' This property is represented as an Attribute in the XML.
' It is mandatory and therefore must be populated within the XML.
' It is defaulted to .
Public Property Get CardNo As String
CardNo = mvarCardNo
End Property
Public Property Let CardNo(ByVal value As String)
' Apply whitespace rules appropriately
value = LtXmlComLib21.WhitespaceUtils.PreserveWhitespace(value)
mvarCardNo = value
End Property
' Summary:
' Represents a mandatory Attribute in the XML document
'
' Remarks:
'
' This property is represented as an Attribute in the XML.
' It is mandatory and therefore must be populated within the XML.
' It is defaulted to 1900-01.
Public Property Get Expiry As LtXmlComLib21.DateTime
Set Expiry = mvarExpiry
End Property
Public Property Set Expiry(ByVal value As LtXmlComLib21.DateTime)
mvarExpiry.SetDateTimeWithType value, mvarExpiry.dateType
End Property
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''' Standard Methods '''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Sub ToXmlFile(ByVal FileName As String, Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib21.XmlFormatting = LtXmlComLib21.XmlFormatting_Indented, Optional encoding As LtXmlComLib21.XmlEncoding = LtXmlComLib21.XmlEncoding_UTF8, Optional EOL As LtXmlComLib21.EOLType = LtXmlComLib21.EOLType.EOLType_CRLF, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing)
RegisterProduct
LtXmlComLib21.XmlObjectBaseHelper.ToXmlFile Me, FileName, includeDocHeader, formatting, encoding, EOL, context
End Sub
Public Function ToXml(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib21.XmlFormatting = LtXmlComLib21.XmlFormatting_Indented, Optional EOL As LtXmlComLib21.EOLType = LtXmlComLib21.EOLType.EOLType_LF, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing) As String
RegisterProduct
ToXml = LtXmlComLib21.XmlObjectBaseHelper.ToXml(Me, includeDocHeader, formatting, EOL, context)
End Function
Public Function ToXmlStream(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib21.XmlFormatting = LtXmlComLib21.XmlFormatting_Indented, Optional encoding As LtXmlComLib21.XmlEncoding = LtXmlComLib21.XmlEncoding_UTF8, Optional EOL As LtXmlComLib21.EOLType = LtXmlComLib21.EOLType.EOLType_LF, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing) As Variant
RegisterProduct
ToXmlStream = LtXmlComLib21.XmlObjectBaseHelper.ToXmlStream(Me, includeDocHeader, formatting, encoding, EOL, context)
End Function
Public Sub FromXml(ByVal xmlIn As String, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing)
RegisterProduct
LtXmlComLib21.XmlObjectBaseHelper.FromXml Me, xmlIn, context
End Sub
Public Sub FromXmlFile(ByVal FileName As String, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing)
RegisterProduct
LtXmlComLib21.XmlObjectBaseHelper.FromXmlFile Me, FileName, context
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''' Private Methods ''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Summary:
' Constructor for VISA
' Remarks:
' The class is created with all the mandatory fields populated with the
' default data.
' All Collection object are created.
' However any 1-n relationships (these are represented as collections) are
' empty. To comply with the schema these must be populated before the xml
' obtained from ToXml is valid against the schema SimpleHierarchy.xsd
Private Sub Class_Initialize()
m_elementName = "VISA"
XmlGeneratedClass_Init
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''' Implementation of XmlObjectBase '''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub XmlObjectBase_PrivateSetElementName(ByVal vNewValue As String)
m_ElementName = vNewValue
End Sub
Private Property Get XmlObjectBase_ElementName() As String
XmlObjectBase_ElementName = m_ElementName
End Property
Private Property Get XmlObjectBase_TargetNamespace() As String
XmlObjectBase_TargetNamespace = ""
End Property
Private Function XmlObjectBase_IsSuitableSubstitution(ByVal InterfaceName As String) As Boolean
XmlObjectBase_IsSuitableSubstitution = false
if InterfaceName = "VISA" _
then XmlObjectBase_IsSuitableSubstitution = true
End Function
Private Property Get XmlObjectBase_Namespace() As String
XmlObjectBase_Namespace = ""
End Property
Private Function XmlObjectBase_FromXmlInt(ByVal XMLParent As MSXML2.IXMLDOMElement, ByVal XMLChild As MSXML2.IXMLDOMElement, ByVal context As LtXmlComLib21.XmlSerializationContext, ByVal isOptionalChoice As Boolean) As MSXML2.IXMLDOMElement
Set XmlObjectBase_FromXmlInt = XmlGeneratedClassHelper.FromXml(Me, XMLParent, XMLChild, context, isOptionalChoice)
End Function
Private Sub XmlObjectBase_ToXmlInt(ByVal xmlOut As LtXmlComLib21.XmlTextWriter, ByVal bRegisterNamespaces As Boolean, ByVal NamespaceUri As String, ByVal context As LtXmlComLib21.XmlSerializationContext, ByVal isOptionalChoice As Boolean)
XmlGeneratedClassHelper.ToXml Me, xmlOut, bRegisterNamespaces, NamespaceUri, context, isOptionalChoice
End Sub
Private Sub XmlObjectBase_AttributesToXmlInt(ByVal xmlOut As LtXmlComLib21.XmlTextWriter, ByVal context As LtXmlComLib21.XmlSerializationContext)
XmlGeneratedClassHelper.AttributesToXml Me, xmlOut, context
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''' Implementation of XmlGeneratedClass '''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Summary:
' Initializes the class
' Remarks:
' The Creates all the mandatory fields (populated with the default data)
' All Collection object are created.
' However any 1-n relationships (these are represented as collections) are
' empty. To comply with the schema these must be populated before the xml
' obtained from ToXml is valid against the schema SimpleHierarchy.xsd.
Private Sub XmlGeneratedClass_Init()
mvarCardNo = LtXmlComLib21.Conversions.stringFromString("", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Preserve)
Set mvarExpiry = LtXmlComLib21.Conversions.yearMonthFromString("1900-01", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Collapse)
' Force Init ClassInfo
Dim classInfo As LtXmlComLib21.ClassInfo
Set classInfo = XmlGeneratedClass_ClassInfo
' ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
' Add Additional Init Settings...
' ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
End Sub
Private Property Get XmlGeneratedClass_ClassInfo() As LtXmlComLib21.ClassInfo
If g_ClsDataVISA Is Nothing Then
Set g_ClsDataVISA = New LtXmlComLib21.ClassInfo
g_ClsDataVISA.GroupType = LtXmlComLib21.XmlGroupType.Sequence
g_ClsDataVISA.ElementType = LtXmlComLib21.XmlElementType.Element
g_ClsDataVISA.ElementName = "VISA"
g_ClsDataVISA.ElementNamespaceURI = ""
g_ClsDataVISA.FromXmlFailIfAttributeUnknown = true
g_ClsDataVISA.IsClassDerived = false
g_ClsDataVISA.PrimitiveDataType = LtXmlComLib21.XmlDataType.type_none
g_ClsDataVISA.PrimitiveFormatOverride = ""
g_ClsDataVISA.OutputPrimitiveClassAsTextProperty = False
Set g_ClsDataVISA.ClassFactory = General.CF
g_ClsDataVISA.AddAttrPrimitive "CardNo", "", "CardNo", "", false, XmlDataType.type_string, "", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Preserve, "", -1, -1, "", "", "", "", -1, vbNullString
g_ClsDataVISA.AddAttrPrimitive "Expiry", "", "Expiry", "", false, XmlDataType.type_yearMonth, "", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Collapse, "", -1, -1, "", "", "", "", -1, vbNullString
End If
Set XmlGeneratedClass_ClassInfo = g_ClsDataVISA
End Property
' ##HAND_CODED_BLOCK_START ID="Additional Methods/Properties"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
' Add Additional Methods/Properties Here...
' ##HAND_CODED_BLOCK_END ID="Additional Methods/Properties"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
|
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "Vouchers"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
'**********************************************************************************************
'* Copyright (c) 2001-2025 Liquid Technologies Limited. All rights reserved.
'* See www.liquid-technologies.com for product details.
'*
'* Please see products End User License Agreement for distribution permissions.
'*
'* WARNING: THIS FILE IS GENERATED
'* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten
'*
'* Generation : by Liquid XML Data Binder 19.0.14.11049
'* Using Schema: SimpleHierarchy.xsd
'**********************************************************************************************
Private m_ElementName As String
Private mvarVoucherNo As Long
Private mvarVoucherValue As Long
' ##HAND_CODED_BLOCK_START ID="Additional Variable Declarations"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
' Add Additional Variable Declarations...
' ##HAND_CODED_BLOCK_END ID="Additional Variable Declarations"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
Implements LtXmlComLib21.XmlObjectBase
Implements LtXmlComLib21.XmlGeneratedClass
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''' Properties '''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Property Get ElementName() As String
ElementName = m_elementName
End Property
' Summary:
' Represents a mandatory Attribute in the XML document
'
' Remarks:
'
' This property is represented as an Attribute in the XML.
' It is mandatory and therefore must be populated within the XML.
' It is defaulted to 0.
Public Property Get VoucherNo As Long
VoucherNo = mvarVoucherNo
End Property
Public Property Let VoucherNo(ByVal value As Long)
mvarVoucherNo = value
End Property
' Summary:
' Represents a mandatory Attribute in the XML document
'
' Remarks:
'
' This property is represented as an Attribute in the XML.
' It is mandatory and therefore must be populated within the XML.
' It is defaulted to 0.
Public Property Get VoucherValue As Long
VoucherValue = mvarVoucherValue
End Property
Public Property Let VoucherValue(ByVal value As Long)
mvarVoucherValue = value
End Property
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''' Standard Methods '''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Sub ToXmlFile(ByVal FileName As String, Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib21.XmlFormatting = LtXmlComLib21.XmlFormatting_Indented, Optional encoding As LtXmlComLib21.XmlEncoding = LtXmlComLib21.XmlEncoding_UTF8, Optional EOL As LtXmlComLib21.EOLType = LtXmlComLib21.EOLType.EOLType_CRLF, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing)
RegisterProduct
LtXmlComLib21.XmlObjectBaseHelper.ToXmlFile Me, FileName, includeDocHeader, formatting, encoding, EOL, context
End Sub
Public Function ToXml(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib21.XmlFormatting = LtXmlComLib21.XmlFormatting_Indented, Optional EOL As LtXmlComLib21.EOLType = LtXmlComLib21.EOLType.EOLType_LF, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing) As String
RegisterProduct
ToXml = LtXmlComLib21.XmlObjectBaseHelper.ToXml(Me, includeDocHeader, formatting, EOL, context)
End Function
Public Function ToXmlStream(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib21.XmlFormatting = LtXmlComLib21.XmlFormatting_Indented, Optional encoding As LtXmlComLib21.XmlEncoding = LtXmlComLib21.XmlEncoding_UTF8, Optional EOL As LtXmlComLib21.EOLType = LtXmlComLib21.EOLType.EOLType_LF, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing) As Variant
RegisterProduct
ToXmlStream = LtXmlComLib21.XmlObjectBaseHelper.ToXmlStream(Me, includeDocHeader, formatting, encoding, EOL, context)
End Function
Public Sub FromXml(ByVal xmlIn As String, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing)
RegisterProduct
LtXmlComLib21.XmlObjectBaseHelper.FromXml Me, xmlIn, context
End Sub
Public Sub FromXmlFile(ByVal FileName As String, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing)
RegisterProduct
LtXmlComLib21.XmlObjectBaseHelper.FromXmlFile Me, FileName, context
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''' Private Methods ''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Summary:
' Constructor for Vouchers
' Remarks:
' The class is created with all the mandatory fields populated with the
' default data.
' All Collection object are created.
' However any 1-n relationships (these are represented as collections) are
' empty. To comply with the schema these must be populated before the xml
' obtained from ToXml is valid against the schema SimpleHierarchy.xsd
Private Sub Class_Initialize()
m_elementName = "Vouchers"
XmlGeneratedClass_Init
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''' Implementation of XmlObjectBase '''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub XmlObjectBase_PrivateSetElementName(ByVal vNewValue As String)
m_ElementName = vNewValue
End Sub
Private Property Get XmlObjectBase_ElementName() As String
XmlObjectBase_ElementName = m_ElementName
End Property
Private Property Get XmlObjectBase_TargetNamespace() As String
XmlObjectBase_TargetNamespace = ""
End Property
Private Function XmlObjectBase_IsSuitableSubstitution(ByVal InterfaceName As String) As Boolean
XmlObjectBase_IsSuitableSubstitution = false
if InterfaceName = "Vouchers" _
then XmlObjectBase_IsSuitableSubstitution = true
End Function
Private Property Get XmlObjectBase_Namespace() As String
XmlObjectBase_Namespace = ""
End Property
Private Function XmlObjectBase_FromXmlInt(ByVal XMLParent As MSXML2.IXMLDOMElement, ByVal XMLChild As MSXML2.IXMLDOMElement, ByVal context As LtXmlComLib21.XmlSerializationContext, ByVal isOptionalChoice As Boolean) As MSXML2.IXMLDOMElement
Set XmlObjectBase_FromXmlInt = XmlGeneratedClassHelper.FromXml(Me, XMLParent, XMLChild, context, isOptionalChoice)
End Function
Private Sub XmlObjectBase_ToXmlInt(ByVal xmlOut As LtXmlComLib21.XmlTextWriter, ByVal bRegisterNamespaces As Boolean, ByVal NamespaceUri As String, ByVal context As LtXmlComLib21.XmlSerializationContext, ByVal isOptionalChoice As Boolean)
XmlGeneratedClassHelper.ToXml Me, xmlOut, bRegisterNamespaces, NamespaceUri, context, isOptionalChoice
End Sub
Private Sub XmlObjectBase_AttributesToXmlInt(ByVal xmlOut As LtXmlComLib21.XmlTextWriter, ByVal context As LtXmlComLib21.XmlSerializationContext)
XmlGeneratedClassHelper.AttributesToXml Me, xmlOut, context
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''' Implementation of XmlGeneratedClass '''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Summary:
' Initializes the class
' Remarks:
' The Creates all the mandatory fields (populated with the default data)
' All Collection object are created.
' However any 1-n relationships (these are represented as collections) are
' empty. To comply with the schema these must be populated before the xml
' obtained from ToXml is valid against the schema SimpleHierarchy.xsd.
Private Sub XmlGeneratedClass_Init()
mvarVoucherNo = LtXmlComLib21.Conversions.ui8FromString("0", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Collapse)
mvarVoucherValue = LtXmlComLib21.Conversions.ui8FromString("0", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Collapse)
' Force Init ClassInfo
Dim classInfo As LtXmlComLib21.ClassInfo
Set classInfo = XmlGeneratedClass_ClassInfo
' ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
' Add Additional Init Settings...
' ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
End Sub
Private Property Get XmlGeneratedClass_ClassInfo() As LtXmlComLib21.ClassInfo
If g_ClsDataVouchers Is Nothing Then
Set g_ClsDataVouchers = New LtXmlComLib21.ClassInfo
g_ClsDataVouchers.GroupType = LtXmlComLib21.XmlGroupType.Sequence
g_ClsDataVouchers.ElementType = LtXmlComLib21.XmlElementType.Element
g_ClsDataVouchers.ElementName = "Vouchers"
g_ClsDataVouchers.ElementNamespaceURI = ""
g_ClsDataVouchers.FromXmlFailIfAttributeUnknown = true
g_ClsDataVouchers.IsClassDerived = false
g_ClsDataVouchers.PrimitiveDataType = LtXmlComLib21.XmlDataType.type_none
g_ClsDataVouchers.PrimitiveFormatOverride = ""
g_ClsDataVouchers.OutputPrimitiveClassAsTextProperty = False
Set g_ClsDataVouchers.ClassFactory = General.CF
g_ClsDataVouchers.AddAttrPrimitive "VoucherNo", "", "VoucherNo", "", false, XmlDataType.type_ui8, "", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Collapse, "", -1, -1, "", "", "", "", -1, vbNullString
g_ClsDataVouchers.AddAttrPrimitive "VoucherValue", "", "VoucherValue", "", false, XmlDataType.type_ui8, "", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Collapse, "", -1, -1, "", "", "", "", -1, vbNullString
End If
Set XmlGeneratedClass_ClassInfo = g_ClsDataVouchers
End Property
' ##HAND_CODED_BLOCK_START ID="Additional Methods/Properties"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
' Add Additional Methods/Properties Here...
' ##HAND_CODED_BLOCK_END ID="Additional Methods/Properties"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
|
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "VouchersCol"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
'**********************************************************************************************
'* Copyright (c) 2001-2025 Liquid Technologies Limited. All rights reserved.
'* See www.liquid-technologies.com for product details.
'*
'* Please see products End User License Agreement for distribution permissions.
'*
'* WARNING: THIS FILE IS GENERATED
'* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten
'*
'* Generation : by Liquid XML Data Binder 19.0.14.11049
'* Using Schema: SimpleHierarchy.xsd
'**********************************************************************************************
Private m_elementName as String
Private m_elementNamespaceUri As String
Private m_minOccurs as Long
Private m_maxOccurs as Long
Private m_coll as Collection
' ##HAND_CODED_BLOCK_START ID="Additional Variable Declarations"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
' Add Additional Variable Declarations...
' ##HAND_CODED_BLOCK_END ID="Additional Variable Declarations"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
Public Event OnCollectionChange()
Implements LtXmlComLib21.XmlCollectionBase
Implements LtXmlComLib21.XmlObjectBase
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''' Collection Methods ''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Summary:
' Adds a Vouchers enumeration to the collection
' Param name="newEnum":
' The object to be copied into the collection
' Returns:
' The copied object (that was added to the collection)
' Remarks:
' The object newProperty, is copied, and the copy is added to the
' collection.
public Function Add(ByVal newCls as SimpleHiarchyLib.Vouchers, optional Before, optional After) as SimpleHiarchyLib.Vouchers
CastToXmlObjectBase(newCls).PrivateSetElementName m_elementName
' LtXmlComLib21.XmlObjectBaseHelper.Throw_IfElementNameDiffers newCls, m_elementName
m_coll.Add newCls, , Before, After
RaiseEvent OnCollectionChange
Set Add = newCls
End Function
' Summary:
' Adds a Vouchers object to the collection
' Returns:
' The newly created Vouchers object
' Remarks:
' A new Vouchers object is created and added to the collection
' the new object is then returned.
public Function AddNew() as SimpleHiarchyLib.Vouchers
Set AddNew = CF.CreateClass(ClsName_Vouchers)
CastToXmlObjectBase(AddNew).PrivateSetElementName m_elementName
m_coll.Add AddNew
RaiseEvent OnCollectionChange
End Function
' Summary:
' Gets a Vouchers object from the collection
' Param name="index":
' The 0 based index of the item to retreve
' Returns:
' The object at the given location in the collection
public property Get Item(byval index as long) as SimpleHiarchyLib.Vouchers
Attribute Item.VB_UserMemId = 0
Set Item = m_Coll(index)
End Property
Public Property Get Count() As Long
Count = m_coll.Count
End Property
Public Sub Remove(ByVal index As Long)
m_coll.Remove index
RaiseEvent OnCollectionChange
End Sub
Public Sub Clear()
while m_coll.Count > 0
Remove 1
wend
End Sub
Public Property Get NewEnum() As IUnknown
Attribute NewEnum.VB_UserMemId = -4
Attribute NewEnum.VB_MemberFlags = "40"
Set NewEnum = m_Coll.[_NewEnum]
End Property
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''' Implementation of Class'''' '''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub Class_Initialize()
set m_coll = new Collection
End Sub
Private Sub Class_Terminate()
Set m_coll = nothing
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''' Implementation of XmlObjectBase '''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Property Get XmlObjectBase_ElementName() As String
XmlObjectBase_ElementName = m_elementName
End Property
Private Function XmlObjectBase_IsSuitableSubstitution(ByVal InterfaceName As String) As Boolean
XmlObjectBase_IsSuitableSubstitution = false
if InterfaceName = "Vouchers" _
then XmlObjectBase_IsSuitableSubstitution = true
End Function
Private Sub XmlObjectBase_PrivateSetElementName(ByVal vNewValue As String)
m_ElementName = vNewValue
End Sub
Private Sub XmlObjectBase_AttributesToXmlInt(ByVal xmlOut As LtXmlComLib21.XmlTextWriter, ByVal oContext As LtXmlComLib21.XmlSerializationContext)
dim oCls as LtXmlComLib21.XmlObjectBase
for each oCls in m_coll
CastToXmlObjectBase(oCls).AttributesToXmlInt xmlOut, oContext
next
End Sub
Private Sub XmlObjectBase_ToXmlInt(ByVal xmlOut As LtXmlComLib21.XmlTextWriter, ByVal bRegisterNamespaces As Boolean, ByVal NamespaceURI As String, ByVal oContext As LtXmlComLib21.XmlSerializationContext, ByVal isOptionalChoice As Boolean)
dim oCls as LtXmlComLib21.XmlObjectBase
XmlCollectionBase_ValidateCount oContext
for each oCls in m_coll
CastToXmlObjectBase(oCls).ToXmlInt xmlOut, false, NamespaceUri, oContext, isOptionalChoice
next
End Sub
Private Function XmlObjectBase_FromXmlInt(ByVal xmlParent As MSXML2.IXMLDOMElement, ByVal xmlChild As MSXML2.IXMLDOMElement, ByVal oContext As LtXmlComLib21.XmlSerializationContext, ByVal isOptionalChoice As Boolean) As MSXML2.IXMLDOMElement
Dim newObj as SimpleHiarchyLib.Vouchers
' go through the nodes until we run out of ones that match
do while not xmlChild is nothing
if xmlChild.NodeType = MSXML2.NODE_ELEMENT then
' Stop reading when we hit an element we can't deal with
if LtXmlComLib21.XmlGeneratedClassHelper.DoesElementNameMatch(oContext, xmlChild, m_elementName, m_elementNamespaceUri) = False then exit do
Set newObj = CF.CreateNamedClass(ClsName_Vouchers, m_elementName)
CastToXmlObjectBase(newObj).FromXmlInt xmlChild, LtXmlComLib21.XmlObjectBaseHelper.FindFirstSliblingElement(xmlChild.FirstChild), oContext, isOptionalChoice
' Add new item to the collection
m_coll.Add newObj
RaiseEvent OnCollectionChange
end if
' Move to next node
Set xmlChild = LtXmlComLib21.XmlObjectBaseHelper.MoveNextSiblingElement(xmlChild)
loop
Set XmlObjectBase_FromXmlInt = xmlChild
End Function
Private Property Get XmlObjectBase_TargetNamespace() As String
XmlObjectBase_TargetNamespace = ""
End Property
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''' Implementation of XmlCollectionBase '''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' we don't want the users just creating these. They need to
' be initialize with the name of the element that they are
' going to represent in the XML document. This information
' requires knowledge of the schema, we are trying to
' prevent the user from having to know anything about that.
Private Sub XmlCollectionBase_Init(ByVal strElementName As String, ByVal strElementNamespaceUri As String, ByVal iMinOccurs As Long, ByVal iMaxOccurs As Long)
m_elementName = strElementName
m_elementNamespaceUri = strElementNamespaceUri
m_minOccurs = iMinOccurs
m_maxOccurs = iMaxOccurs
End Sub
Private Sub XmlCollectionBase_ValidateCount(ByVal oContext As XmlSerializationContext)
XmlObjectBaseHelper.ValidateCountHelper oContext, m_coll, m_minOccurs, m_maxOccurs, m_ElementName
End Sub
Private Property Get XmlCollectionBase_MinOccurs() As Long
XmlCollectionBase_MinOccurs = m_minOccurs
End Property
' ##HAND_CODED_BLOCK_START ID="Additional Methods/Properties"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
' Add Additional Methods/Properties Here...
' ##HAND_CODED_BLOCK_END ID="Additional Methods/Properties"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
|
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "ItemType"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
'**********************************************************************************************
'* Copyright (c) 2001-2025 Liquid Technologies Limited. All rights reserved.
'* See www.liquid-technologies.com for product details.
'*
'* Please see products End User License Agreement for distribution permissions.
'*
'* WARNING: THIS FILE IS GENERATED
'* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten
'*
'* Generation : by Liquid XML Data Binder 19.0.14.11049
'* Using Schema: SimpleHierarchy.xsd
'**********************************************************************************************
Private m_ElementName As String
Private mvarStockCode As Long
Private mvarDescription As String
Private mvarUnitCost As Long
Private mvarQuantity As Long
' ##HAND_CODED_BLOCK_START ID="Additional Variable Declarations"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
' Add Additional Variable Declarations...
' ##HAND_CODED_BLOCK_END ID="Additional Variable Declarations"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
Implements LtXmlComLib21.XmlObjectBase
Implements LtXmlComLib21.XmlGeneratedClass
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''' Properties '''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Property Get ElementName() As String
ElementName = m_elementName
End Property
' Summary:
' Represents a mandatory Element in the XML document
'
' Remarks:
'
' This property is represented as an Element in the XML.
' It is mandatory and therefore must be populated within the XML.
' It is defaulted to 0.
Public Property Get StockCode As Long
StockCode = mvarStockCode
End Property
Public Property Let StockCode(ByVal value As Long)
mvarStockCode = value
End Property
' Summary:
' Represents a mandatory Element in the XML document
'
' Remarks:
'
' This property is represented as an Element in the XML.
' It is mandatory and therefore must be populated within the XML.
' It is defaulted to .
Public Property Get Description As String
Description = mvarDescription
End Property
Public Property Let Description(ByVal value As String)
' Apply whitespace rules appropriately
value = LtXmlComLib21.WhitespaceUtils.PreserveWhitespace(value)
mvarDescription = value
End Property
' Summary:
' Represents a mandatory Element in the XML document
'
' Remarks:
'
' This property is represented as an Element in the XML.
' It is mandatory and therefore must be populated within the XML.
' It is defaulted to 0.
Public Property Get UnitCost As Long
UnitCost = mvarUnitCost
End Property
Public Property Let UnitCost(ByVal value As Long)
mvarUnitCost = value
End Property
' Summary:
' Represents a mandatory Element in the XML document
'
' Remarks:
'
' This property is represented as an Element in the XML.
' It is mandatory and therefore must be populated within the XML.
' It is defaulted to 0.
Public Property Get Quantity As Long
Quantity = mvarQuantity
End Property
Public Property Let Quantity(ByVal value As Long)
mvarQuantity = value
End Property
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''' Standard Methods '''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Sub ToXmlFile(ByVal FileName As String, Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib21.XmlFormatting = LtXmlComLib21.XmlFormatting_Indented, Optional encoding As LtXmlComLib21.XmlEncoding = LtXmlComLib21.XmlEncoding_UTF8, Optional EOL As LtXmlComLib21.EOLType = LtXmlComLib21.EOLType.EOLType_CRLF, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing)
RegisterProduct
LtXmlComLib21.XmlObjectBaseHelper.ToXmlFile Me, FileName, includeDocHeader, formatting, encoding, EOL, context
End Sub
Public Function ToXml(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib21.XmlFormatting = LtXmlComLib21.XmlFormatting_Indented, Optional EOL As LtXmlComLib21.EOLType = LtXmlComLib21.EOLType.EOLType_LF, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing) As String
RegisterProduct
ToXml = LtXmlComLib21.XmlObjectBaseHelper.ToXml(Me, includeDocHeader, formatting, EOL, context)
End Function
Public Function ToXmlStream(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib21.XmlFormatting = LtXmlComLib21.XmlFormatting_Indented, Optional encoding As LtXmlComLib21.XmlEncoding = LtXmlComLib21.XmlEncoding_UTF8, Optional EOL As LtXmlComLib21.EOLType = LtXmlComLib21.EOLType.EOLType_LF, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing) As Variant
RegisterProduct
ToXmlStream = LtXmlComLib21.XmlObjectBaseHelper.ToXmlStream(Me, includeDocHeader, formatting, encoding, EOL, context)
End Function
Public Sub FromXml(ByVal xmlIn As String, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing)
RegisterProduct
LtXmlComLib21.XmlObjectBaseHelper.FromXml Me, xmlIn, context
End Sub
Public Sub FromXmlFile(ByVal FileName As String, Optional context As LtXmlComLib21.XmlSerializationContext = Nothing)
RegisterProduct
LtXmlComLib21.XmlObjectBaseHelper.FromXmlFile Me, FileName, context
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''' Private Methods ''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Summary:
' Constructor for ItemType
' Remarks:
' The class is created with all the mandatory fields populated with the
' default data.
' All Collection object are created.
' However any 1-n relationships (these are represented as collections) are
' empty. To comply with the schema these must be populated before the xml
' obtained from ToXml is valid against the schema SimpleHierarchy.xsd
Private Sub Class_Initialize()
m_elementName = "ItemType"
XmlGeneratedClass_Init
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''' Implementation of XmlObjectBase '''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub XmlObjectBase_PrivateSetElementName(ByVal vNewValue As String)
m_ElementName = vNewValue
End Sub
Private Property Get XmlObjectBase_ElementName() As String
XmlObjectBase_ElementName = m_ElementName
End Property
Private Property Get XmlObjectBase_TargetNamespace() As String
XmlObjectBase_TargetNamespace = ""
End Property
Private Function XmlObjectBase_IsSuitableSubstitution(ByVal InterfaceName As String) As Boolean
XmlObjectBase_IsSuitableSubstitution = false
if InterfaceName = "ItemType" _
then XmlObjectBase_IsSuitableSubstitution = true
End Function
Private Property Get XmlObjectBase_Namespace() As String
XmlObjectBase_Namespace = ""
End Property
Private Function XmlObjectBase_FromXmlInt(ByVal XMLParent As MSXML2.IXMLDOMElement, ByVal XMLChild As MSXML2.IXMLDOMElement, ByVal context As LtXmlComLib21.XmlSerializationContext, ByVal isOptionalChoice As Boolean) As MSXML2.IXMLDOMElement
Set XmlObjectBase_FromXmlInt = XmlGeneratedClassHelper.FromXml(Me, XMLParent, XMLChild, context, isOptionalChoice)
End Function
Private Sub XmlObjectBase_ToXmlInt(ByVal xmlOut As LtXmlComLib21.XmlTextWriter, ByVal bRegisterNamespaces As Boolean, ByVal NamespaceUri As String, ByVal context As LtXmlComLib21.XmlSerializationContext, ByVal isOptionalChoice As Boolean)
XmlGeneratedClassHelper.ToXml Me, xmlOut, bRegisterNamespaces, NamespaceUri, context, isOptionalChoice
End Sub
Private Sub XmlObjectBase_AttributesToXmlInt(ByVal xmlOut As LtXmlComLib21.XmlTextWriter, ByVal context As LtXmlComLib21.XmlSerializationContext)
XmlGeneratedClassHelper.AttributesToXml Me, xmlOut, context
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''' Implementation of XmlGeneratedClass '''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Summary:
' Initializes the class
' Remarks:
' The Creates all the mandatory fields (populated with the default data)
' All Collection object are created.
' However any 1-n relationships (these are represented as collections) are
' empty. To comply with the schema these must be populated before the xml
' obtained from ToXml is valid against the schema SimpleHierarchy.xsd.
Private Sub XmlGeneratedClass_Init()
mvarStockCode = LtXmlComLib21.Conversions.ui8FromString("0", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Collapse)
mvarDescription = LtXmlComLib21.Conversions.stringFromString("", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Preserve)
mvarUnitCost = LtXmlComLib21.Conversions.i8FromString("0", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Collapse)
mvarQuantity = LtXmlComLib21.Conversions.ui4FromString("0", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Collapse)
' Force Init ClassInfo
Dim classInfo As LtXmlComLib21.ClassInfo
Set classInfo = XmlGeneratedClass_ClassInfo
' ##HAND_CODED_BLOCK_START ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
' Add Additional Init Settings...
' ##HAND_CODED_BLOCK_END ID="Additional Inits"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
End Sub
Private Property Get XmlGeneratedClass_ClassInfo() As LtXmlComLib21.ClassInfo
If g_ClsDataItemType Is Nothing Then
Set g_ClsDataItemType = New LtXmlComLib21.ClassInfo
g_ClsDataItemType.GroupType = LtXmlComLib21.XmlGroupType.Sequence
g_ClsDataItemType.ElementType = LtXmlComLib21.XmlElementType.Element
g_ClsDataItemType.ElementName = "ItemType"
g_ClsDataItemType.ElementNamespaceURI = ""
g_ClsDataItemType.FromXmlFailIfAttributeUnknown = true
g_ClsDataItemType.IsClassDerived = false
g_ClsDataItemType.PrimitiveDataType = LtXmlComLib21.XmlDataType.type_none
g_ClsDataItemType.PrimitiveFormatOverride = ""
g_ClsDataItemType.OutputPrimitiveClassAsTextProperty = False
Set g_ClsDataItemType.ClassFactory = General.CF
g_ClsDataItemType.AddElmSeqPrimMnd "StockCode", "", "StockCode", XmlDataType.type_ui8, "", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Collapse, "", -1, -1, "", "", "", "", -1
g_ClsDataItemType.AddElmSeqPrimMnd "Description", "", "Description", XmlDataType.type_string, "", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Preserve, "", -1, -1, "", "", "", "", -1
g_ClsDataItemType.AddElmSeqPrimMnd "UnitCost", "", "UnitCost", XmlDataType.type_i8, "", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Collapse, "", -1, -1, "", "", "", "", -1
g_ClsDataItemType.AddElmSeqPrimMnd "Quantity", "", "Quantity", XmlDataType.type_ui4, "", LtXmlComLib21.WhitespaceRule.WhitespaceRule_Collapse, "", -1, -1, "", "", "", "", -1
End If
Set XmlGeneratedClass_ClassInfo = g_ClsDataItemType
End Property
' ##HAND_CODED_BLOCK_START ID="Additional Methods/Properties"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
' Add Additional Methods/Properties Here...
' ##HAND_CODED_BLOCK_END ID="Additional Methods/Properties"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
|
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "ItemTypeCol"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
'**********************************************************************************************
'* Copyright (c) 2001-2025 Liquid Technologies Limited. All rights reserved.
'* See www.liquid-technologies.com for product details.
'*
'* Please see products End User License Agreement for distribution permissions.
'*
'* WARNING: THIS FILE IS GENERATED
'* Changes made outside of ##HAND_CODED_BLOCK_START blocks will be overwritten
'*
'* Generation : by Liquid XML Data Binder 19.0.14.11049
'* Using Schema: SimpleHierarchy.xsd
'**********************************************************************************************
Private m_elementName as String
Private m_elementNamespaceUri As String
Private m_minOccurs as Long
Private m_maxOccurs as Long
Private m_coll as Collection
' ##HAND_CODED_BLOCK_START ID="Additional Variable Declarations"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
' Add Additional Variable Declarations...
' ##HAND_CODED_BLOCK_END ID="Additional Variable Declarations"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
Public Event OnCollectionChange()
Implements LtXmlComLib21.XmlCollectionBase
Implements LtXmlComLib21.XmlObjectBase
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''' Collection Methods ''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Summary:
' Adds a ItemType enumeration to the collection
' Param name="newEnum":
' The object to be copied into the collection
' Returns:
' The copied object (that was added to the collection)
' Remarks:
' The object newProperty, is copied, and the copy is added to the
' collection.
public Function Add(ByVal newCls as SimpleHiarchyLib.ItemType, optional Before, optional After) as SimpleHiarchyLib.ItemType
CastToXmlObjectBase(newCls).PrivateSetElementName m_elementName
' LtXmlComLib21.XmlObjectBaseHelper.Throw_IfElementNameDiffers newCls, m_elementName
m_coll.Add newCls, , Before, After
RaiseEvent OnCollectionChange
Set Add = newCls
End Function
' Summary:
' Adds a ItemType object to the collection
' Returns:
' The newly created ItemType object
' Remarks:
' A new ItemType object is created and added to the collection
' the new object is then returned.
public Function AddNew() as SimpleHiarchyLib.ItemType
Set AddNew = CF.CreateClass(ClsName_ItemType)
CastToXmlObjectBase(AddNew).PrivateSetElementName m_elementName
m_coll.Add AddNew
RaiseEvent OnCollectionChange
End Function
' Summary:
' Gets a ItemType object from the collection
' Param name="index":
' The 0 based index of the item to retreve
' Returns:
' The object at the given location in the collection
public property Get Item(byval index as long) as SimpleHiarchyLib.ItemType
Attribute Item.VB_UserMemId = 0
Set Item = m_Coll(index)
End Property
Public Property Get Count() As Long
Count = m_coll.Count
End Property
Public Sub Remove(ByVal index As Long)
m_coll.Remove index
RaiseEvent OnCollectionChange
End Sub
Public Sub Clear()
while m_coll.Count > 0
Remove 1
wend
End Sub
Public Property Get NewEnum() As IUnknown
Attribute NewEnum.VB_UserMemId = -4
Attribute NewEnum.VB_MemberFlags = "40"
Set NewEnum = m_Coll.[_NewEnum]
End Property
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''' Implementation of Class'''' '''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub Class_Initialize()
set m_coll = new Collection
End Sub
Private Sub Class_Terminate()
Set m_coll = nothing
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''' Implementation of XmlObjectBase '''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Property Get XmlObjectBase_ElementName() As String
XmlObjectBase_ElementName = m_elementName
End Property
Private Function XmlObjectBase_IsSuitableSubstitution(ByVal InterfaceName As String) As Boolean
XmlObjectBase_IsSuitableSubstitution = false
if InterfaceName = "ItemType" _
then XmlObjectBase_IsSuitableSubstitution = true
End Function
Private Sub XmlObjectBase_PrivateSetElementName(ByVal vNewValue As String)
m_ElementName = vNewValue
End Sub
Private Sub XmlObjectBase_AttributesToXmlInt(ByVal xmlOut As LtXmlComLib21.XmlTextWriter, ByVal oContext As LtXmlComLib21.XmlSerializationContext)
dim oCls as LtXmlComLib21.XmlObjectBase
for each oCls in m_coll
CastToXmlObjectBase(oCls).AttributesToXmlInt xmlOut, oContext
next
End Sub
Private Sub XmlObjectBase_ToXmlInt(ByVal xmlOut As LtXmlComLib21.XmlTextWriter, ByVal bRegisterNamespaces As Boolean, ByVal NamespaceURI As String, ByVal oContext As LtXmlComLib21.XmlSerializationContext, ByVal isOptionalChoice As Boolean)
dim oCls as LtXmlComLib21.XmlObjectBase
XmlCollectionBase_ValidateCount oContext
for each oCls in m_coll
CastToXmlObjectBase(oCls).ToXmlInt xmlOut, false, NamespaceUri, oContext, isOptionalChoice
next
End Sub
Private Function XmlObjectBase_FromXmlInt(ByVal xmlParent As MSXML2.IXMLDOMElement, ByVal xmlChild As MSXML2.IXMLDOMElement, ByVal oContext As LtXmlComLib21.XmlSerializationContext, ByVal isOptionalChoice As Boolean) As MSXML2.IXMLDOMElement
Dim newObj as SimpleHiarchyLib.ItemType
' go through the nodes until we run out of ones that match
do while not xmlChild is nothing
if xmlChild.NodeType = MSXML2.NODE_ELEMENT then
' Stop reading when we hit an element we can't deal with
if LtXmlComLib21.XmlGeneratedClassHelper.DoesElementNameMatch(oContext, xmlChild, m_elementName, m_elementNamespaceUri) = False then exit do
Set newObj = CF.CreateNamedClass(ClsName_ItemType, m_elementName)
CastToXmlObjectBase(newObj).FromXmlInt xmlChild, LtXmlComLib21.XmlObjectBaseHelper.FindFirstSliblingElement(xmlChild.FirstChild), oContext, isOptionalChoice
' Add new item to the collection
m_coll.Add newObj
RaiseEvent OnCollectionChange
end if
' Move to next node
Set xmlChild = LtXmlComLib21.XmlObjectBaseHelper.MoveNextSiblingElement(xmlChild)
loop
Set XmlObjectBase_FromXmlInt = xmlChild
End Function
Private Property Get XmlObjectBase_TargetNamespace() As String
XmlObjectBase_TargetNamespace = ""
End Property
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''' Implementation of XmlCollectionBase '''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' we don't want the users just creating these. They need to
' be initialize with the name of the element that they are
' going to represent in the XML document. This information
' requires knowledge of the schema, we are trying to
' prevent the user from having to know anything about that.
Private Sub XmlCollectionBase_Init(ByVal strElementName As String, ByVal strElementNamespaceUri As String, ByVal iMinOccurs As Long, ByVal iMaxOccurs As Long)
m_elementName = strElementName
m_elementNamespaceUri = strElementNamespaceUri
m_minOccurs = iMinOccurs
m_maxOccurs = iMaxOccurs
End Sub
Private Sub XmlCollectionBase_ValidateCount(ByVal oContext As XmlSerializationContext)
XmlObjectBaseHelper.ValidateCountHelper oContext, m_coll, m_minOccurs, m_maxOccurs, m_ElementName
End Sub
Private Property Get XmlCollectionBase_MinOccurs() As Long
XmlCollectionBase_MinOccurs = m_minOccurs
End Property
' ##HAND_CODED_BLOCK_START ID="Additional Methods/Properties"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
' Add Additional Methods/Properties Here...
' ##HAND_CODED_BLOCK_END ID="Additional Methods/Properties"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS
|
| Main Menu | Samples List |