Click here to Skip to main content
15,923,168 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionBarcode commands to Zebra printer Pin
Randy Crockett1-Jun-17 13:34
Randy Crockett1-Jun-17 13:34 
SuggestionRe: Barcode commands to Zebra printer Pin
Ralf Meier1-Jun-17 19:41
mveRalf Meier1-Jun-17 19:41 
GeneralRe: Barcode commands to Zebra printer Pin
Randy Crockett2-Jun-17 8:05
Randy Crockett2-Jun-17 8:05 
AnswerRe: Barcode commands to Zebra printer Pin
Richard Deeming2-Jun-17 1:11
mveRichard Deeming2-Jun-17 1:11 
GeneralRe: Barcode commands to Zebra printer Pin
Randy Crockett2-Jun-17 8:06
Randy Crockett2-Jun-17 8:06 
Questionsending message plugins Pin
Member 1322979929-May-17 14:50
Member 1322979929-May-17 14:50 
AnswerRe: sending message plugins Pin
Richard MacCutchan29-May-17 20:49
mveRichard MacCutchan29-May-17 20:49 
AnswerRe: sending message plugins Pin
ZurdoDev2-Jun-17 3:16
professionalZurdoDev2-Jun-17 3:16 
QuestionWanting to use a For Next variable in “xxxx.Rows.Count” Pin
smdevivo23-May-17 16:05
professionalsmdevivo23-May-17 16:05 
AnswerRe: Wanting to use a For Next variable in “xxxx.Rows.Count” Pin
Maciej Los23-May-17 20:55
mveMaciej Los23-May-17 20:55 
QuestionRe: Wanting to use a For Next variable in “xxxx.Rows.Count” Pin
ZurdoDev24-May-17 4:02
professionalZurdoDev24-May-17 4:02 
AnswerRe: Wanting to use a For Next variable in “xxxx.Rows.Count” Pin
Member 834559924-May-17 6:33
Member 834559924-May-17 6:33 
QuestionCreating Access 2007+ files Pin
JR21222-May-17 18:47
JR21222-May-17 18:47 
AnswerRe: Creating Access 2007+ files Pin
Richard MacCutchan22-May-17 21:54
mveRichard MacCutchan22-May-17 21:54 
GeneralRe: Creating Access 2007+ files Pin
JR21224-May-17 1:38
JR21224-May-17 1:38 
AnswerRe: Creating Access 2007+ files Pin
Maciej Los23-May-17 20:25
mveMaciej Los23-May-17 20:25 
QuestionYahoo Finance API Throwing 504 Status? Pin
Member 1321215119-May-17 22:57
Member 1321215119-May-17 22:57 
AnswerRe: Yahoo Finance API Throwing 504 Status? Pin
Afzaal Ahmad Zeeshan19-May-17 23:56
professionalAfzaal Ahmad Zeeshan19-May-17 23:56 
QuestionOutlook signature code suddenly causing "remote procedure call failed" message Pin
Member 1320910118-May-17 7:18
Member 1320910118-May-17 7:18 
AnswerRe: Outlook signature code suddenly causing "remote procedure call failed" message Pin
Richard MacCutchan18-May-17 21:43
mveRichard MacCutchan18-May-17 21:43 
GeneralRe: Outlook signature code suddenly causing "remote procedure call failed" message Pin
Member 134178014-Dec-19 3:07
Member 134178014-Dec-19 3:07 
GeneralRe: Outlook signature code suddenly causing "remote procedure call failed" message Pin
Richard MacCutchan4-Dec-19 3:28
mveRichard MacCutchan4-Dec-19 3:28 
GeneralRe: Outlook signature code suddenly causing "remote procedure call failed" message Pin
Member 134178014-Dec-19 3:32
Member 134178014-Dec-19 3:32 
GeneralRe: Outlook signature code suddenly causing "remote procedure call failed" message Pin
Richard MacCutchan4-Dec-19 3:45
mveRichard MacCutchan4-Dec-19 3:45 
QuestionRetrieving value from an XML file Pin
Ben Senior17-May-17 8:32
Ben Senior17-May-17 8:32 
I'm new to working with XML in VB.NET and would like a little help after tearing my hair out for a couple of days.

I have an XML file with the following structure:

XML
-<conceptGrp>
  -<descripGrp>
    <descrip type="subjectField">6411, 6821</descrip>
   </descripGrp>
  -<languageGrp>
    <language lang="DE" type="German"/>
   -<termGrp>
      <term>Scheren</term>
     -<descripGrp>
        <descrip type="termType">fullForm</descrip>
      </descripGrp>
     -<descripGrp>
        <descrip type="reliabilityCode">3</descrip>
      </descripGrp>
    </termGrp>
   </languageGrp>
  -<languageGrp>
    <language lang="EN" type="English"/>
   -<termGrp>
      <term>scissors</term>
     -<descripGrp>
        <descrip type="termType">fullForm</descrip>
      </descripGrp>
     -<descripGrp>
        <descrip type="reliabilityCode">3</descrip>
      </descripGrp>
    </termGrp>
   </languageGrp>
</conceptGrp>


First I need to cycle through all the elements in the file (>550000) and for each element extract the text
"6411, 6821" from
<descrip type="subjectField">6411, 6821</descrip>

and
"3" from
<descrip type="reliabilityCode">3</descrip>


The <descrpGrp> appears just once for each element.
The <languageGrp> appears at least twice but up to 20 times.
The <termGrp> appears mostly once but up to 10 times for each <languageGrp>.
The <descrpGrp> appears twice for each <termGrp>.
The <descrip type="reliabilityCode" ...> appears just once for each term.

Using the extracted strings I look them up and need to replace them with text in the element.

This is my code so far for getting the <descrip type="reliabilityCode">3</descrip>:

VB
' loop thro each element in XML doc and replace the reliabiltiy codes
        For Each conceptGrp In xDoc.Elements("conceptGrp")
            For Each languageGrp In conceptGrp.Elements("languageGrp")
                For Each termGrp In languageGrp.Elements("termGrp")
                    Dim code = termGrp.Element("reliabilityCode")
                    For Each descripGP In termGrp.Elements("descripGrp")
                        For Each descrip In descripGP.Elements("descrip")
                            Dim reliability As String = xDoc.selectSingleNode("/Categories/category[@descrip='reliability code']").InnerText

                        Next descrip
                    Next descripGP
                Next termGrp
            Next languageGrp
        Next conceptGrp


When I look in the locals window I can see "descrip" and for the first node the property "next node" with the value I want but I just can't grab it.

How can I easily get the value and then replace it in the element with my looked up text?

Thanks
Ben

modified 17-May-17 20:17pm.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.