Showing posts with label XML-VB6. Show all posts
Showing posts with label XML-VB6. Show all posts

Sunday, June 17, 2012

XML Pretty Print - Merapikan Format File XML

Private Sub PrettyPrint(Parent As IXMLDOMNode, Optional Level As Integer) Dim Node As IXMLDOMNode Dim Indent As IXMLDOMText If Not Parent.ParentNode Is Nothing And Parent.ChildNodes.Length > 0 Then For Each Node In Parent.ChildNodes...
READ MORE - XML Pretty Print - Merapikan Format File XML

XML Tidy - Untuk Merapikan File XML

Public Function PrettyPrintXML(XML As String) As String Dim Reader As New SAXXMLReader60 Dim Writer As New MXXMLWriter60 Writer.Indent = True Writer.standalone = False Writer.omitXMLDeclaration = False Writer.encoding = "utf-8" Set...
READ MORE - XML Tidy - Untuk Merapikan File XML

Encode Decode Base64 Menggunakan MSXML

Public Function Base64Enc(ByRef vxbData() As Byte) As String With CreateObject("MSXML.DOMDocument").CreateElement(" Base64 ") .DataType = "bin.base64" .NodeTypedValue = vxbData Base64Enc = .Text End WithEnd FunctionPublic Function...
READ MORE - Encode Decode Base64 Menggunakan MSXML

Contoh Memparsing XML Attributes

Private Sub Command1_Click() Dim fso As Object Dim sDir As String Dim doc As Object Dim oFile As Object Set fso = CreateObject("Scripting.FileSystemObject") sDir = "C:\work" Set doc = CreateObject("Msxml2.DOMDocument") doc.async...
READ MORE - Contoh Memparsing XML Attributes

Contoh Menggunakan tarts-with() Dalam Fungsi XPath

Private Sub Command1_Click() Dim doc As MSXML2.DOMDocument Dim nlist As MSXML2.IXMLDOMNodeList Dim node As MSXML2.IXMLDOMNode Set doc = New MSXML2.DOMDocument doc.setProperty "SelectionLanguage", "XPath" doc.Load "c:\books.xml" Set...
READ MORE - Contoh Menggunakan tarts-with() Dalam Fungsi XPath

Contoh Kode XML Query XPath

Option ExplicitDim gCn As New ADODB.ConnectionConst DBGUID_DEFAULT As String = "{C8B521FB-5CF3-11CE-ADE5-00AA0044773D}"Const DBGUID_SQL As String = "{C8B522D7-5CF3-11CE-ADE5-00AA0044773D}"Const DBGUID_MSSQLXML As String = "{5D531CB2-E6Ed-11D2-B252-00C04F681B71}"Const...
READ MORE - Contoh Kode XML Query XPath

VB6 Code - XML Yang Mengandung Binary Data

Option ExplicitDim oDoc As DOMDocumentDim DOCINPATH As StringDim XMLOUTPATH As StringDim DOCOUTPATH As StringPrivate Sub cmdCreateXML_Click() Dim oEle As IXMLDOMElement Dim oRoot As IXMLDOMElement Dim oNode As IXMLDOMNode DOCINPATH = App.Path...
READ MORE - VB6 Code - XML Yang Mengandung Binary Data

Menggunakan XMLHTTP dan MSXML

Private Sub Command1_Click() Dim soapReq As String Dim objSOAPXMLDoc As New MSXML2.DOMDocument30 Dim objXMLHTTP As New MSXML2.XMLHTTP30 Dim btArr() As Byte Dim backSlashPos As Integer Dim fileNameNoPath As String soapReq = " " &...
READ MORE - Menggunakan XMLHTTP dan MSXML

XML VB6 - Mencari Node Tertentu Menggunakan XPath

Public Function SearchForNodes(ByVal strXML As String, ByVal strTag As String, ByVal strSearchText As String) As DOMDocument 'Will Search an XML String for a Tag-value pair and return 'the entire node containing that pair in the form 'of a DOM...
READ MORE - XML VB6 - Mencari Node Tertentu Menggunakan XPath

Parse XML Menggunakan Visual Basic 6.0

Sub ParseXmlDocument() Dim doc As New MSXML2.DOMDocument Dim success As Boolean success = doc.Load(App.Path & "\test.xml") If success = False Then MsgBox doc.parseError.reason Else Dim nodeList As MSXML2.IXMLDOMNodeList Set...
READ MORE - Parse XML Menggunakan Visual Basic 6.0

Thursday, June 14, 2012

Tidy XML Menggunakan XSL Transform - VB6 Source Code

Private Function TidyXML(sXML As String) As String Dim oXSLT As DOMDocument Dim XSL_FILE As String Dim sResult As String Const DoubleQuotes = """" Dim strText As String Dim objDom As DOMDocument Set objDom = New DOMDocument objDom.loadXML...
READ MORE - Tidy XML Menggunakan XSL Transform - VB6 Source Code

Saturday, June 9, 2012

Merger 2 File XML Menggunakan Visual Basic 6.0

Private Sub AddPostNew(XMLSource As String, XMLDestination As String) Dim strText As String Dim strPost As String Dim domFree As FreeThreadedDOMDocument60 Dim domApt As DOMDocument60 Dim node As IXMLDOMNode Dim clone As IXMLDOMNode...
READ MORE - Merger 2 File XML Menggunakan Visual Basic 6.0

Thursday, June 7, 2012

VB6 Code - Mengevaluasi XPath dengan XPath Checker

Berikut adalah kode VB6 yang digunakan untuk mengevaluasi XPath yang digunakan untuk melakukan query terhadap file XML: Option Explicit Private Sub cmdEvaluate_Click() On Error GoTo ErrHandler txtErrorXpath.Text = "" Dim doc As MSXML2.DOMDocument60...
READ MORE - VB6 Code - Mengevaluasi XPath dengan XPath Checker

Saturday, June 2, 2012

XML Pretty Print - Merapikan Format File XML

Private Sub PrettyPrint(Parent As IXMLDOMNode, Optional Level As Integer) Dim Node As IXMLDOMNode Dim Indent As IXMLDOMText If Not Parent.ParentNode Is Nothing And Parent.ChildNodes.Length > 0 Then For Each Node In Parent.ChildNodes...
READ MORE - XML Pretty Print - Merapikan Format File XML