Anyone can help with adding data to TextML server?

Discussion in 'XML' started by arachno, Jul 11, 2003.

  1. arachno

    arachno Guest

    Hello ppl,

    Is anyone can help me to figure out how to add data to TextML server
    document base?
    I have attached snipped, which taking XML source from file and adding it to
    documentbase, but my problem is, that i need to add it on "fly", without
    touching file system.

    Cheers,
    arachno

    ------[Code Snippet] ---------------------

    'TEXTML Server Document Types
    Const TEXTML_DOCUMENT = 1
    Const TEXTML_SYSTEM_DOCUMENT = 2

    'TEXTML Server SetDocuments AddFlags
    Const TEXTML_ADD_DOCUMENT = 1
    Const TEXTML_REPLACE_DOCUMENT = 2
    Const TEXTML_INDEX_DOCUMENT = 4

    Sub Main
    On Error Resume Next
    Debug.Clear
    Dim ClientSrv
    Dim ServerSrv
    Dim DocBaseSrv
    Dim DocumentSrv
    Dim DocList
    Dim FileSys
    Dim xmlFolder
    Dim PersistFile As New PersistFile
    Dim Files
    Dim Document

    'Connect to server
    Set ClientSrv = CreateObject("TextmlServer.ClientServices")
    Set ServerSrv = ClientSrv.ConnectServer("arachno")

    'Connect to Document Base
    Set DocBaseSrv = ServerSrv.ConnectDocBase ("demo")

    'Get the document services of the Document Base
    Set DocumentSrv = DocBaseSrv.DocumentServices

    'Create a list object that will contain the list of documents to add
    Set DocList = CreateObject("IxiaComponents.DynamicList")

    'Process the files in the folder
    Set PersistFile = CreateObject("IXIAComponents.PersistFile")
    PersistFile.LoadFromFile "C:\garbage\demos\acc.xml"
    Debug.Print PersistFile.Content
    Set Document = CreateObject("TextmlServer.Document")
    Document.AttachContent PersistFile.DetachContent
    Document.Name = "acc.xml"
    Document.MimeType = "text/xml"
    DocList.Add Document


    'Set documents
    DocumentSrv.SetDocuments DocList, TEXTML_ADD_DOCUMENT +
    TEXTML_INDEX_DOCUMENT, TEXTML_DOCUMENT
    Debug.Print "Documents added"

    ErrHandler:
    Debug.Print Err.Description
    '...handler here...
    End Sub
    arachno, Jul 11, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JDS

    Anyone?? Anyone at all??

    JDS, Sep 26, 2005, in forum: HTML
    Replies:
    2
    Views:
    370
    Montgomery BOO...URNS
    Sep 29, 2005
  2. Steve Williams

    Anyone? Anyone?

    Steve Williams, Sep 16, 2003, in forum: Python
    Replies:
    0
    Views:
    374
    Steve Williams
    Sep 16, 2003
  3. Bhuwan Bhaskar
    Replies:
    5
    Views:
    565
    Bhuwan Bhaskar
    Oct 21, 2007
  4. Replies:
    30
    Views:
    958
    Arne Vajhøj
    Feb 10, 2008
  5. 7stud --
    Replies:
    4
    Views:
    119
    7stud --
    Mar 27, 2009
Loading...

Share This Page