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

  • SEARCH
  • Home
  • 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 271155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:07:00+00:00 2026-05-12T00:07:00+00:00

My customer doesn’t want a database but would prefer to update their data in

  • 0

My customer doesn’t want a database but would prefer to update their data in an XML file. This is all well and good. However, they also want their items to be submitted to Google products. This complicates things a bit. I decided to attempt to just use the Google XML file for the database rather than create and maintain two separate files, but I’ve just hit a roadblock. My XML is like this:

<?xml version="1.0" encoding="utf-8" ?>
<feed xmlns:g="http://base.google.com/ns/1.0" 
xmlns:c="http://base.google.com/cns/1.0" xmlns="http://www.w3.org/2005/Atom">
<title>Company Product and Price Catalog</title>
<link rel="self" href="http://www.example.com" />
<author>
    <name>Some Company</name>
</author>
<id>tag:example.com:/App_Data/</id>
    <entry>
             <id>1</id>
        <title>Product Title</title>
        <g:price>100.00</g:price>
        <link href="http://www.example.com/product" />
        <g:image_link>http://www.example.com/images/product.jpg</g:image_link>
        <g:condition>new</g:condition>
        <g:brand>Brand Name</g:brand>
        <payment_accepted>cash,check,invoice,amex,discover,mastercard,
visa,googlecheckout</payment_accepted>
        <g:payment_notes>Google Checkout accepted</g:payment_notes>
    </entry>
....

And my code to extract this data is like this:

Dim allItems As New List(Of CartItem)
        Dim productXML As XDocument = XDocument.Load( _
Current.Server.MapPath("/App_Data/products.xml"))


    Dim productsDoc = System.Xml.Linq.XDocument.Parse(productXML.ToString())
    Dim products = From entry In productsDoc...<entry> Select entry

    For Each entry In products
        Dim product As New CartItem
        Dim nameAndOptions() As String = Split(entry.<title>.Value, " - ")
        product.ProductName = nameAndOptions(0)
        If nameAndOptions.Length = 2 Then
            product.[Option] = nameAndOptions(1)
        End If
        product.Price = entry.<g:price>.Value 'problem here!'
        product._productid = entry.<id>.Value
        product._permalink = entry.<link>.Value
        allItems.Add(product)
    Next

    Return allItems

A blue squiggly line appears in VS08 under the “g” in “g:price” with the error, “xml namespace prefix ‘g’ is not defined”. How do I fix this? Or is this just a bad idea and I should go back to maintaining two separate files?

Thank you!

  • 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-05-12T00:07:01+00:00Added an answer on May 12, 2026 at 12:07 am

    Try adding the following line to the top of your file:

    Imports <xmlns:g="http://base.google.com/ns/1.0">
    

    (I’ve never done VB 2008, so the syntax may be off)

    EDIT: See here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a developer at heart - but every now and then, a customer doesn't
A customer of ours has Quickbooks 2005 and is looking to have their web
For customer service week this year, I have the privileged task of creating a
Our customer would like to know who is online and currently using the custom
Problem: Customer X has requested that pages using XML DataBinding and Databound tables in
I want to put a rate/review this app feature into my app. Is there
we have a Java software to receive and send customer and contracts data from
I have a connection protocol that has been defined by our customer. Data are
Does something like this affect performance badly? var myQuery = from c in Customers
My customer is replacing MS Office with OpenOffice in some workstations. My program export

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.