XML to delimited text file for Infopath - InfoPath Dev

InfoPath Dev

Use our Google Custom Search for best site search results.

XML to delimited text file for Infopath

Last post 08-05-2009 04:56 PM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-02-2009 11:04 AM

    XML to delimited text file for Infopath

    Hi, I am trying to convert the xml file that infopath generated info pipeline delimited file. I managed to write a code that convert xslt stylesheet to delimited file. Now I want to convert xml to xslt and then use my code to convert it into delimited text file. 

     Is there any way to convert xml directly to delimited file? Or Is there any vb code to convert xml to xslt ?

     This is the code I used for xslt to pipeline delimited file:

                Dim i As Integer
    Dim j As Integer
    Dim docXML As New XmlDocument
    docXML.Load("C:\Documents and Settings\nachimk\Desktop\60251.xml")
    Dim path As String = "C:\Documents and Settings\nachimk\My Documents\MyTest3.txt"
    Dim sw As StreamWriter = File.CreateText(path)
    Dim nodRoot As XmlElement = docXML.DocumentElement
    'Dim node As XmlNode

    Dim fd() As String = {"Application_Name", "System_Name", "Package", "Description", "IS_Domain", "Business_Domain", "Alias", "Satyam_Support", "AppCriticality", "Status", "Nissan_Region", "Regional_Global_Scope", "Brands_Supported", "Status_Option_Change", "New_Application", "Mega_ID", "Business_Contact", "Primary_BA_Contact", "Secondary_BA_Contact", "Business_Value", "Functional_Value", "Technical_Condition", "Code_Availability", "Base_Map_Business_Process_L1", "Base_Map_Business_Process_L2", "Base_Map_Business_Process_L3", "BPRM_L1", "BPRM_L2", "BPRM_L3", "BPRM_L4", "Application_Type", "Number_Of_Users", "Platform", "Data_Security_Classification", "Usage_Volume", "Business_Complexity", "Technical_Complexity", "Customization_Level", "Number_Of_Function_Points", "Directory_Service", "Data_Privacy", _
    "DDQT_Databases", "DDQT_Version", "DDQT_Server", "DDQT_P", "DDQT_S", "DDQT_Q", "DDQT_D", "PL_Languages", "PL_Version", "PL_Server", "PL_P", "PL_S", "PL_Q", "PL_D", "AT_ToolsandMiddleware", "AT_Version", "AT_Server", "AT_P", "AT_S", "AT_Q", "AT_D", "SLT_SystemTools", "SLT_Version", "SLT_Servers", "SLT_P", "SLT_S", "SLT_Q", "SLT_D", "OS_OperatingSystem", "OS_Version", "OS_Server", "OS_P", "OS_S", "OS_Q", "OS_D", "Other_Comments", "Development_Check", "QA_Check", "Staging_Check", "Production_Check"}
    'fd(0) = "Package"
    For j = 0 To UBound(fd) - 1
    Dim nodItems As XmlNodeList = nodRoot.GetElementsByTagName(fd(j).ToString)
    If nodItems.Count = 0 Then
    MessageBox.Show("Cannot Find" + fd(j))
    ElseIf nodItems.Count > 0 Then
    For i = 0 To nodItems.Count - 1
    MessageBox.Show(fd(j) + nodItems(0).InnerXml)
    Next i
    'If File.Exists(path) = False Then
    ' Create a file to write to.
    sw.Write(fd(j) + "|" + nodItems(0).InnerXml + "|")
    End If
    Next j
    Can any one give me the code? Thanks




    Filed under: , ,
  • 08-05-2009 04:56 PM In reply to

    Re: XML to delimited text file for Infopath

    Hi senthilkungumaraj  and welcome.

    InfoPathDev offers free forums to help people with InfoPath, SharePoint and Qdabra issues. We do not offer free forum support for general coding questions.

    BTW, I can't think of why you would want to delimit the XML. XML is already delimited. Just parse using the tags that it already has. .NET is your friend.

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.