Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7839859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:34:22+00:00 2026-06-02T15:34:22+00:00

2 question pumped up after trying to edit an xml file in vb, i

  • 0

2 question pumped up after trying to edit an xml file in vb, i try-ed to find answer around but those did not worked as expected, what i’m trying to achieve is that for those transport_orders that have negative , replace the negative value with its positive.Keep in mind that the values is a number with 2 decimals and it’s positive shouls remain in the same format.

Source xml looks like this:

<transport_orders>
<transport_order>
<id>NOCCO/12-006798_1</id>
<order_number>NOCCO/12-006798_1</order_number>
<order_date>2012-03-30</order_date>
<contactId>C04396</contactId>
<productId>0103-01101025</productId>
<sum>3135.51</sum>
<currency_code></currency_code>
<reference>NOCCO/12-006798</reference>
<amounts>
<amount>
<unit_code>kg</unit_code>
<value>-324.00</value>
</amount>
</amounts>
<pickup_task>
<addressid>BUCU</addressid>
<task_window>
<from_instant>2012-04-20T18:26:43</from_instant>
<till_instant>2012-04-20T18:26:43</till_instant>
</task_window>
</pickup_task>
<delivery_task>
<addressid>C04396_1</addressid>
<task_window>
<from_instant>2012-04-23T00:00:00</from_instant>
<till_instant>2012-04-24T00:00:00</till_instant>
</task_window>
</delivery_task>
</transport_order>
<transport_order>
...
  1. What I have tryed is the code underneath, but i think i’m missing something because the value is a number with 2 decimals and the only result i got is instead 324 i get 32400

    element.Element(“amounts”).Element(“amount”).Element(“value”).decimal(“n2”) = -element.Element(“amounts”).Element(“amount”).Element(“value”).Value

  2. How can i replace from 2012-04-20T18:26:43 only the date or only the hors, for example i would like to edit the pickup task’s-time window-from_instant date with the date of the dilivery’s task-time windows-till instant, but keep the time(hour,min,sec) intact.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T15:34:25+00:00Added an answer on June 2, 2026 at 3:34 pm
        Dim doc = <transport_orders>
                      <transport_order>
                          (...)
                      </transport_order>
                  </transport_orders>
    
        Dim culture = New CultureInfo("en")
    
        Dim negativeAmmounts = (From item In doc.Descendants("value")
                               Let value = Double.Parse(item.Value, culture)
                               Where value < 0
                               Select New With {
                                   .Item = item,
                                   .Value = value
                               }).ToList()
    
        negativeAmmounts.ForEach(Sub(e) e.Item.Value = -1 * e.Value)
    

    After that you can check if all values were replaced, for example by printing the whole document into a string:

        Dim outerXml = doc.ToString()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Question 1: Why not change pagination after click (pagination page change but it no)?
Question says it all. I tried browsing through the latest tag but could not
Question is rather simple but I couldn't find nice & clean solution to my
Question 1: Is is possible to throw an exception that will not be caught
Question: I need to read a CSV file. I use the FileHelpers library to
Question I'm creating a service for my app, but there's probably pritty simple thing
I've been trying to find a good architecture for one application for the last
Question is not correctly framed i know, how do i code the below logic
Question: Can I override default functions in Javascript? Background: After figuring out that I
Question I need to make a short write to a file every 15 seconds

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.