473,803 Members | 2,792 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hwo to handle empty fields in XML

The following XML has an empty <UserDefinedT ag /(first record)
My VB.NET app got stuck here because I don't know how to handle it. It works
fine with a vlid user defined tag (next record)

<UserDefinedTag >40320121</UserDefinedTag>

Your help is greatly apprecited!!

Bill

- <JACOData>
- <Inventorys>
- <Inventory Type="Physical" >
<Product>Dyed Diesel</Product>
<TankNumber>150 08230383-1</TankNumber>
<UserDefinedT ag />
<DateTime>1/14/2007 1:00:49 PM</DateTime>
<Volume>308.122 </Volume>
<Ullage>2674.88 </Ullage>
<Height>12</Height>
<WaterHeight>3. 4</WaterHeight>
<DaystoEmpty> 1</DaystoEmpty>
</Inventory>

- <Inventory Type="Physical" >
<Product>Clea r Diesel</Product>
<TankNumber>150 08230411-1</TankNumber>
<UserDefinedTag >40320121</UserDefinedTag>
<DateTime>1/14/2007 12:00:49 PM</DateTime>
<Volume>308.122 </Volume>
<Ullage>5805.88 </Ullage>
<Height>12</Height>
<WaterHeight>-9.44</WaterHeight>
<DaystoEmpty> 0</DaystoEmpty>
</Inventory>
- </Inventory>
</Inventorys>
</JACOData>

Jan 18 '07 #1
4 2719
Bill,

Check to see if the UserDefinedTag has children. If so, you know there's a
value supplied, if not, it doesn't have one.

Robert

"Bill Nguyen" <bi************ *****@jaco.comw rote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
The following XML has an empty <UserDefinedT ag /(first record)
My VB.NET app got stuck here because I don't know how to handle it. It
works
fine with a vlid user defined tag (next record)

<UserDefinedTag >40320121</UserDefinedTag>

Your help is greatly apprecited!!

Bill

- <JACOData>
- <Inventorys>
- <Inventory Type="Physical" >
<Product>Dyed Diesel</Product>
<TankNumber>150 08230383-1</TankNumber>
<UserDefinedT ag />
<DateTime>1/14/2007 1:00:49 PM</DateTime>
<Volume>308.122 </Volume>
<Ullage>2674.88 </Ullage>
<Height>12</Height>
<WaterHeight>3. 4</WaterHeight>
<DaystoEmpty> 1</DaystoEmpty>
</Inventory>

- <Inventory Type="Physical" >
<Product>Clea r Diesel</Product>
<TankNumber>150 08230411-1</TankNumber>
<UserDefinedTag >40320121</UserDefinedTag>
<DateTime>1/14/2007 12:00:49 PM</DateTime>
<Volume>308.122 </Volume>
<Ullage>5805.88 </Ullage>
<Height>12</Height>
<WaterHeight>-9.44</WaterHeight>
<DaystoEmpty> 0</DaystoEmpty>
</Inventory>
- </Inventory>
</Inventorys>
</JACOData>

Jan 18 '07 #2
Robert;

This element doesn't have children.
All I need to know is how to detect an empty element so the application
(VB.NET) can react properly.

Thanks!

Bill

"Robert May" <ra************ ****@hotmail.co mwrote in message
news:O2******** *****@TK2MSFTNG P04.phx.gbl...
Bill,

Check to see if the UserDefinedTag has children. If so, you know there's
a value supplied, if not, it doesn't have one.

Robert

"Bill Nguyen" <bi************ *****@jaco.comw rote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
>The following XML has an empty <UserDefinedT ag /(first record)
My VB.NET app got stuck here because I don't know how to handle it. It
works
fine with a vlid user defined tag (next record)

<UserDefinedTa g>40320121</UserDefinedTag>

Your help is greatly apprecited!!

Bill

- <JACOData>
- <Inventorys>
- <Inventory Type="Physical" >
<Product>Dyed Diesel</Product>
<TankNumber>150 08230383-1</TankNumber>
<UserDefinedT ag />
<DateTime>1/14/2007 1:00:49 PM</DateTime>
<Volume>308.122 </Volume>
<Ullage>2674.88 </Ullage>
<Height>12</Height>
<WaterHeight>3. 4</WaterHeight>
<DaystoEmpty> 1</DaystoEmpty>
</Inventory>

- <Inventory Type="Physical" >
<Product>Clea r Diesel</Product>
<TankNumber>150 08230411-1</TankNumber>
<UserDefinedTag >40320121</UserDefinedTag>
<DateTime>1/14/2007 12:00:49 PM</DateTime>
<Volume>308.122 </Volume>
<Ullage>5805.88 </Ullage>
<Height>12</Height>
<WaterHeight>-9.44</WaterHeight>
<DaystoEmpty> 0</DaystoEmpty>
</Inventory>
- </Inventory>
</Inventorys>
</JACOData>


Jan 19 '07 #3
String.IsNullOr Empty(myNode.In nerText)


Jan 19 '07 #4
Thanks Keith!

This works well.

Bill
"Keith Patrick" <ri************ *******@nospam. hotmail.comwrot e in message
news:ea******** ********@TK2MSF TNGP02.phx.gbl. ..
String.IsNullOr Empty(myNode.In nerText)


Jan 19 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
10147
by: Abhi | last post by:
FYI: This message is for the benefit of MS Access Community. I found that this prblem has been encounterd by many but there is hardly any place where a complete solution is posted. So I thought I should give back to the community by posting our findings. Thanks you all for all your help till now by posting problems and their solutions. ~Abhijit
5
24641
by: Krechting | last post by:
Hi ALl, I have a code that checks if the documents in a hyperlink field are still where they should be. I use fileexist(). First I want to filter out all the hyperlink fields that are empty. I open a recordset and browse through all the fields to check for the word file. I cannot filter out the empty fields. I have tried: If Len(.Fields("Link") <> 0 then and: If Not IsNull(.Fields("Link")) then
6
4328
by: Ravikanth[MVP] | last post by:
Hi Alternative is check before assigning as TextBox value. TextBox1.Text =myRow==DBNull.Value)?"": (string)myRow HTH Ravikanth
22
4238
by: EMW | last post by:
Hi, I managed to create a SQL server database and a table in it. The table is empty and that brings me to my next chalenge: How can I get the info in the table in the dataset to go in an empty SQL table? Is there a short way like the FILL method to get data into the dataset or do I have to read each datarow in the table and write it one at the time to the
0
886
by: dmac | last post by:
Hi, Im real new at this so be gentle. I want to create a customer object based on the results of an sql query to the customers table, ie one object per row, and then add each of these objects to an arraylist and then on to some datbinding in a listbox. Therefore, for each row sent back by the datareader, I try to create the new customer object and pass all the data in the row as part of the constructor. But, I declared the data fields in...
7
3471
by: Dabbler | last post by:
I'm using an ObjectDataSource with a stored procedure and am getting the following error when trying to update (ExecuteNonQuery): System.Data.SqlClient.SqlException: Procedure or Function 'UpdateRegistrant' expects parameter '@EMail', which was not supplied. The field value was null in the database and not changed in the FormView so is null going back into the stored procedure. I'm stumped and would greatly appreciate any suggestions.
0
1111
by: gnotev | last post by:
Hi look at this code, it gets a record and prints the column values: $rs = $conn->Execute("SELECT * FROM products WHERE ID = ".$_GET); $id = $rs->Fields("ID"); $nm = $rs->Fields("name"); $ds = $rs->Fields("desc"); $ct = $rs->Fields("cat"); $tt = $rs->Fields("title"); $pp = $rs->Fields("picpath"); echo...
1
6219
by: G04 | last post by:
Hi All, I have a continuous form with all records. For each field there is a combo in the form header and the form also contains a Toggle button "Apply Filter". When clicked, it changes to "Cancel Filter". Then an SQL string with condition meeting the criteria input in the combo boxes is built. I have noticed that when certain fields are not filled in (no space, nothing), the record is simply not shown. The empty field is not necessarily...
3
4053
by: GazK | last post by:
I am hoping someone can steer me towards an elegant solution to a simple problem. I have a query result which returns an array of details about a physical building, including its address. The relevant fields are: $row $row $row $row
0
9703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9565
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10550
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10317
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9125
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7604
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5501
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3799
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.