Click here to Skip to main content
15,899,679 members
Home / Discussions / XML / XSL
   

XML / XSL

 
NewsRe: Project with source code Pin
BoneSoft25-Jun-07 11:27
BoneSoft25-Jun-07 11:27 
AnswerRe: Project with source code Pin
Sathesh Sakthivel17-Jul-07 1:55
Sathesh Sakthivel17-Jul-07 1:55 
Questionavoid the pdf refresh between server events Pin
haj_md24-Jun-07 0:39
haj_md24-Jun-07 0:39 
AnswerRe: avoid the pdf refresh between server events Pin
George L. Jackson24-Jun-07 3:01
George L. Jackson24-Jun-07 3:01 
Questionproblem while displaying xml with dtd Pin
koolprasad200321-Jun-07 21:23
professionalkoolprasad200321-Jun-07 21:23 
AnswerRe: problem while displaying xml with dtd Pin
Ilya Verbitskiy7-Jul-07 2:18
Ilya Verbitskiy7-Jul-07 2:18 
Questionsyncfusion datagrid and xml Pin
Keshav V. Kamat21-Jun-07 19:24
Keshav V. Kamat21-Jun-07 19:24 
QuestionChecking if a particular tags exists Pin
Brendan Vogt21-Jun-07 17:52
Brendan Vogt21-Jun-07 17:52 
Hi,


A section of my XML file looks like this:

<Products>
<Product>
<ID>SKU001</ID>
<ProductName>Yellow Marker</ProductName>
<ListPrice>45.0</ListPrice>
<Status>1</Status>
</Product>
<Product>
<ID>SKU003</ID>
<ProductName>Blue Marker</ProductName>
<ListPrice>10.45</ListPrice>
<Status>1</Status>
</Product>
</Products>

The tags in the Product tag are the names of my table fields. This file is used to import data into the product table. So I just loop through the elements, check the ID, and update that record.

I have to do a couple of checks. I do a check to see if the <ID></ID> tag is empty because this is my primary key, then it displays an error message. But what happens if there is no ID tag for a particular records, maybe for some or other reason it was not entered into the XML file. How do I check to see if a particular tag exists? Like for example:

<Product>
<ProductName>Blue Marker</ProductName>
<ListPrice>10.45</ListPrice>
<Status>1</Status>
</Product>

This is how I loop:

Dim productNodes As XmlNodeList
Dim productNode As XmlNode
Dim baseDataNodes As XmlNodeList

doc.Load(strPathFile)

productNodes = doc.GetElementsByTagName("Product")

For Each productNode In productNodes

baseDataNodes = productNode.ChildNodes

For Each baseDataNode As XmlNode In baseDataNodes
Next

Next

Please can some one help me.

Regards
ma se
AnswerRe: Checking if a particular tags exists Pin
George L. Jackson22-Jun-07 0:10
George L. Jackson22-Jun-07 0:10 
QuestionSelecting a particular element Pin
kumarjammula21-Jun-07 0:37
kumarjammula21-Jun-07 0:37 
AnswerRe: Selecting a particular element Pin
George L. Jackson21-Jun-07 11:51
George L. Jackson21-Jun-07 11:51 
GeneralRe: Selecting a particular element Pin
kumarjammula21-Jun-07 18:35
kumarjammula21-Jun-07 18:35 
QuestionMs Soap Toolkit 3.0 and complex data types. Pin
karanba21-Jun-07 0:19
karanba21-Jun-07 0:19 
Questionlooping in Xml nodes in C# Pin
saymajum20-Jun-07 13:40
saymajum20-Jun-07 13:40 
AnswerRe: looping in Xml nodes in C# Pin
Colin Angus Mackay20-Jun-07 14:11
Colin Angus Mackay20-Jun-07 14:11 
AnswerRe: looping in Xml nodes in C# [modified] Pin
George L. Jackson21-Jun-07 12:26
George L. Jackson21-Jun-07 12:26 
AnswerRe: looping in Xml nodes in C# Pin
George L. Jackson21-Jun-07 14:00
George L. Jackson21-Jun-07 14:00 
Questionencoded image into excel xml file using xsl Pin
ksrs19-Jun-07 3:54
ksrs19-Jun-07 3:54 
AnswerRe: encoded image into excel xml file using xsl Pin
George L. Jackson21-Jun-07 12:35
George L. Jackson21-Jun-07 12:35 
QuestionRe: encoded image into excel xml file using xsl Pin
ksrs21-Jun-07 13:27
ksrs21-Jun-07 13:27 
AnswerRe: encoded image into excel xml file using xsl Pin
George L. Jackson21-Jun-07 13:42
George L. Jackson21-Jun-07 13:42 
GeneralRe: encoded image into excel xml file using xsl Pin
ksrs22-Jun-07 15:55
ksrs22-Jun-07 15:55 
QuestionXML in app.config file in VB 2005 Pin
steve_rm19-Jun-07 3:03
steve_rm19-Jun-07 3:03 
AnswerRe: XML in app.config file in VB 2005 Pin
George L. Jackson21-Jun-07 12:55
George L. Jackson21-Jun-07 12:55 
QuestionXml Schema question Pin
Jamie Nordmeyer18-Jun-07 13:05
Jamie Nordmeyer18-Jun-07 13:05 

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.