Jump to content
Xtreme .Net Talk

WaveRebel

Members
  • Posts

    4
  • Joined

  • Last visited

About WaveRebel

  • Birthday 11/12/1970

WaveRebel's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. OMG!! this is exactly what ive benn looking for for days!!!!! Thank you so much man jah bless! This class rules!! simple but rules!!!
  2. This is as good as it gets!!! Its working perfectly and yes I had to use MoveNext() Thanks for the help :D
  3. Thank you for your reply, as soon as I test it ill post the results here. But yes your correct using SelectChildren is the ticket.
  4. Im currently working with QBXML which is the same as XML 1.0 and its fully standard compliant. I receive this XML from QuickBooks. <?xml version="1.0" ?> <QBXML> <QBXMLMsgsRs> <CustomerQueryRs requestID="1" statusCode="0" statusSeverity="Info" statusMessage="Status OK"> <CustomerRet> <ListID>91D0000-1015432175</ListID> <Name>01 @ Systems (New York)</Name> <Contact>Rob Smiles</Contact> </CustomerRet> </CustomerQueryRs> </QBXMLMsgsRs> </QBXML> I read it using XPathNavigator like this 'Begin Xml Dim CustXML As XmlDocument = New XmlDocument() CustXML.LoadXml(response) Dim nav As XPathNavigator = CustXML.CreateNavigator() 'Setting XML Navigational Paths 'Customer Information Dim iListID As XPathNodeIterator = nav.Select(nav.Compile("/*/*/*/CustomerRet/ListID")) Dim iName As XPathNodeIterator = nav.Select(nav.Compile("/*/*/*/CustomerRet/Name")) Dim iContact As XPathNodeIterator = nav.Select(nav.Compile("/*/*/*/CustomerRet/Contact")) 'Using ListID as Main iterator all Customer have a ListID according to Quickbooks While (iListID.MoveNext()) 'Get Customer ID ListID = iListID.Current.Clone.Value.ToString() 'Get Customer Name iName .MoveNext() CustName = iName .Current.Clone.Value.ToString() 'Get Customer Contact iContact .MoveNext() Contact = iContact .Current.Clone.Value.ToString() End while So the problem is QuickBooks only returns XML nodes out of filled fields. Example: If in QuickBooks I have the field "Contact" empty it will not return the contact node in the XML. So this leaves me with 1,300 Customers in a not good shape XML File which I cannot read since it skips nodes and gives me wrong values. How can I detect if that portion of the xml doenst have than node? I have like 300 Customers with "Contact" node not being in the XML. Note: This is not the complete XML, its just an example of what is happening.
×
×
  • Create New...