473,804 Members | 2,201 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problems creating xml documents with vb.net

OK.. I am creating an XML document (Fedex Tracking). And one of my
attributes on an element is supposed to have an "xsi:" before the attribute
name. It is in my code below.. but the output does not have the "xsi:" The
area to look at is the "noNamespaceSch emaLocation" Any ideas around this?

What I end up with is:

<?xml version="1.0" encoding="UTF-8" ?>

- <TrackShipmentR equest
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
noNamespaceSche maLocation="Tra ckShipment.xsd" DetailScanIndic ator="true"
Version="1.0">

Dim xPI As XmlProcessingIn struction

xPI = myDoc.CreatePro cessingInstruct ion("xml", "version='1 .0'
encoding='UTF-8'")

myDoc.AppendChi ld(xPI)

xElmntRoot = myDoc.CreateEle ment("TrackShip mentRequest")

xElmntRoot.SetA ttribute("xmlns :xsi",
"http://www.w3.org/2001/XMLSchema-instance")

xElmntRoot.SetA ttribute("xsi:n oNamespaceSchem aLocation",
"TrackShipment. xsd")

xElmntRoot.SetA ttribute("Detai lScanIndicator" , "true")

xElmntRoot.SetA ttribute("Versi on", "1.0")

myDoc.AppendChi ld(xElmntRoot)

Stacey Levine

Senior Systems Analyst

Value Music Concepts, Inc.

825-C Frankin Court

Marietta, GA 30067

Work: 770-919-2115 ext 55

Fax: 770-919-2219

St*****@musicfo rasong.com
Nov 11 '05 #1
2 3649
Stacey Levine wrote:

xElmntRoot.SetA ttribute("xsi:n oNamespaceSchem aLocation",
"TrackShipment. xsd")


You cannot set prefixed attribute this way. Only standard prefixes (like
xmlns: or xml:) are recognized. Use the following technique:

Dim attr As XmlAttribute
attr = myDoc.CreateAtt ribute("xsi:noN amespaceSchemaL ocation",
"http://www.w3.org/2001/XMLSchema-instance")
attr.Value = "TrackShipment. xsd"
xElmntRoot.SetA ttributeNode(at tr)

--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #2
Thanks.. I will give that a shot
"Oleg Tkachenko" <oleg@NO_SPAM_P LEASEtkachenko. com> wrote in message
news:e4******** ********@TK2MSF TNGP10.phx.gbl. ..
Stacey Levine wrote:

xElmntRoot.SetA ttribute("xsi:n oNamespaceSchem aLocation",
"TrackShipment. xsd")


You cannot set prefixed attribute this way. Only standard prefixes (like
xmlns: or xml:) are recognized. Use the following technique:

Dim attr As XmlAttribute
attr = myDoc.CreateAtt ribute("xsi:noN amespaceSchemaL ocation",
"http://www.w3.org/2001/XMLSchema-instance")
attr.Value = "TrackShipment. xsd"
xElmntRoot.SetA ttributeNode(at tr)

--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #3

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

Similar topics

32
4546
by: jp29 | last post by:
My take on problems composing, serving and rendering XHTML documents/web pages: 1. Typical conscientious web authors are producing XHTML documents (Web pages) that feature valid Markup and with the content (MIME) type specified as text/html (http://keystonewebsites.com/articles/mime_type.php). These pages are then loaded on to their Server where they are served to Rendering Agents (browsers) as HTML (SGML application) documents with no...
0
1286
by: Luther Hert | last post by:
I solved my problem, but I am not sure whether or not I understand how I arrived at the solution. I leraned about and checked: IIS> creating virtual directories> configuring web extensions > AspNet installation> and installing the lcoalhost web site. When I used Aspnet_regiis.exe to repair IIS Mappings for Asp.Net, my c:\drive directory was altered.
4
3679
by: sklett | last post by:
I've developed an ERP application that we use internally and works quite well. I receiving more and more requests from users to print various transactions, order forms, search results, etc. I haven't decided what the best way to do this is because I don't have much experience with generating printable forms. Early on I knew one of my modules would need to print a clear report so I used the open source SharpPDF library to generate the...
2
11293
by: renagade629 | last post by:
Can anybody help me understand what i'm doing wrong or what I'm missing? Is there anyother good and commendable C++ program I can use (free) from the internet like Dev C++? I'm having trouble doing basic compiling on this new Dev C++, when i try to print something like: #include<iostream.h> using namespace std; int main () { cout << "Hello to the world" << endl; system("PAUSE") return 0;
34
5375
by: Alexnb | last post by:
Gerhard Häring wrote: No, it didn't work, but it gave me some interesting feedback when I ran it in the shell. Heres what it told me: Traceback (most recent call last): File "<pyshell#10>", line 1, in <module> os.startfile("C:\Documents and Settings\Alex\My Documents\My
6
8151
by: Naresh Agarwal | last post by:
Hi I have been using DOM parser to create XML documents. I want to use an alternate mechanism to create XML document as size of my XML document is large and I don;t want the overhead of DOM (where entire tree in constructed in memory). Like SAX APIs for parsing XML documents, Is there any thing like SAX parser/APIs for creating XML documents?
6
1512
by: Lanny | last post by:
Well the othe day I was making a program to make a list of all the songs in certian directorys but I got a problem, only one of the directorys was added to the list. Heres my code: import random import os import glob songs = glob.glob('C:\Documents and Settings\Admin\My Documents\LimeWire\Saved\*.mp3')
6
2260
by: msb_6 | last post by:
Currently I have a PHP extension thats all written and compiles under windows, but the PC I'm going to end up putting it on is running Ubuntu 8.04 (g++ 4.2.3). I've delved into PHP documentation and ended up with a simple config.m4 file and the process to compile. However when I try to compile I get loads of errors that I didn't get when compiling under windows. I've managed to simplify the code down and create a simple extension (that...
1
4525
by: BobLewiston | last post by:
I tried to compile a Windows Forms Application in Visual C# 2008 Express with this source code from the CSharpSchool tutorial at Programmer's Heaven:using System; using System.Windows.Forms; using System.Drawing; namespace CSharpSchool { class HelloWinForm { static void Main () { Application.Run (new MyWindow ());
0
9715
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
9595
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,...
1
10354
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10097
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7642
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
6867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5535
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...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3835
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.