473,791 Members | 3,229 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Add Namespace to element tags?

I am exporting an XML file based on a dataset using VB.NET. This works fine
but the resulting xml file does not include namespace prefixes, which are
required by another tool I am trying to use (Altova Stylevision). (See
samples below) Stylevision won't see a file as valid unless it includes the
namespace prefixes? I am confused about the whole namespace issue? It is not
clear to me what the namespace really does here - or why it is needed? Is
there a way to have .NET create xml files that include the namespace?

========== XML without namespace info ==============
<?xml version="1.0" ?>
<NewDataSet>
<CGShows>
<RegionalID>Den ver</RegionalID>
<SeqNbr>1</SeqNbr>
<ShowName>Denve r SA Prelims Rnd 1</ShowName>
<ShowDate>200 4-07-24T00:00:00.000 0000-06:00</ShowDate>
<Type>SC</Type>
<PorF>P</PorF>
<Round>1</Round>
<Eqp1Judge>ADAM O S</Eqp1Judge>
<Mov1Judge>ADAM S R</Mov1Judge>
<Ens1Judge>BEEN S E</Ens1Judge>
<GE1Judge>ANDER SON M</GE1Judge>
<GE2Judge>BERTE LLE S</GE2Judge>
<TaPJudge>ARG Y T</TaPJudge>
<CGPerfSched>
<RegionalID>Den ver</RegionalID>
<SeqNbr>1</SeqNbr>
<PerfTime>200 4-07-24T09:00:00.000 0000-06:00</PerfTime>
<UnitID>10</UnitID>
<Nickname>Arapa hoe HS WG</Nickname>
<Class>SA</Class>
</CGPerfSched>
..............

========== XML With Namespace Info =============== =====
<?xml version="1.0"?>
<mstns:NewDataS et xmlns:mstns="ht tp://tempuri.org/SingleCGShow.xs d"
xmlns:msdata="u rn:schemas-microsoft-com:xml-msdata"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocat ion="http://tempuri.org/SingleCGShow.xs d
SingleCGShow.xs d">
<mstns:CGShow s>
<mstns:Regional ID>Denver</mstns:RegionalI D>
<mstns:SeqNbr>1 </mstns:SeqNbr>
<mstns:ShowName >Denver SA Prelims Rnd 1</mstns:ShowName>
<mstns:ShowDate >2004-07-24T00:00:00.000 0000-06:00</mstns:ShowDate>
<mstns:Type>S C</mstns:Type>
<mstns:PorF>P </mstns:PorF>
<mstns:Round> 1</mstns:Round>
<mstns:Eqp1Judg e>ADAMO S</mstns:Eqp1Judge >
<mstns:Mov1Judg e>ADAMS R</mstns:Mov1Judge >
<mstns:Ens1Judg e>BEENS E</mstns:Ens1Judge >
<mstns:GE1Judge >ANDERSON M</mstns:GE1Judge>
<mstns:GE2Judge >BERTELLE S</mstns:GE2Judge>
<mstns:TaPJudge >ARGY T</mstns:TaPJudge>
<mstns:CGPerfSc hed>
<mstns:Regional ID>Denver</mstns:RegionalI D>
<mstns:SeqNbr>1 </mstns:SeqNbr>
<mstns:PerfTime >2004-07-24T09:00:00.000 0000-06:00</mstns:PerfTime>
<mstns:UnitID>1 0</mstns:UnitID>
<mstns:Nickname >Arapahoe HS WG</mstns:Nickname>
<mstns:Class>SA </mstns:Class>
</mstns:CGPerfSch ed>
<mstns:CGPerfSc hed>
<mstns:Regional ID>Denver</mstns:RegionalI D>
<mstns:SeqNbr>1 </mstns:SeqNbr>
<mstns:PerfTime >2004-07-24T09:08:00.000 0000-06:00</mstns:PerfTime>
<mstns:UnitID>6 06</mstns:UnitID>
<mstns:Nickname >Loveland HS CG</mstns:Nickname>
<mstns:Class>SA </mstns:Class>
</mstns:CGPerfSch ed>
............... ....
Nov 12 '05 #1
2 3964
Wayne
I keep struggling with prefixes and namespaces too. Usually I keep playing
with the ElementFormDefa ult and AttributeFormDe fault properties until I get
the desired result.
Lukas

"Wayne Wengert" <wa************ ***@wengert.com > wrote in message
news:ed******** ********@TK2MSF TNGP11.phx.gbl. ..
I am exporting an XML file based on a dataset using VB.NET. This works fine but the resulting xml file does not include namespace prefixes, which are
required by another tool I am trying to use (Altova Stylevision). (See
samples below) Stylevision won't see a file as valid unless it includes the namespace prefixes? I am confused about the whole namespace issue? It is not clear to me what the namespace really does here - or why it is needed? Is
there a way to have .NET create xml files that include the namespace?

========== XML without namespace info ==============
<?xml version="1.0" ?>
<NewDataSet>
<CGShows>
<RegionalID>Den ver</RegionalID>
<SeqNbr>1</SeqNbr>
<ShowName>Denve r SA Prelims Rnd 1</ShowName>
<ShowDate>200 4-07-24T00:00:00.000 0000-06:00</ShowDate>
<Type>SC</Type>
<PorF>P</PorF>
<Round>1</Round>
<Eqp1Judge>ADAM O S</Eqp1Judge>
<Mov1Judge>ADAM S R</Mov1Judge>
<Ens1Judge>BEEN S E</Ens1Judge>
<GE1Judge>ANDER SON M</GE1Judge>
<GE2Judge>BERTE LLE S</GE2Judge>
<TaPJudge>ARG Y T</TaPJudge>
<CGPerfSched>
<RegionalID>Den ver</RegionalID>
<SeqNbr>1</SeqNbr>
<PerfTime>200 4-07-24T09:00:00.000 0000-06:00</PerfTime>
<UnitID>10</UnitID>
<Nickname>Arapa hoe HS WG</Nickname>
<Class>SA</Class>
</CGPerfSched>
.............

========== XML With Namespace Info =============== =====
<?xml version="1.0"?>
<mstns:NewDataS et xmlns:mstns="ht tp://tempuri.org/SingleCGShow.xs d"
xmlns:msdata="u rn:schemas-microsoft-com:xml-msdata"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocat ion="http://tempuri.org/SingleCGShow.xs d
SingleCGShow.xs d">
<mstns:CGShow s>
<mstns:Regional ID>Denver</mstns:RegionalI D>
<mstns:SeqNbr>1 </mstns:SeqNbr>
<mstns:ShowName >Denver SA Prelims Rnd 1</mstns:ShowName>
<mstns:ShowDate >2004-07-24T00:00:00.000 0000-06:00</mstns:ShowDate>
<mstns:Type>S C</mstns:Type>
<mstns:PorF>P </mstns:PorF>
<mstns:Round> 1</mstns:Round>
<mstns:Eqp1Judg e>ADAMO S</mstns:Eqp1Judge >
<mstns:Mov1Judg e>ADAMS R</mstns:Mov1Judge >
<mstns:Ens1Judg e>BEENS E</mstns:Ens1Judge >
<mstns:GE1Judge >ANDERSON M</mstns:GE1Judge>
<mstns:GE2Judge >BERTELLE S</mstns:GE2Judge>
<mstns:TaPJudge >ARGY T</mstns:TaPJudge>
<mstns:CGPerfSc hed>
<mstns:Regional ID>Denver</mstns:RegionalI D>
<mstns:SeqNbr>1 </mstns:SeqNbr>
<mstns:PerfTime >2004-07-24T09:00:00.000 0000-06:00</mstns:PerfTime>
<mstns:UnitID>1 0</mstns:UnitID>
<mstns:Nickname >Arapahoe HS WG</mstns:Nickname>
<mstns:Class>SA </mstns:Class>
</mstns:CGPerfSch ed>
<mstns:CGPerfSc hed>
<mstns:Regional ID>Denver</mstns:RegionalI D>
<mstns:SeqNbr>1 </mstns:SeqNbr>
<mstns:PerfTime >2004-07-24T09:08:00.000 0000-06:00</mstns:PerfTime>
<mstns:UnitID>6 06</mstns:UnitID>
<mstns:Nickname >Loveland HS CG</mstns:Nickname>
<mstns:Class>SA </mstns:Class>
</mstns:CGPerfSch ed>
............... ...

Nov 12 '05 #2
Thanks Lucas;

I'll look at that approach

Wayne

"Lukas Alber" <lu************ **@m.algacom.ch > wrote in message
news:ei******** ******@TK2MSFTN GP09.phx.gbl...
Wayne
I keep struggling with prefixes and namespaces too. Usually I keep playing
with the ElementFormDefa ult and AttributeFormDe fault properties until I get the desired result.
Lukas

"Wayne Wengert" <wa************ ***@wengert.com > wrote in message
news:ed******** ********@TK2MSF TNGP11.phx.gbl. ..
I am exporting an XML file based on a dataset using VB.NET. This works

fine
but the resulting xml file does not include namespace prefixes, which are required by another tool I am trying to use (Altova Stylevision). (See
samples below) Stylevision won't see a file as valid unless it includes

the
namespace prefixes? I am confused about the whole namespace issue? It is

not
clear to me what the namespace really does here - or why it is needed? Is there a way to have .NET create xml files that include the namespace?

========== XML without namespace info ==============
<?xml version="1.0" ?>
<NewDataSet>
<CGShows>
<RegionalID>Den ver</RegionalID>
<SeqNbr>1</SeqNbr>
<ShowName>Denve r SA Prelims Rnd 1</ShowName>
<ShowDate>200 4-07-24T00:00:00.000 0000-06:00</ShowDate>
<Type>SC</Type>
<PorF>P</PorF>
<Round>1</Round>
<Eqp1Judge>ADAM O S</Eqp1Judge>
<Mov1Judge>ADAM S R</Mov1Judge>
<Ens1Judge>BEEN S E</Ens1Judge>
<GE1Judge>ANDER SON M</GE1Judge>
<GE2Judge>BERTE LLE S</GE2Judge>
<TaPJudge>ARG Y T</TaPJudge>
<CGPerfSched>
<RegionalID>Den ver</RegionalID>
<SeqNbr>1</SeqNbr>
<PerfTime>200 4-07-24T09:00:00.000 0000-06:00</PerfTime>
<UnitID>10</UnitID>
<Nickname>Arapa hoe HS WG</Nickname>
<Class>SA</Class>
</CGPerfSched>
.............

========== XML With Namespace Info =============== =====
<?xml version="1.0"?>
<mstns:NewDataS et xmlns:mstns="ht tp://tempuri.org/SingleCGShow.xs d"
xmlns:msdata="u rn:schemas-microsoft-com:xml-msdata"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocat ion="http://tempuri.org/SingleCGShow.xs d
SingleCGShow.xs d">
<mstns:CGShow s>
<mstns:Regional ID>Denver</mstns:RegionalI D>
<mstns:SeqNbr>1 </mstns:SeqNbr>
<mstns:ShowName >Denver SA Prelims Rnd 1</mstns:ShowName>
<mstns:ShowDate >2004-07-24T00:00:00.000 0000-06:00</mstns:ShowDate>
<mstns:Type>S C</mstns:Type>
<mstns:PorF>P </mstns:PorF>
<mstns:Round> 1</mstns:Round>
<mstns:Eqp1Judg e>ADAMO S</mstns:Eqp1Judge >
<mstns:Mov1Judg e>ADAMS R</mstns:Mov1Judge >
<mstns:Ens1Judg e>BEENS E</mstns:Ens1Judge >
<mstns:GE1Judge >ANDERSON M</mstns:GE1Judge>
<mstns:GE2Judge >BERTELLE S</mstns:GE2Judge>
<mstns:TaPJudge >ARGY T</mstns:TaPJudge>
<mstns:CGPerfSc hed>
<mstns:Regional ID>Denver</mstns:RegionalI D>
<mstns:SeqNbr>1 </mstns:SeqNbr>
<mstns:PerfTime >2004-07-24T09:00:00.000 0000-06:00</mstns:PerfTime>
<mstns:UnitID>1 0</mstns:UnitID>
<mstns:Nickname >Arapahoe HS WG</mstns:Nickname>
<mstns:Class>SA </mstns:Class>
</mstns:CGPerfSch ed>
<mstns:CGPerfSc hed>
<mstns:Regional ID>Denver</mstns:RegionalI D>
<mstns:SeqNbr>1 </mstns:SeqNbr>
<mstns:PerfTime >2004-07-24T09:08:00.000 0000-06:00</mstns:PerfTime>
<mstns:UnitID>6 06</mstns:UnitID>
<mstns:Nickname >Loveland HS CG</mstns:Nickname>
<mstns:Class>SA </mstns:Class>
</mstns:CGPerfSch ed>
............... ...


Nov 12 '05 #3

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

Similar topics

1
2725
by: John L. Clark | last post by:
I am curious as to the rationale, and effect, of having default namespaces not applying (directly) to attributes (see http://www.w3.org/TR/REC-xml-names/#defaulting). Given an attribute without a namespace prefix, what is its namespace, if default namespaces do not apply? Are (either of) prefixed or non-prefixed attributes correct? For example, are the following equivalent: <html:br class="foo"...
3
3045
by: Tjerk Wolterink | last post by:
Hello i have xml code like this: <page:page xmlns:page="namespacefor page"> <page:section> <page:header> <b>Hello</b>There </page:header> <page:content> --- HTML CODE like: <i>Y</i>es i like bla bal <center>bla</center><img> alblalba
5
3125
by: Patient Guy | last post by:
In my reading of the Strict and Transitional DTD for HTML 4.0, the table row (TR) elements are contained within table section elements: THEAD, TFOOT, and TBODY. The table section elements are the defined contents of the TABLE element. The TR element is not defined as an "immediate" or "direct" contained element of TABLE. Given that
1
1643
by: John Ruiz | last post by:
hi. --short version-- i have an .xsd file (XML Schema). It has many elements in it (tags). Sometimes, my application wants to know everything there is to know (attributes, constraints, etc) about a specific element within that schema, and it cares nothing for the rest of the schema. If you tell the application more than it wants to know, if will get mad and probably eat you.
2
1187
by: Anirudh | last post by:
Hi, i have a SOAP XML which is similar to this: <request xmlns="http://www.someurl.com"> <abc> <xyz></xyz> <xyz></xyz> </abc> I need the same namespace for 'request' and 'abc' but i want to
0
2349
by: Steven Bolard | last post by:
Hello, I am trying to port my .net 1.1 application to 2.0. I am using vs2005. I am trying to get my webservices to run and although i can compile them and and get wsdl and service descriptions through internet explorer when hitting the ..asmx url, i cannot generate a proxy class to use in my winforms assembly. When i try to generate a proxy, i get no error message but nor do i get a reference.vb so there is no type info. If i then try...
1
1883
by: Rajesh | last post by:
I am trying to pass the namespace, which is in my Original Message, to a Java method for further processing. In the original message the xmlns:xenc namespace is present. I make a call to Java function and pass the whole XML message along with tags and values. In my Java function when I tried to print the XML message which is receieved by the XSLT proc. it has omitted the xmlns:xenc namespace which is creating a problem in Java function for...
1
2234
by: Arndt Jonasson | last post by:
The definition of XPath 1.0 says "A QName in the node test is expanded into an expanded-name using the namespace declarations from the expression context. This is the same way expansion is done for element type names in start and end-tags except that the default namespace declared with xmlns is not used: if the QName does not have a prefix, then the namespace URI is null (this is the same way attribute names are expanded). It is an error...
1
1587
by: Carmen Sei | last post by:
the follows defined - xmlns:xsd xmlns:sql namespace, does that means we are only using XSD tags + SQL tags? Other tags are invalid? Will XML editor like XMLSpy actually goes to the URL and get the tag list of each namespace??
0
9666
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
10201
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...
1
10147
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,...
1
7531
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
5424
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
5552
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4100
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
3709
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2910
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.