Visual Basic 6 Sample : Music Store
Schema Summary This sample shows how a to use the generated code to implement a simple request response (client/server) application. Schema Details The Request represents a search request for an album (like the interfaces exposed by Amazon or Play). The response represents the result of the search, in this case either a set of results or an error. If results are returned then this may contain 0-n products (a product being an album), each album has one or more tracks, and a track has a title and length. Sample Description The sample demonstrates how to Create a request document, get the underlying XML. Decode the request, and build a response. Then decode and display the response. In short both side of a very simple client server application. |
Sample XML File
MusicStore_Sample_Response.xml |
<?xml version="1.0" encoding="UTF-8"?> <SearchResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="MusicStore.xsd"> <Result> <SearchDate>2003-01-20</SearchDate> <Product Label="Parlophone" ProductCode="0004U94562457MS" RRP="7.99"> <AlbumName>Parachutes</AlbumName> <ArtistName>ColdPlay</ArtistName> <Track> <Title>Don't Panic</Title> <Length>PT2M10S</Length> </Track> <Track> <Title>Shiver</Title> <Length>PT3M10S</Length> </Track> <Track> <Title>Spies</Title> <Length>PT2M12S</Length> </Track> <Track> <Title>Sparks</Title> <Length>PT3M40S</Length> </Track> <Track> <Title>Yellow</Title> <Length>PT6M12S</Length> </Track> <Track> <Title>Trouble</Title> <Length>PT3M12S</Length> </Track> <Track> <Title>Parachutes</Title> <Length>PT3M21S</Length> </Track> <Track> <Title>High Speed</Title> <Length>PT4M10S</Length> </Track> <Track> <Title>We Never Change</Title> <Length>PT4M36S</Length> </Track> <Track> <Title>Everything's Not Lost</Title> <Length>PT2M59S</Length> </Track> </Product> <Product Label="Parlophone" ProductCode="1001542157321SW" RRP="8.59"> <AlbumName>X&Y</AlbumName> <ArtistName>ColdPlay</ArtistName> <Track> <Title>Square One</Title> <Length>PT2M10S</Length> </Track> <Track> <Title>What If</Title> <Length>PT3M01S</Length> </Track> <Track> <Title>White Shadows</Title> <Length>PT3M04S</Length> </Track> <Track> <Title>Fix You</Title> <Length>PT4M36S</Length> </Track> <Track> <Title>Talk</Title> <Length>PT5M42S</Length> </Track> <Track> <Title>X&Y</Title> <Length>PT2M12S</Length> </Track> <Track> <Title>Speed Of Sound</Title> <Length>PT3M58S</Length> </Track> <Track> <Title>A Message</Title> <Length>PT4M15S</Length> </Track> <Track> <Title>Low</Title> <Length>PT3M21S</Length> </Track> <Track> <Title>The Hardest Part</Title> <Length>PT4M24S</Length> </Track> <Track> <Title>Swallowed In The Sea</Title> <Length>PT2M35S</Length> </Track> <Track> <Title>Twisted Logic</Title> <Length>PT5M54S</Length> </Track> <Track> <Title>Till Kingdom Come</Title> <Length>PT10M15S</Length> </Track> </Product> </Result> </SearchResponse> |
Read Sample | ||
strXmlRequest = CreateSearchRequest strXmlResponse = ProcessSearchRequest(strXmlRequest) DisplayResults strXmlResponse Function CreateSearchRequest() As String ' create an instance of the class Dim oRequest As New MusicStoreLib.SearchRequest ' setup our search criteria oRequest.NameFilter = "coldplay" oRequest.PriceFilter.MaxPrice = 9.99 ' Return the Request XML CreateSearchRequest = oRequest.ToXml End Function
Function ProcessSearchRequest(ByVal strRequestXML As String) As String ' create an instance of the class to load the XML file into Dim oRequest As New MusicStoreLib.SearchRequest Dim dMinPrice As Double Dim dMaxPrice As Double ' load the request oRequest.FromXml strRequestXML ' use the search criteria in a query dMinPrice = 0 dMaxPrice = 1E+100 If oRequest.PriceFilter.IsValidMinPrice Then dMinPrice = oRequest.PriceFilter.MinPrice If oRequest.PriceFilter.IsValidMaxPrice Then dMaxPrice = oRequest.PriceFilter.MaxPrice ProcessSearchRequest = _ GetSearchResults(oRequest.NameFilter, dMinPrice, dMaxPrice) End Function Function GetSearchResults(ByVal strNameFilter As String, _ ByVal minValueFilter As Double, _ ByVal maxValueFilter As Double) As String Dim oConn As New ADODB.Connection Dim oCmdAlbum As New ADODB.Command Dim oCmdTrack As New ADODB.Command Dim oRsAlbum As ADODB.Recordset Dim oRsTrack As ADODB.Recordset Dim oResponse As MusicStoreLib.SearchResponse Dim oAlbum As MusicStoreLib.AlbumType Dim oTrack As MusicStoreLib.TrackType Dim strSQLAlbum As String Dim strSQLTrack As String ' setup Database query (use your imagination!) strSQLAlbum = _ "SELECT * " &; _ "FROM Album " &; _ "WHERE ArtistName = @ArtistFilter AND " &; _ " Price > @MinPriceFilter AND " & _ " Price < @MaxPriceFilter AND " strSQLTrack = _ "SELECT * " &; _ "FROM Track " &; _ "WHERE AlbumID = @AlbumID" oConn.Open "..." Set oCmdAlbum.ActiveConnection = oConn oCmdAlbum.Parameters.Append oCmdAlbum.CreateParameter(, , , , strNameFilter) oCmdAlbum.Parameters.Append oCmdAlbum.CreateParameter(, , , , minValueFilter) oCmdAlbum.Parameters.Append oCmdAlbum.CreateParameter(, , , , maxValueFilter) Set oCmdTrack.ActiveConnection = oConn oCmdTrack.Parameters.Append oCmdAlbum.CreateParameter(, , , , 0) ' query the database Set oRsAlbum = oCmdAlbum.Execute ' create an instance of the class to load the XML file into Set oResponse = New MusicStoreLib.SearchResponse oResponse.Result.SearchDate.SetFromDateTime Now While oRsAlbum.EOF = False ' Add a new album to the collection Set oAlbum = oResponse.Result.Product.AddNew ' populate the album oAlbum.AlbumName = oRsAlbum("AlbumName").Value oAlbum.ArtistName = oRsAlbum("ArtistName").Value oAlbum.Label = oRsAlbum("RecordLabel").Value oAlbum.ProductCode = oRsAlbum("ProductCode").Value If IsEmpty(oRsAlbum("Price").Value) Then oAlbum.RRP = oRsAlbum("Price").Value End If ' Query the DB for all the tracks in the album oCmdTrack.Parameters(1).Value = oRsAlbum("AlbumID").Value Set oRsTrack = oCmdTrack.Execute ' add all the tracks While oRsTrack.EOF = False ' create a track in the XML Set oTrack = oAlbum.Track.AddNew ' populate the track oTrack.Title = oRsTrack("Title").Value oTrack.length.Seconds = oRsTrack("Duration").Value oRsTrack.MoveNext Wend oRsAlbum.MoveNext Wend ' always call Close when done reading. oConn.Close Set oConn = Nothing ' return the XML GetSearchResults = oResponse.ToXml End Function Public Function DisplayResults(ByVal strXmlResponse As String) Dim oResponse As MusicStoreLib.SearchResponse Dim oAlbum As MusicStoreLib.AlbumType Dim oTrack As MusicStoreLib.TrackType ' create an instance of the class to load the XML file into Set oResponse = New MusicStoreLib.SearchResponse ' load the xml from a file into the object (the root element in the ' xml document must be <;SearchResponse>. oResponse.FromXml strXmlResponse If oResponse.ChoiceSelectedElement = "Result" Then Debug.Print "Query Was Executes " &; oResponse.Result.SearchDate For Each oAlbum In oResponse.Result.Product ' ouput each album that was found Debug.Print "Artist Name : " &; oAlbum.ArtistName Debug.Print "Album Title : " &; oAlbum.AlbumName Debug.Print "Product Code : " &; oAlbum.ProductCode Debug.Print "Record Label : " &; oAlbum.Label If oAlbum.IsValidRRP Then Debug.Print "Price : " &; oAlbum.RRP End If ' output the tracks For Each oTrack In oAlbum.Track Debug.Print " Track Name: " &; oTrack.Title & " (" & oTrack.length.Minutes & ":" & oTrack.length.Seconds & ")" Next oTrack Next oAlbum ElseIf oResponse.ChoiceSelectedElement = "Error" Then Debug.Print "An Error Occured" Debug.Print "Error Code : " &; oResponse.Error_.ErrorCode Debug.Print "Descritpion : " &; oResponse.Error_.ErrorDescription If oResponse.Error_.IsValidHelpFile Then Debug.Print "Help File : " &; oResponse.Error_.HelpFile End If Else ' error - should always have a result or an error End If End Function
|
MusicStore.xsd |
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="SearchRequest"> <xs:complexType> <xs:sequence> <xs:element name="PriceFilter"> <xs:complexType> <xs:sequence> <xs:element name="MinPrice" type="xs:double" minOccurs="0"/> <xs:element name="MaxPrice" type="xs:double" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="NameFilter" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="SearchResponse"> <xs:complexType> <xs:choice> <xs:element name="Result"> <xs:complexType> <xs:sequence> <xs:element name="SearchDate" type="xs:date"/> <xs:element name="Product" type="AlbumType" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Error"> <xs:complexType> <xs:sequence> <xs:element name="ErrorCode" type="xs:int"/> <xs:element name="ErrorDescription" type="xs:string"/> <xs:element name="HelpFile" type="xs:string" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element> </xs:choice> </xs:complexType> </xs:element> <xs:complexType name="AlbumType"> <xs:sequence> <xs:element name="AlbumName" type="xs:string"/> <xs:element name="ArtistName" type="xs:string"/> <xs:element name="Track" type="TrackType" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="Label" type="xs:string" use="required"/> <xs:attribute name="RRP" type="xs:double"/> <xs:attribute name="ProductCode" use="required"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:length value="15"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> <xs:complexType name="CompactDiskType"> <xs:sequence> <xs:element name="Title" type="xs:string" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType name="TrackType"> <xs:sequence> <xs:element name="Title" type="xs:string"/> <xs:element name="Length" type="xs:duration"/> </xs:sequence> </xs:complexType> </xs:schema> |
Schema Diagrams |
|
AlbumType.cls |
VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject END Attribute VB_Name = "AlbumType" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Option Explicit '********************************************************************************************** '* Copyright (c) 2001-2023 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: MusicStore.xsd '********************************************************************************************** Private m_ElementName As String Private mvarLabel As String Private mvarIsValidRRP As Boolean Private mvarRRP As Double Private mvarProductCode As String Private mvarAlbumName As String Private mvarArtistName As String Private WithEvents mvarTrack As MusicStoreLib.TrackTypeCol ' ##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 LtXmlComLib20.XmlObjectBase Implements LtXmlComLib20.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 Label As String Label = mvarLabel End Property Public Property Let Label(ByVal value As String) ' Apply whitespace rules appropriately value = LtXmlComLib20.WhitespaceUtils.PreserveWhitespace(value) mvarLabel = value End Property ' Summary: ' Represents an optional Attribute in the XML document ' ' Remarks: ' ' This property is represented as an Attribute in the XML. ' It is optional, initially it is not valid. Public Property Get RRP As Double if mvarIsValidRRP = false then Err.Raise ERR_INVALID_STATE, "AlbumType.RRP", "The Property RRP is not valid. Set RRPValid = true" end if RRP = mvarRRP End Property Public Property Let RRP(ByVal value As Double) mvarIsValidRRP = true mvarRRP = value End Property ' Summary: ' Indicates if RRP contains a valid value. ' Remarks: ' true if the value for RRP is valid, false if not. ' If this is set to true then the property is considered valid, and assigned its ' default value (0). ' If its set to false then its made invalid, and subsequent calls to get RRP ' will raise an exception. Public Property Get IsValidRRP As Boolean IsValidRRP = mvarIsValidRRP End Property Public Property Let IsValidRRP(ByVal value As Boolean) if value <> mvarIsValidRRP then mvarRRP = LtXmlComLib20.Conversions.r8FromString("0", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Collapse) mvarIsValidRRP = value End if 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 ProductCode As String ProductCode = mvarProductCode End Property Public Property Let ProductCode(ByVal value As String) ' Apply whitespace rules appropriately value = LtXmlComLib20.WhitespaceUtils.PreserveWhitespace(value) g_ClsDataAlbumType.CheckAttributeRestriction 3, value mvarProductCode = 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 AlbumName As String AlbumName = mvarAlbumName End Property Public Property Let AlbumName(ByVal value As String) ' Apply whitespace rules appropriately value = LtXmlComLib20.WhitespaceUtils.PreserveWhitespace(value) mvarAlbumName = 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 ArtistName As String ArtistName = mvarArtistName End Property Public Property Let ArtistName(ByVal value As String) ' Apply whitespace rules appropriately value = LtXmlComLib20.WhitespaceUtils.PreserveWhitespace(value) mvarArtistName = value End Property ' Summary: ' A collection of Tracks ' ' Remarks: ' ' This property is represented as an Element in the XML. ' This collection may contain 1 to Many objects. Public Property Get Track As MusicStoreLib.TrackTypeCol Set Track = mvarTrack End Property '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''' Standard Methods ''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Sub ToXmlFile(ByVal FileName As String, Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib20.XmlFormatting = LtXmlComLib20.XmlFormatting_Indented, Optional encoding As LtXmlComLib20.XmlEncoding = LtXmlComLib20.XmlEncoding_UTF8, Optional EOL As LtXmlComLib20.EOLType = LtXmlComLib20.EOLType.EOLType_CRLF, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) RegisterProduct LtXmlComLib20.XmlObjectBaseHelper.ToXmlFile Me, FileName, includeDocHeader, formatting, encoding, EOL, context End Sub Public Function ToXml(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib20.XmlFormatting = LtXmlComLib20.XmlFormatting_Indented, Optional EOL As LtXmlComLib20.EOLType = LtXmlComLib20.EOLType.EOLType_LF, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) As String RegisterProduct ToXml = LtXmlComLib20.XmlObjectBaseHelper.ToXml(Me, includeDocHeader, formatting, EOL, context) End Function Public Function ToXmlStream(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib20.XmlFormatting = LtXmlComLib20.XmlFormatting_Indented, Optional encoding As LtXmlComLib20.XmlEncoding = LtXmlComLib20.XmlEncoding_UTF8, Optional EOL As LtXmlComLib20.EOLType = LtXmlComLib20.EOLType.EOLType_LF, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) As Variant RegisterProduct ToXmlStream = LtXmlComLib20.XmlObjectBaseHelper.ToXmlStream(Me, includeDocHeader, formatting, encoding, EOL, context) End Function Public Sub FromXml(ByVal xmlIn As String, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) RegisterProduct LtXmlComLib20.XmlObjectBaseHelper.FromXml Me, xmlIn, context End Sub Public Sub FromXmlFile(ByVal FileName As String, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) RegisterProduct LtXmlComLib20.XmlObjectBaseHelper.FromXmlFile Me, FileName, context End Sub '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''' Private Methods '''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Summary: ' Constructor for AlbumType ' 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 MusicStore.xsd Private Sub Class_Initialize() m_elementName = "AlbumType" 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 = "AlbumType" _ 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 LtXmlComLib20.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 LtXmlComLib20.XmlTextWriter, ByVal bRegisterNamespaces As Boolean, ByVal NamespaceUri As String, ByVal context As LtXmlComLib20.XmlSerializationContext, ByVal isOptionalChoice As Boolean) XmlGeneratedClassHelper.ToXml Me, xmlOut, bRegisterNamespaces, NamespaceUri, context, isOptionalChoice End Sub Private Sub XmlObjectBase_AttributesToXmlInt(ByVal xmlOut As LtXmlComLib20.XmlTextWriter, ByVal context As LtXmlComLib20.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 MusicStore.xsd. Private Sub XmlGeneratedClass_Init() mvarLabel = LtXmlComLib20.Conversions.stringFromString("", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Preserve) mvarRRP = LtXmlComLib20.Conversions.r8FromString("0", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Collapse) mvarIsValidRRP = False mvarProductCode = LtXmlComLib20.Conversions.stringFromString("", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Preserve) mvarAlbumName = LtXmlComLib20.Conversions.stringFromString("", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Preserve) mvarArtistName = LtXmlComLib20.Conversions.stringFromString("", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Preserve) Set mvarTrack = CF.CreateClassCollection(ClsName_TrackTypeCol, "Track", "", 1, -1) ' Force Init ClassInfo Dim classInfo As LtXmlComLib20.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 LtXmlComLib20.ClassInfo If g_ClsDataAlbumType Is Nothing Then Set g_ClsDataAlbumType = New LtXmlComLib20.ClassInfo g_ClsDataAlbumType.GroupType = LtXmlComLib20.XmlGroupType.Sequence g_ClsDataAlbumType.ElementType = LtXmlComLib20.XmlElementType.Element g_ClsDataAlbumType.ElementName = "AlbumType" g_ClsDataAlbumType.ElementNamespaceURI = "" g_ClsDataAlbumType.FromXmlFailIfAttributeUnknown = true g_ClsDataAlbumType.IsClassDerived = false g_ClsDataAlbumType.PrimitiveDataType = LtXmlComLib20.XmlDataType.type_none g_ClsDataAlbumType.PrimitiveFormatOverride = "" g_ClsDataAlbumType.OutputPrimitiveClassAsTextProperty = False Set g_ClsDataAlbumType.ClassFactory = General.CF g_ClsDataAlbumType.AddElmSeqPrimMnd "AlbumName", "", "AlbumName", XmlDataType.type_string, "", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Preserve, "", -1, -1, "", "", "", "", -1 g_ClsDataAlbumType.AddElmSeqPrimMnd "ArtistName", "", "ArtistName", XmlDataType.type_string, "", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Preserve, "", -1, -1, "", "", "", "", -1 g_ClsDataAlbumType.AddElmSeqClsCol "Track", "", "Track", LtXmlComLib20.XmlElementType.Element g_ClsDataAlbumType.AddAttrPrimitive "Label", "", "Label", "", false, XmlDataType.type_string, "", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Preserve, "", -1, -1, "", "", "", "", -1, vbNullString g_ClsDataAlbumType.AddAttrPrimitive "RRP", "", "RRP", "IsValidRRP", true, XmlDataType.type_r8, "", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Collapse, "", -1, -1, "", "", "", "", -1, vbNullString g_ClsDataAlbumType.AddAttrPrimitive "ProductCode", "", "ProductCode", "", false, XmlDataType.type_string, "", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Preserve, "", -1, -1, "", "", "", "", 15, vbNullString End If Set XmlGeneratedClass_ClassInfo = g_ClsDataAlbumType 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 |
AlbumTypeCol.cls |
VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject END Attribute VB_Name = "AlbumTypeCol" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Option Explicit '********************************************************************************************** '* Copyright (c) 2001-2023 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: MusicStore.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 LtXmlComLib20.XmlCollectionBase Implements LtXmlComLib20.XmlObjectBase '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''' Collection Methods '''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Summary: ' Adds a AlbumType 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 MusicStoreLib.AlbumType, optional Before, optional After) as MusicStoreLib.AlbumType CastToXmlObjectBase(newCls).PrivateSetElementName m_elementName ' LtXmlComLib20.XmlObjectBaseHelper.Throw_IfElementNameDiffers newCls, m_elementName m_coll.Add newCls, , Before, After RaiseEvent OnCollectionChange Set Add = newCls End Function ' Summary: ' Adds a AlbumType object to the collection ' Returns: ' The newly created AlbumType object ' Remarks: ' A new AlbumType object is created and added to the collection ' the new object is then returned. public Function AddNew() as MusicStoreLib.AlbumType Set AddNew = CF.CreateClass(ClsName_AlbumType) CastToXmlObjectBase(AddNew).PrivateSetElementName m_elementName m_coll.Add AddNew RaiseEvent OnCollectionChange End Function ' Summary: ' Gets a AlbumType 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 MusicStoreLib.AlbumType 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 = "AlbumType" _ 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 LtXmlComLib20.XmlTextWriter, ByVal oContext As LtXmlComLib20.XmlSerializationContext) dim oCls as LtXmlComLib20.XmlObjectBase for each oCls in m_coll CastToXmlObjectBase(oCls).AttributesToXmlInt xmlOut, oContext next End Sub Private Sub XmlObjectBase_ToXmlInt(ByVal xmlOut As LtXmlComLib20.XmlTextWriter, ByVal bRegisterNamespaces As Boolean, ByVal NamespaceURI As String, ByVal oContext As LtXmlComLib20.XmlSerializationContext, ByVal isOptionalChoice As Boolean) dim oCls as LtXmlComLib20.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 LtXmlComLib20.XmlSerializationContext, ByVal isOptionalChoice As Boolean) As MSXML2.IXMLDOMElement Dim newObj as MusicStoreLib.AlbumType ' 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 LtXmlComLib20.XmlGeneratedClassHelper.DoesElementNameMatch(oContext, xmlChild, m_elementName, m_elementNamespaceUri) = False then exit do Set newObj = CF.CreateNamedClass(ClsName_AlbumType, m_elementName) CastToXmlObjectBase(newObj).FromXmlInt xmlChild, LtXmlComLib20.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 = LtXmlComLib20.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 |
ClassFactory.cls |
VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject END Attribute VB_Name = "ClassFactory" Attribute VB_GlobalNameSpace = True Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Option Explicit '********************************************************************************************** '* Copyright (c) 2001-2023 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: MusicStore.xsd '********************************************************************************************** Private mvarEnumConverter as new EnumConversions ' ##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 enum MusicStoreLib_Classes ClsName_NONE ClsName_AlbumType ClsName_Error_ ClsName_PriceFilter ClsName_Result ClsName_SearchRequest ClsName_SearchResponse ClsName_TrackType ClsName_AlbumTypeCol ClsName_TrackTypeCol End Enum Public Function CreateClass(ByVal eCls as MusicStoreLib_Classes) as LtXmlComLib20.XmlObjectBase ' This is structured like this to get around compiler limitations if eCls = ClsName_NONE then Err.Raise 1, "ClassFactory", "Invalid Class (NONE)" end if Select Case (eCls) case ClsName_AlbumType Set CreateClass = new MusicStoreLib.AlbumType case ClsName_Error_ Set CreateClass = new MusicStoreLib.Error_ case ClsName_PriceFilter Set CreateClass = new MusicStoreLib.PriceFilter case ClsName_Result Set CreateClass = new MusicStoreLib.Result case ClsName_SearchRequest Set CreateClass = new MusicStoreLib.SearchRequest case ClsName_SearchResponse Set CreateClass = new MusicStoreLib.SearchResponse case ClsName_TrackType Set CreateClass = new MusicStoreLib.TrackType case else Err.Raise 2, "ClassFactory", "Unknown Class id" End Select Debug.Assert not CreateClass is nothing End Function Public Function CreateNamedClass(byval eCls as MusicStoreLib_Classes, byval strElementName as String) as LtXmlComLib20.XmlObjectBase ' This is structured like this to get around compiler limitations if eCls = ClsName_NONE then Err.Raise 1, "ClassFactory", "Invalid Class (NONE)" end if Select Case (eCls) case ClsName_AlbumType Set CreateNamedClass = new MusicStoreLib.AlbumType case ClsName_Error_ Set CreateNamedClass = new MusicStoreLib.Error_ case ClsName_PriceFilter Set CreateNamedClass = new MusicStoreLib.PriceFilter case ClsName_Result Set CreateNamedClass = new MusicStoreLib.Result case ClsName_SearchRequest Set CreateNamedClass = new MusicStoreLib.SearchRequest case ClsName_SearchResponse Set CreateNamedClass = new MusicStoreLib.SearchResponse case ClsName_TrackType Set CreateNamedClass = new MusicStoreLib.TrackType case else Err.Raise 2, "ClassFactory", "Unknown Class id" End Select Debug.Assert not CreateNamedClass is nothing CreateNamedClass.PrivateSetElementName strElementName End Function Public Function CreateClassCollection(byval eCls as MusicStoreLib_Classes, byval strElementName as string, byval strElementNamespaceUri as string, byval iMinOccurs as long, byval iMaxOccurs as long ) as LtXmlComLib20.XmlCollectionBase Select Case(eCls) case ClsName_NONE Err.Raise ERR_INVALID_VALUE, "CreateClassCollection", "Invalid Class (NONE)" case ClsName_AlbumTypeCol Set CreateClassCollection = new AlbumTypeCol case ClsName_TrackTypeCol Set CreateClassCollection = new TrackTypeCol case else Err.Raise ERR_INVALID_VALUE, "CreateClassCollection", "Unknown Collection Class id" End Select CreateClassCollection.Init strElementName, strElementNamespaceUri, iMinOccurs, iMaxOccurs end Function Public Function CreateEnumCollection(byval eCls as MusicStoreLib_Classes , byval strElementNamespace as string, byval strElementName as string, byval iMinOccurs as long, byval iMaxOccurs as long ) as LtXmlComLib20.XmlCollectionBase Select Case(eCls) case ClsName_NONE Err.Raise ERR_INVALID_VALUE, "CreateEnumCollection", "Invalid Class (NONE)" case else Err.Raise ERR_INVALID_VALUE, "CreateEnumCollection", "Unknown Collection Class id" End Select CreateEnumCollection.Init strElementName, strElementNamespace, iMinOccurs, iMaxOccurs end Function Public Property Get EnumConverter as EnumConversions Set EnumConverter = mvarEnumConverter End Property Public Function FromXml( ByVal xmlIn As String, Optional oContext As LtXmlComLib20.XmlSerializationContext = Nothing ) as Object Dim oDoc As New MSXML2.DOMDocument60 oDoc.validateOnParse = False oDoc.PreserveWhitespace = True If oDoc.loadXML(xmlIn) = False Then Err.Raise 103, "XmlObjectBase", "Failed to parse XML" & vbCrLf & oDoc.parseError.reason End If Set FromXml = FromXmlElement(oDoc.documentElement, oContext) End Function Public Function FromXmlFile( ByVal FileName As String, Optional oContext As LtXmlComLib20.XmlSerializationContext = Nothing ) as Object Dim oDoc As New MSXML2.DOMDocument60 oDoc.validateOnParse = False oDoc.PreserveWhitespace = True If oDoc.load(FileName) = False Then Err.Raise 103, "XmlObjectBase", "Failed to parse XML File " & FileName & vbCrLf & oDoc.parseError.reason End If Set FromXmlFile = FromXmlElement(oDoc.documentElement, oContext) End Function Public Function FromXmlElement(ByVal oXmlElmParent As MSXML2.IXMLDOMElement, Optional oContext As LtXmlComLib20.XmlSerializationContext = Nothing) As Object Dim elementName As String Dim elementNamespaceUri As String If oContext Is Nothing Then Set oContext = DefaultXmlSerializationContext ' Get the type name this is either ' from the element i.e. <Parent>... = Parent ' or from the type i.e. <Parent xsi:type="someNS:SomeElement">... = SomeElement If LtXmlComLib20.XmlObjectBaseHelper.GetElementType(oXmlElmParent) = "" Then elementName = oXmlElmParent.baseName elementNamespaceUri = oXmlElmParent.NamespaceURI Else elementName = LtXmlComLib20.XmlObjectBaseHelper.GetElementType(oXmlElmParent) elementNamespaceUri = oXmlElmParent.NamespaceURI End If ' create the appropriate object If elementName = "" Then Err.Raise 103, "FromXmlElement", "The element to load has no name" ElseIf elementName = "AlbumType" And elementNamespaceUri = "" Then Set FromXmlElement = New MusicStoreLib.AlbumType ElseIf elementName = "Error" And elementNamespaceUri = "" Then Set FromXmlElement = New MusicStoreLib.Error_ ElseIf elementName = "PriceFilter" And elementNamespaceUri = "" Then Set FromXmlElement = New MusicStoreLib.PriceFilter ElseIf elementName = "Result" And elementNamespaceUri = "" Then Set FromXmlElement = New MusicStoreLib.Result ElseIf elementName = "SearchRequest" And elementNamespaceUri = "" Then Set FromXmlElement = New MusicStoreLib.SearchRequest ElseIf elementName = "SearchResponse" And elementNamespaceUri = "" Then Set FromXmlElement = New MusicStoreLib.SearchResponse ElseIf elementName = "TrackType" And elementNamespaceUri = "" Then Set FromXmlElement = New MusicStoreLib.TrackType Else Err.Raise 103, "FromXmlElement", "Failed load the element " & elementName & ". No appropriate class exists to load the data into. Ensure that the XML document complies with the schema." End If ' load the data into the object Dim oBaseClass As LtXmlComLib20.XmlObjectBase Set oBaseClass = FromXmlElement oBaseClass.FromXmlInt oXmlElmParent, XmlObjectBaseHelper.FindFirstSliblingElement(oXmlElmParent.firstChild), oContext, False End Function ' ##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 |
EnumConversions.cls |
VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject END Attribute VB_Name = "EnumConversions" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Option Explicit '********************************************************************************************** '* Copyright (c) 2001-2023 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: MusicStore.xsd '********************************************************************************************** ' ##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 |
Enumerations.cls |
VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject END Attribute VB_Name = "Enumerations" Attribute VB_GlobalNameSpace = True Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Option Explicit '********************************************************************************************** '* Copyright (c) 2001-2023 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: MusicStore.xsd '********************************************************************************************** ' ##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 ' ##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 |
Error_.cls |
VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject END Attribute VB_Name = "Error_" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Option Explicit '********************************************************************************************** '* Copyright (c) 2001-2023 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: MusicStore.xsd '********************************************************************************************** Private m_ElementName As String Private mvarErrorCode As Long Private mvarErrorDescription As String Private mvarIsValidHelpFile As Boolean Private mvarHelpFile 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 LtXmlComLib20.XmlObjectBase Implements LtXmlComLib20.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 ErrorCode As Long ErrorCode = mvarErrorCode End Property Public Property Let ErrorCode(ByVal value As Long) mvarErrorCode = 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 ErrorDescription As String ErrorDescription = mvarErrorDescription End Property Public Property Let ErrorDescription(ByVal value As String) ' Apply whitespace rules appropriately value = LtXmlComLib20.WhitespaceUtils.PreserveWhitespace(value) mvarErrorDescription = 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 HelpFile As String if mvarIsValidHelpFile = false then Err.Raise ERR_INVALID_STATE, "Error_.HelpFile", "The Property HelpFile is not valid. Set HelpFileValid = true" end if HelpFile = mvarHelpFile End Property Public Property Let HelpFile(ByVal value As String) ' Apply whitespace rules appropriately value = LtXmlComLib20.WhitespaceUtils.PreserveWhitespace(value) mvarIsValidHelpFile = true mvarHelpFile = value End Property ' Summary: ' Indicates if HelpFile contains a valid value. ' Remarks: ' true if the value for HelpFile 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 HelpFile ' will raise an exception. Public Property Get IsValidHelpFile As Boolean IsValidHelpFile = mvarIsValidHelpFile End Property Public Property Let IsValidHelpFile(ByVal value As Boolean) if value <> mvarIsValidHelpFile then mvarHelpFile = LtXmlComLib20.Conversions.stringFromString("", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Preserve) mvarIsValidHelpFile = value End if End Property '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''' Standard Methods ''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Sub ToXmlFile(ByVal FileName As String, Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib20.XmlFormatting = LtXmlComLib20.XmlFormatting_Indented, Optional encoding As LtXmlComLib20.XmlEncoding = LtXmlComLib20.XmlEncoding_UTF8, Optional EOL As LtXmlComLib20.EOLType = LtXmlComLib20.EOLType.EOLType_CRLF, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) RegisterProduct LtXmlComLib20.XmlObjectBaseHelper.ToXmlFile Me, FileName, includeDocHeader, formatting, encoding, EOL, context End Sub Public Function ToXml(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib20.XmlFormatting = LtXmlComLib20.XmlFormatting_Indented, Optional EOL As LtXmlComLib20.EOLType = LtXmlComLib20.EOLType.EOLType_LF, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) As String RegisterProduct ToXml = LtXmlComLib20.XmlObjectBaseHelper.ToXml(Me, includeDocHeader, formatting, EOL, context) End Function Public Function ToXmlStream(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib20.XmlFormatting = LtXmlComLib20.XmlFormatting_Indented, Optional encoding As LtXmlComLib20.XmlEncoding = LtXmlComLib20.XmlEncoding_UTF8, Optional EOL As LtXmlComLib20.EOLType = LtXmlComLib20.EOLType.EOLType_LF, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) As Variant RegisterProduct ToXmlStream = LtXmlComLib20.XmlObjectBaseHelper.ToXmlStream(Me, includeDocHeader, formatting, encoding, EOL, context) End Function Public Sub FromXml(ByVal xmlIn As String, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) RegisterProduct LtXmlComLib20.XmlObjectBaseHelper.FromXml Me, xmlIn, context End Sub Public Sub FromXmlFile(ByVal FileName As String, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) RegisterProduct LtXmlComLib20.XmlObjectBaseHelper.FromXmlFile Me, FileName, context End Sub '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''' Private Methods '''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Summary: ' Constructor for Error_ ' 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 MusicStore.xsd Private Sub Class_Initialize() m_elementName = "Error" 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 = "Error_" _ 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 LtXmlComLib20.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 LtXmlComLib20.XmlTextWriter, ByVal bRegisterNamespaces As Boolean, ByVal NamespaceUri As String, ByVal context As LtXmlComLib20.XmlSerializationContext, ByVal isOptionalChoice As Boolean) XmlGeneratedClassHelper.ToXml Me, xmlOut, bRegisterNamespaces, NamespaceUri, context, isOptionalChoice End Sub Private Sub XmlObjectBase_AttributesToXmlInt(ByVal xmlOut As LtXmlComLib20.XmlTextWriter, ByVal context As LtXmlComLib20.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 MusicStore.xsd. Private Sub XmlGeneratedClass_Init() mvarErrorCode = LtXmlComLib20.Conversions.i4FromString("0", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Collapse) mvarErrorDescription = LtXmlComLib20.Conversions.stringFromString("", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Preserve) mvarHelpFile = LtXmlComLib20.Conversions.stringFromString("", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Preserve) mvarIsValidHelpFile = false ' Force Init ClassInfo Dim classInfo As LtXmlComLib20.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 LtXmlComLib20.ClassInfo If g_ClsDataError_ Is Nothing Then Set g_ClsDataError_ = New LtXmlComLib20.ClassInfo g_ClsDataError_.GroupType = LtXmlComLib20.XmlGroupType.Sequence g_ClsDataError_.ElementType = LtXmlComLib20.XmlElementType.Element g_ClsDataError_.ElementName = "Error" g_ClsDataError_.ElementNamespaceURI = "" g_ClsDataError_.FromXmlFailIfAttributeUnknown = true g_ClsDataError_.IsClassDerived = false g_ClsDataError_.PrimitiveDataType = LtXmlComLib20.XmlDataType.type_none g_ClsDataError_.PrimitiveFormatOverride = "" g_ClsDataError_.OutputPrimitiveClassAsTextProperty = False Set g_ClsDataError_.ClassFactory = General.CF g_ClsDataError_.AddElmSeqPrimMnd "ErrorCode", "", "ErrorCode", XmlDataType.type_i4, "", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Collapse, "", -1, -1, "", "", "", "", -1 g_ClsDataError_.AddElmSeqPrimMnd "ErrorDescription", "", "ErrorDescription", XmlDataType.type_string, "", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Preserve, "", -1, -1, "", "", "", "", -1 g_ClsDataError_.AddElmSeqPrimOpt "HelpFile", "", "HelpFile", "IsValidHelpFile", XmlDataType.type_string, "", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Preserve, "", -1, -1, "", "", "", "", -1 End If Set XmlGeneratedClass_ClassInfo = g_ClsDataError_ 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 |
General.bas |
Option Explicit '********************************************************************************************** '* Copyright (c) 2001-2021 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: MusicStore.xsd '********************************************************************************************** Public Const ERR_TO_XML_FAILED = 1 Public Const ERR_PARSING_XML = 2 Public Const ERR_UNEXPECTED_ATTRIBUTE = 3 Public Const ERR_MISSING_ATTRIBUTE = 4 Public Const ERR_MISSING_ELEMENT = 5 Public Const ERR_UNEXPECTED_ELEMENT = 6 Public Const ERR_INVALID_STATE = 7 Public Const ERR_PROHIBITED_PROPERTY = 8 Public Const ERR_INVALID_VALUE = 9 Public Const ERR_INVALID_COUNT = 10 private m_ClassFactory as MusicStoreLib.ClassFactory Public g_ClsDataAlbumType as LtXmlComLib20.ClassInfo Public g_ClsDataError_ as LtXmlComLib20.ClassInfo Public g_ClsDataPriceFilter as LtXmlComLib20.ClassInfo Public g_ClsDataResult as LtXmlComLib20.ClassInfo Public g_ClsDataSearchRequest as LtXmlComLib20.ClassInfo Public g_ClsDataSearchResponse as LtXmlComLib20.ClassInfo Public g_ClsDataTrackType as LtXmlComLib20.ClassInfo ' ##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 Function CF() as MusicStoreLib.ClassFactory If m_ClassFactory Is Nothing Then Set m_ClassFactory = New MusicStoreLib.ClassFactory ' ##HAND_CODED_BLOCK_START ID="Default Namespace Declarations"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS ' Add Additional namespace declarations here... LtXmlComLib20.DefaultXmlSerializationContext.SchemaType = LtXmlComLib20.SchemaType_XSD ' LtXmlComLib20.DefaultXmlSerializationContext.DefaultNamespaceURI = "http://www.fpml.org/2003/FpML-4-0" ' LtXmlComLib20.DefaultXmlSerializationContext.NamespaceAliases.Add "http://www.w3.org/2000/09/xmldsig#", "dsig" LtXmlComLib20.DefaultXmlSerializationContext.NamespaceAliases.Add "http://www.w3.org/2001/XMLSchema-instance", "xs" ' ##HAND_CODED_BLOCK_END ID="Default Namespace Declarations"## DO NOT MODIFY ANYTHING OUTSIDE OF THESE TAGS End If Set CF = m_ClassFactory End Function public Function CastToXmlObjectBase(ByVal obj as LtXmlComLib20.XmlObjectBase) as LtXmlComLib20.XmlObjectBase set CastToXmlObjectBase = obj End Function public Function CastToXmlCollectionBase(ByVal obj as LtXmlComLib20.XmlCollectionBase) as LtXmlComLib20.XmlCollectionBase set CastToXmlCollectionBase = obj End Function Public Sub RegisterProduct() LtXmlComLib20.Register "Liquid Technologies Ltd ", "MusicStore.xsd", "0V49TPHN71C2L45A000000AA" End Sub ' ##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 |
PriceFilter.cls |
VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject END Attribute VB_Name = "PriceFilter" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Option Explicit '********************************************************************************************** '* Copyright (c) 2001-2023 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: MusicStore.xsd '********************************************************************************************** Private m_ElementName As String Private mvarIsValidMinPrice As Boolean Private mvarMinPrice As Double Private mvarIsValidMaxPrice As Boolean Private mvarMaxPrice As Double ' ##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 LtXmlComLib20.XmlObjectBase Implements LtXmlComLib20.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 not valid. Public Property Get MinPrice As Double if mvarIsValidMinPrice = false then Err.Raise ERR_INVALID_STATE, "PriceFilter.MinPrice", "The Property MinPrice is not valid. Set MinPriceValid = true" end if MinPrice = mvarMinPrice End Property Public Property Let MinPrice(ByVal value As Double) mvarIsValidMinPrice = true mvarMinPrice = value End Property ' Summary: ' Indicates if MinPrice contains a valid value. ' Remarks: ' true if the value for MinPrice is valid, false if not. ' If this is set to true then the property is considered valid, and assigned its ' default value (0). ' If its set to false then its made invalid, and subsequent calls to get MinPrice ' will raise an exception. Public Property Get IsValidMinPrice As Boolean IsValidMinPrice = mvarIsValidMinPrice End Property Public Property Let IsValidMinPrice(ByVal value As Boolean) if value <> mvarIsValidMinPrice then mvarMinPrice = LtXmlComLib20.Conversions.r8FromString("0", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Collapse) mvarIsValidMinPrice = 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 MaxPrice As Double if mvarIsValidMaxPrice = false then Err.Raise ERR_INVALID_STATE, "PriceFilter.MaxPrice", "The Property MaxPrice is not valid. Set MaxPriceValid = true" end if MaxPrice = mvarMaxPrice End Property Public Property Let MaxPrice(ByVal value As Double) mvarIsValidMaxPrice = true mvarMaxPrice = value End Property ' Summary: ' Indicates if MaxPrice contains a valid value. ' Remarks: ' true if the value for MaxPrice is valid, false if not. ' If this is set to true then the property is considered valid, and assigned its ' default value (0). ' If its set to false then its made invalid, and subsequent calls to get MaxPrice ' will raise an exception. Public Property Get IsValidMaxPrice As Boolean IsValidMaxPrice = mvarIsValidMaxPrice End Property Public Property Let IsValidMaxPrice(ByVal value As Boolean) if value <> mvarIsValidMaxPrice then mvarMaxPrice = LtXmlComLib20.Conversions.r8FromString("0", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Collapse) mvarIsValidMaxPrice = value End if End Property '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''' Standard Methods ''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Sub ToXmlFile(ByVal FileName As String, Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib20.XmlFormatting = LtXmlComLib20.XmlFormatting_Indented, Optional encoding As LtXmlComLib20.XmlEncoding = LtXmlComLib20.XmlEncoding_UTF8, Optional EOL As LtXmlComLib20.EOLType = LtXmlComLib20.EOLType.EOLType_CRLF, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) RegisterProduct LtXmlComLib20.XmlObjectBaseHelper.ToXmlFile Me, FileName, includeDocHeader, formatting, encoding, EOL, context End Sub Public Function ToXml(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib20.XmlFormatting = LtXmlComLib20.XmlFormatting_Indented, Optional EOL As LtXmlComLib20.EOLType = LtXmlComLib20.EOLType.EOLType_LF, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) As String RegisterProduct ToXml = LtXmlComLib20.XmlObjectBaseHelper.ToXml(Me, includeDocHeader, formatting, EOL, context) End Function Public Function ToXmlStream(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib20.XmlFormatting = LtXmlComLib20.XmlFormatting_Indented, Optional encoding As LtXmlComLib20.XmlEncoding = LtXmlComLib20.XmlEncoding_UTF8, Optional EOL As LtXmlComLib20.EOLType = LtXmlComLib20.EOLType.EOLType_LF, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) As Variant RegisterProduct ToXmlStream = LtXmlComLib20.XmlObjectBaseHelper.ToXmlStream(Me, includeDocHeader, formatting, encoding, EOL, context) End Function Public Sub FromXml(ByVal xmlIn As String, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) RegisterProduct LtXmlComLib20.XmlObjectBaseHelper.FromXml Me, xmlIn, context End Sub Public Sub FromXmlFile(ByVal FileName As String, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) RegisterProduct LtXmlComLib20.XmlObjectBaseHelper.FromXmlFile Me, FileName, context End Sub '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''' Private Methods '''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Summary: ' Constructor for PriceFilter ' 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 MusicStore.xsd Private Sub Class_Initialize() m_elementName = "PriceFilter" 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 = "PriceFilter" _ 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 LtXmlComLib20.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 LtXmlComLib20.XmlTextWriter, ByVal bRegisterNamespaces As Boolean, ByVal NamespaceUri As String, ByVal context As LtXmlComLib20.XmlSerializationContext, ByVal isOptionalChoice As Boolean) XmlGeneratedClassHelper.ToXml Me, xmlOut, bRegisterNamespaces, NamespaceUri, context, isOptionalChoice End Sub Private Sub XmlObjectBase_AttributesToXmlInt(ByVal xmlOut As LtXmlComLib20.XmlTextWriter, ByVal context As LtXmlComLib20.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 MusicStore.xsd. Private Sub XmlGeneratedClass_Init() mvarMinPrice = LtXmlComLib20.Conversions.r8FromString("0", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Collapse) mvarIsValidMinPrice = false mvarMaxPrice = LtXmlComLib20.Conversions.r8FromString("0", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Collapse) mvarIsValidMaxPrice = false ' Force Init ClassInfo Dim classInfo As LtXmlComLib20.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 LtXmlComLib20.ClassInfo If g_ClsDataPriceFilter Is Nothing Then Set g_ClsDataPriceFilter = New LtXmlComLib20.ClassInfo g_ClsDataPriceFilter.GroupType = LtXmlComLib20.XmlGroupType.Sequence g_ClsDataPriceFilter.ElementType = LtXmlComLib20.XmlElementType.Element g_ClsDataPriceFilter.ElementName = "PriceFilter" g_ClsDataPriceFilter.ElementNamespaceURI = "" g_ClsDataPriceFilter.FromXmlFailIfAttributeUnknown = true g_ClsDataPriceFilter.IsClassDerived = false g_ClsDataPriceFilter.PrimitiveDataType = LtXmlComLib20.XmlDataType.type_none g_ClsDataPriceFilter.PrimitiveFormatOverride = "" g_ClsDataPriceFilter.OutputPrimitiveClassAsTextProperty = False Set g_ClsDataPriceFilter.ClassFactory = General.CF g_ClsDataPriceFilter.AddElmSeqPrimOpt "MinPrice", "", "MinPrice", "IsValidMinPrice", XmlDataType.type_r8, "", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Collapse, "", -1, -1, "", "", "", "", -1 g_ClsDataPriceFilter.AddElmSeqPrimOpt "MaxPrice", "", "MaxPrice", "IsValidMaxPrice", XmlDataType.type_r8, "", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Collapse, "", -1, -1, "", "", "", "", -1 End If Set XmlGeneratedClass_ClassInfo = g_ClsDataPriceFilter 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 |
Result.cls |
VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject END Attribute VB_Name = "Result" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Option Explicit '********************************************************************************************** '* Copyright (c) 2001-2023 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: MusicStore.xsd '********************************************************************************************** Private m_ElementName As String Private mvarSearchDate As LtXmlComLib20.DateTime Private WithEvents mvarProduct As MusicStoreLib.AlbumTypeCol ' ##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 LtXmlComLib20.XmlObjectBase Implements LtXmlComLib20.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 1900-01-01. Public Property Get SearchDate As LtXmlComLib20.DateTime Set SearchDate = mvarSearchDate End Property Public Property Set SearchDate(ByVal value As LtXmlComLib20.DateTime) mvarSearchDate.SetDateTimeWithType value, mvarSearchDate.dateType End Property ' Summary: ' A collection of Products ' ' Remarks: ' ' This property is represented as an Element in the XML. ' This collection may contain 0 to Many objects. Public Property Get Product As MusicStoreLib.AlbumTypeCol Set Product = mvarProduct End Property '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''' Standard Methods ''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Sub ToXmlFile(ByVal FileName As String, Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib20.XmlFormatting = LtXmlComLib20.XmlFormatting_Indented, Optional encoding As LtXmlComLib20.XmlEncoding = LtXmlComLib20.XmlEncoding_UTF8, Optional EOL As LtXmlComLib20.EOLType = LtXmlComLib20.EOLType.EOLType_CRLF, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) RegisterProduct LtXmlComLib20.XmlObjectBaseHelper.ToXmlFile Me, FileName, includeDocHeader, formatting, encoding, EOL, context End Sub Public Function ToXml(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib20.XmlFormatting = LtXmlComLib20.XmlFormatting_Indented, Optional EOL As LtXmlComLib20.EOLType = LtXmlComLib20.EOLType.EOLType_LF, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) As String RegisterProduct ToXml = LtXmlComLib20.XmlObjectBaseHelper.ToXml(Me, includeDocHeader, formatting, EOL, context) End Function Public Function ToXmlStream(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib20.XmlFormatting = LtXmlComLib20.XmlFormatting_Indented, Optional encoding As LtXmlComLib20.XmlEncoding = LtXmlComLib20.XmlEncoding_UTF8, Optional EOL As LtXmlComLib20.EOLType = LtXmlComLib20.EOLType.EOLType_LF, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) As Variant RegisterProduct ToXmlStream = LtXmlComLib20.XmlObjectBaseHelper.ToXmlStream(Me, includeDocHeader, formatting, encoding, EOL, context) End Function Public Sub FromXml(ByVal xmlIn As String, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) RegisterProduct LtXmlComLib20.XmlObjectBaseHelper.FromXml Me, xmlIn, context End Sub Public Sub FromXmlFile(ByVal FileName As String, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) RegisterProduct LtXmlComLib20.XmlObjectBaseHelper.FromXmlFile Me, FileName, context End Sub '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''' Private Methods '''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Summary: ' Constructor for Result ' 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 MusicStore.xsd Private Sub Class_Initialize() m_elementName = "Result" 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 = "Result" _ 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 LtXmlComLib20.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 LtXmlComLib20.XmlTextWriter, ByVal bRegisterNamespaces As Boolean, ByVal NamespaceUri As String, ByVal context As LtXmlComLib20.XmlSerializationContext, ByVal isOptionalChoice As Boolean) XmlGeneratedClassHelper.ToXml Me, xmlOut, bRegisterNamespaces, NamespaceUri, context, isOptionalChoice End Sub Private Sub XmlObjectBase_AttributesToXmlInt(ByVal xmlOut As LtXmlComLib20.XmlTextWriter, ByVal context As LtXmlComLib20.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 MusicStore.xsd. Private Sub XmlGeneratedClass_Init() Set mvarSearchDate = LtXmlComLib20.Conversions.dateFromString("1900-01-01", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Collapse) Set mvarProduct = CF.CreateClassCollection(ClsName_AlbumTypeCol, "Product", "", 0, -1) ' Force Init ClassInfo Dim classInfo As LtXmlComLib20.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 LtXmlComLib20.ClassInfo If g_ClsDataResult Is Nothing Then Set g_ClsDataResult = New LtXmlComLib20.ClassInfo g_ClsDataResult.GroupType = LtXmlComLib20.XmlGroupType.Sequence g_ClsDataResult.ElementType = LtXmlComLib20.XmlElementType.Element g_ClsDataResult.ElementName = "Result" g_ClsDataResult.ElementNamespaceURI = "" g_ClsDataResult.FromXmlFailIfAttributeUnknown = true g_ClsDataResult.IsClassDerived = false g_ClsDataResult.PrimitiveDataType = LtXmlComLib20.XmlDataType.type_none g_ClsDataResult.PrimitiveFormatOverride = "" g_ClsDataResult.OutputPrimitiveClassAsTextProperty = False Set g_ClsDataResult.ClassFactory = General.CF g_ClsDataResult.AddElmSeqPrimMnd "SearchDate", "", "SearchDate", XmlDataType.type_date, "", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Collapse, "", -1, -1, "", "", "", "", -1 g_ClsDataResult.AddElmSeqClsCol "Product", "", "Product", LtXmlComLib20.XmlElementType.Element End If Set XmlGeneratedClass_ClassInfo = g_ClsDataResult 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 |
SearchRequest.cls |
VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject END Attribute VB_Name = "SearchRequest" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Option Explicit '********************************************************************************************** '* Copyright (c) 2001-2023 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: MusicStore.xsd '********************************************************************************************** Private m_ElementName As String Private mvarPriceFilter As MusicStoreLib.PriceFilter Private mvarNameFilter 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 LtXmlComLib20.XmlObjectBase Implements LtXmlComLib20.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. ' 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 PriceFilter As MusicStoreLib.PriceFilter Set PriceFilter = mvarPriceFilter End Property Public Property Set PriceFilter(Byval value As MusicStoreLib.PriceFilter) LtXmlComLib20.XmlObjectBaseHelper.Throw_IfPropertyIsNull value, "PriceFilter" if not value is nothing then CastToXmlObjectBase(value).PrivateSetElementName "PriceFilter" end if ' LtXmlComLib20.XmlObjectBaseHelper.Throw_IfElementNameDiffers value, "PriceFilter" Set mvarPriceFilter = 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 NameFilter As String NameFilter = mvarNameFilter End Property Public Property Let NameFilter(ByVal value As String) ' Apply whitespace rules appropriately value = LtXmlComLib20.WhitespaceUtils.PreserveWhitespace(value) mvarNameFilter = value End Property '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''' Standard Methods ''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Sub ToXmlFile(ByVal FileName As String, Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib20.XmlFormatting = LtXmlComLib20.XmlFormatting_Indented, Optional encoding As LtXmlComLib20.XmlEncoding = LtXmlComLib20.XmlEncoding_UTF8, Optional EOL As LtXmlComLib20.EOLType = LtXmlComLib20.EOLType.EOLType_CRLF, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) RegisterProduct LtXmlComLib20.XmlObjectBaseHelper.ToXmlFile Me, FileName, includeDocHeader, formatting, encoding, EOL, context End Sub Public Function ToXml(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib20.XmlFormatting = LtXmlComLib20.XmlFormatting_Indented, Optional EOL As LtXmlComLib20.EOLType = LtXmlComLib20.EOLType.EOLType_LF, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) As String RegisterProduct ToXml = LtXmlComLib20.XmlObjectBaseHelper.ToXml(Me, includeDocHeader, formatting, EOL, context) End Function Public Function ToXmlStream(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib20.XmlFormatting = LtXmlComLib20.XmlFormatting_Indented, Optional encoding As LtXmlComLib20.XmlEncoding = LtXmlComLib20.XmlEncoding_UTF8, Optional EOL As LtXmlComLib20.EOLType = LtXmlComLib20.EOLType.EOLType_LF, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) As Variant RegisterProduct ToXmlStream = LtXmlComLib20.XmlObjectBaseHelper.ToXmlStream(Me, includeDocHeader, formatting, encoding, EOL, context) End Function Public Sub FromXml(ByVal xmlIn As String, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) RegisterProduct LtXmlComLib20.XmlObjectBaseHelper.FromXml Me, xmlIn, context End Sub Public Sub FromXmlFile(ByVal FileName As String, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) RegisterProduct LtXmlComLib20.XmlObjectBaseHelper.FromXmlFile Me, FileName, context End Sub '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''' Private Methods '''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Summary: ' Constructor for SearchRequest ' 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 MusicStore.xsd Private Sub Class_Initialize() m_elementName = "SearchRequest" 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 = "SearchRequest" _ 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 LtXmlComLib20.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 LtXmlComLib20.XmlTextWriter, ByVal bRegisterNamespaces As Boolean, ByVal NamespaceUri As String, ByVal context As LtXmlComLib20.XmlSerializationContext, ByVal isOptionalChoice As Boolean) XmlGeneratedClassHelper.ToXml Me, xmlOut, bRegisterNamespaces, NamespaceUri, context, isOptionalChoice End Sub Private Sub XmlObjectBase_AttributesToXmlInt(ByVal xmlOut As LtXmlComLib20.XmlTextWriter, ByVal context As LtXmlComLib20.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 MusicStore.xsd. Private Sub XmlGeneratedClass_Init() Set mvarPriceFilter = CF.CreateNamedClass(ClsName_PriceFilter, "PriceFilter") mvarNameFilter = LtXmlComLib20.Conversions.stringFromString("", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Preserve) ' Force Init ClassInfo Dim classInfo As LtXmlComLib20.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 LtXmlComLib20.ClassInfo If g_ClsDataSearchRequest Is Nothing Then Set g_ClsDataSearchRequest = New LtXmlComLib20.ClassInfo g_ClsDataSearchRequest.GroupType = LtXmlComLib20.XmlGroupType.Sequence g_ClsDataSearchRequest.ElementType = LtXmlComLib20.XmlElementType.Element g_ClsDataSearchRequest.ElementName = "SearchRequest" g_ClsDataSearchRequest.ElementNamespaceURI = "" g_ClsDataSearchRequest.FromXmlFailIfAttributeUnknown = true g_ClsDataSearchRequest.IsClassDerived = false g_ClsDataSearchRequest.PrimitiveDataType = LtXmlComLib20.XmlDataType.type_none g_ClsDataSearchRequest.PrimitiveFormatOverride = "" g_ClsDataSearchRequest.OutputPrimitiveClassAsTextProperty = False Set g_ClsDataSearchRequest.ClassFactory = General.CF g_ClsDataSearchRequest.AddElmSeqClsMnd "PriceFilter", "", "PriceFilter", LtXmlComLib20.XmlElementType.Element, false g_ClsDataSearchRequest.AddElmSeqPrimMnd "NameFilter", "", "NameFilter", XmlDataType.type_string, "", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Preserve, "", -1, -1, "", "", "", "", -1 End If Set XmlGeneratedClass_ClassInfo = g_ClsDataSearchRequest 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 |
SearchResponse.cls |
VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject END Attribute VB_Name = "SearchResponse" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Option Explicit '********************************************************************************************** '* Copyright (c) 2001-2023 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: MusicStore.xsd '********************************************************************************************** Private m_ElementName As String Private m_validElement As String Private mvarResult As MusicStoreLib.Result Private mvarError As MusicStoreLib.Error_ ' ##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 LtXmlComLib20.XmlObjectBase Implements LtXmlComLib20.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 Result As MusicStoreLib.Result Set Result = mvarResult End Property Public Property Set Result(ByVal value As MusicStoreLib.Result) ' Ensure only on element is populated at a time ClearChoice "Result" ' remove selection if value is Nothing then Set mvarResult = Nothing else CastToXmlObjectBase(value).PrivateSetElementName "Result" ' LtXmlComLib20.XmlObjectBaseHelper.Throw_IfElementNameDiffers value, "Result" Set mvarResult = 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 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 Error_ As MusicStoreLib.Error_ Set Error_ = mvarError End Property Public Property Set Error_(ByVal value As MusicStoreLib.Error_) ' Ensure only on element is populated at a time ClearChoice "Error_" ' remove selection if value is Nothing then Set mvarError = Nothing else CastToXmlObjectBase(value).PrivateSetElementName "Error" ' LtXmlComLib20.XmlObjectBaseHelper.Throw_IfElementNameDiffers value, "Error" Set mvarError = value End If 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 LtXmlComLib20.XmlFormatting = LtXmlComLib20.XmlFormatting_Indented, Optional encoding As LtXmlComLib20.XmlEncoding = LtXmlComLib20.XmlEncoding_UTF8, Optional EOL As LtXmlComLib20.EOLType = LtXmlComLib20.EOLType.EOLType_CRLF, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) RegisterProduct LtXmlComLib20.XmlObjectBaseHelper.ToXmlFile Me, FileName, includeDocHeader, formatting, encoding, EOL, context End Sub Public Function ToXml(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib20.XmlFormatting = LtXmlComLib20.XmlFormatting_Indented, Optional EOL As LtXmlComLib20.EOLType = LtXmlComLib20.EOLType.EOLType_LF, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) As String RegisterProduct ToXml = LtXmlComLib20.XmlObjectBaseHelper.ToXml(Me, includeDocHeader, formatting, EOL, context) End Function Public Function ToXmlStream(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib20.XmlFormatting = LtXmlComLib20.XmlFormatting_Indented, Optional encoding As LtXmlComLib20.XmlEncoding = LtXmlComLib20.XmlEncoding_UTF8, Optional EOL As LtXmlComLib20.EOLType = LtXmlComLib20.EOLType.EOLType_LF, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) As Variant RegisterProduct ToXmlStream = LtXmlComLib20.XmlObjectBaseHelper.ToXmlStream(Me, includeDocHeader, formatting, encoding, EOL, context) End Function Public Sub FromXml(ByVal xmlIn As String, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) RegisterProduct LtXmlComLib20.XmlObjectBaseHelper.FromXml Me, xmlIn, context End Sub Public Sub FromXmlFile(ByVal FileName As String, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) RegisterProduct LtXmlComLib20.XmlObjectBaseHelper.FromXmlFile Me, FileName, context End Sub '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''' Private Methods '''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Summary: ' Constructor for SearchResponse ' 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 MusicStore.xsd Private Sub Class_Initialize() m_elementName = "SearchResponse" XmlGeneratedClass_Init End Sub ' Summary: ' Selects the given element as the selected choice Private Sub ClearChoice(ByVal SelectedElement as String) Set mvarResult = Nothing Set mvarError = 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 = "SearchResponse" _ 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 LtXmlComLib20.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 LtXmlComLib20.XmlTextWriter, ByVal bRegisterNamespaces As Boolean, ByVal NamespaceUri As String, ByVal context As LtXmlComLib20.XmlSerializationContext, ByVal isOptionalChoice As Boolean) XmlGeneratedClassHelper.ToXml Me, xmlOut, bRegisterNamespaces, NamespaceUri, context, isOptionalChoice End Sub Private Sub XmlObjectBase_AttributesToXmlInt(ByVal xmlOut As LtXmlComLib20.XmlTextWriter, ByVal context As LtXmlComLib20.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 MusicStore.xsd. Private Sub XmlGeneratedClass_Init() Set mvarResult = Nothing Set mvarError = Nothing m_validElement = "" ' Force Init ClassInfo Dim classInfo As LtXmlComLib20.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 LtXmlComLib20.ClassInfo If g_ClsDataSearchResponse Is Nothing Then Set g_ClsDataSearchResponse = New LtXmlComLib20.ClassInfo g_ClsDataSearchResponse.GroupType = LtXmlComLib20.XmlGroupType.Choice g_ClsDataSearchResponse.ElementType = LtXmlComLib20.XmlElementType.Element g_ClsDataSearchResponse.ElementName = "SearchResponse" g_ClsDataSearchResponse.ElementNamespaceURI = "" g_ClsDataSearchResponse.FromXmlFailIfAttributeUnknown = true g_ClsDataSearchResponse.IsClassDerived = false g_ClsDataSearchResponse.PrimitiveDataType = LtXmlComLib20.XmlDataType.type_none g_ClsDataSearchResponse.PrimitiveFormatOverride = "" g_ClsDataSearchResponse.OutputPrimitiveClassAsTextProperty = False Set g_ClsDataSearchResponse.ClassFactory = General.CF g_ClsDataSearchResponse.AddElmChoiceClsOpt "Result", "", "Result", LtXmlComLib20.XmlElementType.Element, ClsName_Result g_ClsDataSearchResponse.AddElmChoiceClsOpt "Error", "", "Error_", LtXmlComLib20.XmlElementType.Element, ClsName_Error_ End If Set XmlGeneratedClass_ClassInfo = g_ClsDataSearchResponse 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 |
TrackType.cls |
VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject END Attribute VB_Name = "TrackType" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Option Explicit '********************************************************************************************** '* Copyright (c) 2001-2023 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: MusicStore.xsd '********************************************************************************************** Private m_ElementName As String Private mvarTitle As String Private mvarLength As LtXmlComLib20.DateTimeSpan ' ##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 LtXmlComLib20.XmlObjectBase Implements LtXmlComLib20.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 Title As String Title = mvarTitle End Property Public Property Let Title(ByVal value As String) ' Apply whitespace rules appropriately value = LtXmlComLib20.WhitespaceUtils.PreserveWhitespace(value) mvarTitle = 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 P0Y. Public Property Get Length As LtXmlComLib20.DateTimeSpan Set Length = mvarLength End Property Public Property Set Length(ByVal value As LtXmlComLib20.DateTimeSpan) Set mvarLength = value End Property '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''' Standard Methods ''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Sub ToXmlFile(ByVal FileName As String, Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib20.XmlFormatting = LtXmlComLib20.XmlFormatting_Indented, Optional encoding As LtXmlComLib20.XmlEncoding = LtXmlComLib20.XmlEncoding_UTF8, Optional EOL As LtXmlComLib20.EOLType = LtXmlComLib20.EOLType.EOLType_CRLF, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) RegisterProduct LtXmlComLib20.XmlObjectBaseHelper.ToXmlFile Me, FileName, includeDocHeader, formatting, encoding, EOL, context End Sub Public Function ToXml(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib20.XmlFormatting = LtXmlComLib20.XmlFormatting_Indented, Optional EOL As LtXmlComLib20.EOLType = LtXmlComLib20.EOLType.EOLType_LF, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) As String RegisterProduct ToXml = LtXmlComLib20.XmlObjectBaseHelper.ToXml(Me, includeDocHeader, formatting, EOL, context) End Function Public Function ToXmlStream(Optional includeDocHeader As Boolean = True, Optional formatting As LtXmlComLib20.XmlFormatting = LtXmlComLib20.XmlFormatting_Indented, Optional encoding As LtXmlComLib20.XmlEncoding = LtXmlComLib20.XmlEncoding_UTF8, Optional EOL As LtXmlComLib20.EOLType = LtXmlComLib20.EOLType.EOLType_LF, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) As Variant RegisterProduct ToXmlStream = LtXmlComLib20.XmlObjectBaseHelper.ToXmlStream(Me, includeDocHeader, formatting, encoding, EOL, context) End Function Public Sub FromXml(ByVal xmlIn As String, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) RegisterProduct LtXmlComLib20.XmlObjectBaseHelper.FromXml Me, xmlIn, context End Sub Public Sub FromXmlFile(ByVal FileName As String, Optional context As LtXmlComLib20.XmlSerializationContext = Nothing) RegisterProduct LtXmlComLib20.XmlObjectBaseHelper.FromXmlFile Me, FileName, context End Sub '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''' Private Methods '''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Summary: ' Constructor for TrackType ' 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 MusicStore.xsd Private Sub Class_Initialize() m_elementName = "TrackType" 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 = "TrackType" _ 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 LtXmlComLib20.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 LtXmlComLib20.XmlTextWriter, ByVal bRegisterNamespaces As Boolean, ByVal NamespaceUri As String, ByVal context As LtXmlComLib20.XmlSerializationContext, ByVal isOptionalChoice As Boolean) XmlGeneratedClassHelper.ToXml Me, xmlOut, bRegisterNamespaces, NamespaceUri, context, isOptionalChoice End Sub Private Sub XmlObjectBase_AttributesToXmlInt(ByVal xmlOut As LtXmlComLib20.XmlTextWriter, ByVal context As LtXmlComLib20.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 MusicStore.xsd. Private Sub XmlGeneratedClass_Init() mvarTitle = LtXmlComLib20.Conversions.stringFromString("", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Preserve) Set mvarLength = LtXmlComLib20.Conversions.durationFromString("P0Y", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Collapse) ' Force Init ClassInfo Dim classInfo As LtXmlComLib20.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 LtXmlComLib20.ClassInfo If g_ClsDataTrackType Is Nothing Then Set g_ClsDataTrackType = New LtXmlComLib20.ClassInfo g_ClsDataTrackType.GroupType = LtXmlComLib20.XmlGroupType.Sequence g_ClsDataTrackType.ElementType = LtXmlComLib20.XmlElementType.Element g_ClsDataTrackType.ElementName = "TrackType" g_ClsDataTrackType.ElementNamespaceURI = "" g_ClsDataTrackType.FromXmlFailIfAttributeUnknown = true g_ClsDataTrackType.IsClassDerived = false g_ClsDataTrackType.PrimitiveDataType = LtXmlComLib20.XmlDataType.type_none g_ClsDataTrackType.PrimitiveFormatOverride = "" g_ClsDataTrackType.OutputPrimitiveClassAsTextProperty = False Set g_ClsDataTrackType.ClassFactory = General.CF g_ClsDataTrackType.AddElmSeqPrimMnd "Title", "", "Title", XmlDataType.type_string, "", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Preserve, "", -1, -1, "", "", "", "", -1 g_ClsDataTrackType.AddElmSeqPrimMnd "Length", "", "Length", XmlDataType.type_duration, "", LtXmlComLib20.WhitespaceRule.WhitespaceRule_Collapse, "", -1, -1, "", "", "", "", -1 End If Set XmlGeneratedClass_ClassInfo = g_ClsDataTrackType 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 |
TrackTypeCol.cls |
VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject END Attribute VB_Name = "TrackTypeCol" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Option Explicit '********************************************************************************************** '* Copyright (c) 2001-2023 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: MusicStore.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 LtXmlComLib20.XmlCollectionBase Implements LtXmlComLib20.XmlObjectBase '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''' Collection Methods '''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Summary: ' Adds a TrackType 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 MusicStoreLib.TrackType, optional Before, optional After) as MusicStoreLib.TrackType CastToXmlObjectBase(newCls).PrivateSetElementName m_elementName ' LtXmlComLib20.XmlObjectBaseHelper.Throw_IfElementNameDiffers newCls, m_elementName m_coll.Add newCls, , Before, After RaiseEvent OnCollectionChange Set Add = newCls End Function ' Summary: ' Adds a TrackType object to the collection ' Returns: ' The newly created TrackType object ' Remarks: ' A new TrackType object is created and added to the collection ' the new object is then returned. public Function AddNew() as MusicStoreLib.TrackType Set AddNew = CF.CreateClass(ClsName_TrackType) CastToXmlObjectBase(AddNew).PrivateSetElementName m_elementName m_coll.Add AddNew RaiseEvent OnCollectionChange End Function ' Summary: ' Gets a TrackType 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 MusicStoreLib.TrackType 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 = "TrackType" _ 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 LtXmlComLib20.XmlTextWriter, ByVal oContext As LtXmlComLib20.XmlSerializationContext) dim oCls as LtXmlComLib20.XmlObjectBase for each oCls in m_coll CastToXmlObjectBase(oCls).AttributesToXmlInt xmlOut, oContext next End Sub Private Sub XmlObjectBase_ToXmlInt(ByVal xmlOut As LtXmlComLib20.XmlTextWriter, ByVal bRegisterNamespaces As Boolean, ByVal NamespaceURI As String, ByVal oContext As LtXmlComLib20.XmlSerializationContext, ByVal isOptionalChoice As Boolean) dim oCls as LtXmlComLib20.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 LtXmlComLib20.XmlSerializationContext, ByVal isOptionalChoice As Boolean) As MSXML2.IXMLDOMElement Dim newObj as MusicStoreLib.TrackType ' 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 LtXmlComLib20.XmlGeneratedClassHelper.DoesElementNameMatch(oContext, xmlChild, m_elementName, m_elementNamespaceUri) = False then exit do Set newObj = CF.CreateNamedClass(ClsName_TrackType, m_elementName) CastToXmlObjectBase(newObj).FromXmlInt xmlChild, LtXmlComLib20.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 = LtXmlComLib20.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 |