Results 1 to 3 of 3

error while Parsing XML using VBA

Threaded View

  1. #1
    Registered User
    Join Date
    09-25-2009
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    2

    error while Parsing XML using VBA

    Hi Gurus,
    I am new to VBA.I am trying to create some tool using VBA to read xml documents.

    The code is giving error when i try to read an XML document which contains some commented code.

    the code i am using is:
    Sub get_Jndi_Location()
        Dim oXmlDoc As DOMDocument
               Dim oXmlNode As IXMLDOMNode
               Dim oXmlNodes As IXMLDOMNodeList
               Set oXmlDoc = New DOMDocument
               Dim brtn As Boolean
               Dim onode As IXMLDOMElement
                         
               oXmlDoc.Load ("D:\User\WorkSpace\excel_xml\DB_API_FPC_CREATE_SR_GENERIC.wsdl")
               
               serviceName = "DB_API_FPC_CREATE_SR_GENERIC.wsdl"
               
               For Each onode In oXmlDoc.selectNodes("//service")
                    Debug.Print serviceName
                        For Each portNode In onode.childNodes
                            For Each locationNode In portNode.childNodes
                                Debug.Print locationNode.getAttribute("location")
                            Next locationNode
                        Next portNode
               Next
    End Sub
    The XML Document i am trying to read is :

    <definitions
         name="DB_API_FPC_CREATE_SR_GENERIC"
         targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/DB_API_FPC_CREATE_SR_GENERIC/"
         xmlns="http://schemas.xmlsoap.org/wsdl/"
         xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/db/DB_API_FPC_CREATE_SR_GENERIC/"
         xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/APPS/FPC_CREATE_SR_GENERIC/CREATE_SERVICE_REQUEST/"
         xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
         xmlns:jca="http://xmlns.oracle.com/pcbpel/wsdl/jca/"
         xmlns:hdr="http://xmlns.oracle.com/pcbpel/adapter/db/"
        >
        
        
        <service name="DB_API_FPC_CREATE_SR_GENERIC">
            <port name="DB_API_FPC_CREATE_SR_GENERIC_pt" binding="tns:DB_API_FPC_CREATE_SR_GENERIC_binding">
    <!--Your runtime connection is declared in 
    J2EE_HOME/application-deployments/default/DbAdapter/oc4j-ra.xml -->
          <jca:address location="fai/ebiz/db/ph2rel2"/>
             <!--UIConnectionName="FAI"
              ManagedConnectionFactory="oracle.tip.adapter.db.DBManagedConnectionFactory"
              mcf.DriverClassName="oracle.jdbc.OracleDriver"
              mcf.PlatformClassName="oracle.toplink.internal.databaseaccess.Oracle9Platform"
              mcf.ConnectionString="jdbc:oracle:thin:@sv-fadevdb01.fjcs.net:1551:C1ERP"
              mcf.UserName="Apps"
              mcf.Password="423C8D76B4B565AE04903C88DEB72A67" /> -->
            </port>
        </service>
      <plt:partnerLinkType name="DB_API_FPC_CREATE_SR_GENERIC_plt" >
        <plt:role name="DB_API_FPC_CREATE_SR_GENERIC_role" >
          <plt:portType name="tns:DB_API_FPC_CREATE_SR_GENERIC_ptt" />
        </plt:role>
      </plt:partnerLinkType>
    </definitions>
    I am trying to read the attribute of <jca:address location="fai/ebiz/db/ph2rel2"/> element

    when i try to remove the comments the code is working.other wise it is giving the error Object doesn't support this property or method error.

    Please do the needful.
    Thanks in advance.
    Last edited by chandutou; 09-29-2009 at 11:37 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1