dcsimg
Results 1 to 2 of 2

Thread: How do I return correct output in VB.Net?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2013
    Posts
    31

    How do I return correct output in VB.Net?

    What I am trying to do is that inside object objXmlCourtNode there is xml elements whereby ORI in this object is compared to the input xml document ORI.

    What I need to do is whenever the xml document ORI matches one in object objXmlCourtNode and the one in objXmlCourtNode has obsoleteDate, then I want to show an error "Invalid ORI"

    When the ORI from xml document matches a ORI in object objXmlCourtNode that does not have obsoleteDate, no error is displayed.

    How do I do this?

    My If statement produces an error whether or not ORI in xml document that matched ORI in object objXmlCourtNode object has obsoleteDate or not.

    xml document. This ORI should not produce an error.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <DataExchange>
    	<OrganizationIdentification>
    	     <ORI>013G</ns3:IdentificationID>
    	</OrganizationIdentification>
    </DataExchange>
    xml document. This ORI should produce an error because the ORI is matches in the objXmlCourtNode has obsoleteDate.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <DataExchange>
    	<OrganizationIdentification>
     	    <ORI>013J</ns3:IdentificationID>
    	</OrganizationIdentification>
    </DataExchange>
    Example of objXmlCourtNode for ORI with obsoleteDate and ORI without obsoleteDate

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <EnumerationValue>
    	<ORI>013G</ORI>
    </EnumerationValue>
    <EnumerationValue obsoleteDate="2002-12-18">
    	<ORI>013J</ORI>
    </EnumerationValue>
    My vb.net code

    Code:
    If Not (objXmlCourtNode.SelectSingleNode("EnumerationValue/@obsoleteDate") Is Nothing) AndAlso (Not (objXmlCourtNode.SelectSingleNode("@obsoleteDate").InnerText Is Nothing)) Then
                Else
                    ("Invalid ORI")
                   Exit Sub
                End If

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Sep 2013
    Posts
    31

    Re: How do I return correct output in VB.Net?

    Quote Originally Posted by winkimjr2 View Post
    What I am trying to do is that inside object objXmlCourtNode there is xml elements whereby ORI in this object is compared to the input xml document ORI.

    What I need to do is whenever the xml document ORI matches one in object objXmlCourtNode and the one in objXmlCourtNode has obsoleteDate, then I want to show an error "Invalid ORI"

    When the ORI from xml document matches a ORI in object objXmlCourtNode that does not have obsoleteDate, no error is displayed.

    How do I do this?

    My If statement produces an error whether or not ORI in xml document that matched ORI in object objXmlCourtNode object has obsoleteDate or not.

    xml document. This ORI should not produce an error.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <DataExchange>
    	<OrganizationIdentification>
    	     <ORI>013G</ns3:IdentificationID>
    	</OrganizationIdentification>
    </DataExchange>
    xml document. This ORI should produce an error because the ORI is matches in the objXmlCourtNode has obsoleteDate.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <DataExchange>
    	<OrganizationIdentification>
     	    <ORI>013J</ns3:IdentificationID>
    	</OrganizationIdentification>
    </DataExchange>
    Example of objXmlCourtNode for ORI with obsoleteDate and ORI without obsoleteDate

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <EnumerationValue>
    	<ORI>013G</ORI>
    </EnumerationValue>
    <EnumerationValue obsoleteDate="2002-12-18">
    	<ORI>013J</ORI>
    </EnumerationValue>
    My vb.net code

    Code:
    If Not (objXmlCourtNode.SelectSingleNode("EnumerationValue/@obsoleteDate") Is Nothing) AndAlso (Not (objXmlCourtNode.SelectSingleNode("@obsoleteDate").InnerText Is Nothing)) Then
                Else
                    ("Invalid ORI")
                   Exit Sub
                End If
    I no longer need help with this one.

Tags for this Thread

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width