473,396 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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>Denver</RegionalID>
<SeqNbr>1</SeqNbr>
<ShowName>Denver SA Prelims Rnd 1</ShowName>
<ShowDate>2004-07-24T00:00:00.0000000-06:00</ShowDate>
<Type>SC</Type>
<PorF>P</PorF>
<Round>1</Round>
<Eqp1Judge>ADAMO S</Eqp1Judge>
<Mov1Judge>ADAMS R</Mov1Judge>
<Ens1Judge>BEENS E</Ens1Judge>
<GE1Judge>ANDERSON M</GE1Judge>
<GE2Judge>BERTELLE S</GE2Judge>
<TaPJudge>ARGY T</TaPJudge>
<CGPerfSched>
<RegionalID>Denver</RegionalID>
<SeqNbr>1</SeqNbr>
<PerfTime>2004-07-24T09:00:00.0000000-06:00</PerfTime>
<UnitID>10</UnitID>
<Nickname>Arapahoe HS WG</Nickname>
<Class>SA</Class>
</CGPerfSched>
..............

========== XML With Namespace Info ====================
<?xml version="1.0"?>
<mstns:NewDataSet xmlns:mstns="http://tempuri.org/SingleCGShow.xsd"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tempuri.org/SingleCGShow.xsd
SingleCGShow.xsd">
<mstns:CGShows>
<mstns:RegionalID>Denver</mstns:RegionalID>
<mstns:SeqNbr>1</mstns:SeqNbr>
<mstns:ShowName>Denver SA Prelims Rnd 1</mstns:ShowName>
<mstns:ShowDate>2004-07-24T00:00:00.0000000-06:00</mstns:ShowDate>
<mstns:Type>SC</mstns:Type>
<mstns:PorF>P</mstns:PorF>
<mstns:Round>1</mstns:Round>
<mstns:Eqp1Judge>ADAMO S</mstns:Eqp1Judge>
<mstns:Mov1Judge>ADAMS R</mstns:Mov1Judge>
<mstns:Ens1Judge>BEENS E</mstns:Ens1Judge>
<mstns:GE1Judge>ANDERSON M</mstns:GE1Judge>
<mstns:GE2Judge>BERTELLE S</mstns:GE2Judge>
<mstns:TaPJudge>ARGY T</mstns:TaPJudge>
<mstns:CGPerfSched>
<mstns:RegionalID>Denver</mstns:RegionalID>
<mstns:SeqNbr>1</mstns:SeqNbr>
<mstns:PerfTime>2004-07-24T09:00:00.0000000-06:00</mstns:PerfTime>
<mstns:UnitID>10</mstns:UnitID>
<mstns:Nickname>Arapahoe HS WG</mstns:Nickname>
<mstns:Class>SA</mstns:Class>
</mstns:CGPerfSched>
<mstns:CGPerfSched>
<mstns:RegionalID>Denver</mstns:RegionalID>
<mstns:SeqNbr>1</mstns:SeqNbr>
<mstns:PerfTime>2004-07-24T09:08:00.0000000-06:00</mstns:PerfTime>
<mstns:UnitID>606</mstns:UnitID>
<mstns:Nickname>Loveland HS CG</mstns:Nickname>
<mstns:Class>SA</mstns:Class>
</mstns:CGPerfSched>
...................
Nov 12 '05 #1
2 3943
Wayne
I keep struggling with prefixes and namespaces too. Usually I keep playing
with the ElementFormDefault and AttributeFormDefault properties until I get
the desired result.
Lukas

"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:ed****************@TK2MSFTNGP11.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>Denver</RegionalID>
<SeqNbr>1</SeqNbr>
<ShowName>Denver SA Prelims Rnd 1</ShowName>
<ShowDate>2004-07-24T00:00:00.0000000-06:00</ShowDate>
<Type>SC</Type>
<PorF>P</PorF>
<Round>1</Round>
<Eqp1Judge>ADAMO S</Eqp1Judge>
<Mov1Judge>ADAMS R</Mov1Judge>
<Ens1Judge>BEENS E</Ens1Judge>
<GE1Judge>ANDERSON M</GE1Judge>
<GE2Judge>BERTELLE S</GE2Judge>
<TaPJudge>ARGY T</TaPJudge>
<CGPerfSched>
<RegionalID>Denver</RegionalID>
<SeqNbr>1</SeqNbr>
<PerfTime>2004-07-24T09:00:00.0000000-06:00</PerfTime>
<UnitID>10</UnitID>
<Nickname>Arapahoe HS WG</Nickname>
<Class>SA</Class>
</CGPerfSched>
.............

========== XML With Namespace Info ====================
<?xml version="1.0"?>
<mstns:NewDataSet xmlns:mstns="http://tempuri.org/SingleCGShow.xsd"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tempuri.org/SingleCGShow.xsd
SingleCGShow.xsd">
<mstns:CGShows>
<mstns:RegionalID>Denver</mstns:RegionalID>
<mstns:SeqNbr>1</mstns:SeqNbr>
<mstns:ShowName>Denver SA Prelims Rnd 1</mstns:ShowName>
<mstns:ShowDate>2004-07-24T00:00:00.0000000-06:00</mstns:ShowDate>
<mstns:Type>SC</mstns:Type>
<mstns:PorF>P</mstns:PorF>
<mstns:Round>1</mstns:Round>
<mstns:Eqp1Judge>ADAMO S</mstns:Eqp1Judge>
<mstns:Mov1Judge>ADAMS R</mstns:Mov1Judge>
<mstns:Ens1Judge>BEENS E</mstns:Ens1Judge>
<mstns:GE1Judge>ANDERSON M</mstns:GE1Judge>
<mstns:GE2Judge>BERTELLE S</mstns:GE2Judge>
<mstns:TaPJudge>ARGY T</mstns:TaPJudge>
<mstns:CGPerfSched>
<mstns:RegionalID>Denver</mstns:RegionalID>
<mstns:SeqNbr>1</mstns:SeqNbr>
<mstns:PerfTime>2004-07-24T09:00:00.0000000-06:00</mstns:PerfTime>
<mstns:UnitID>10</mstns:UnitID>
<mstns:Nickname>Arapahoe HS WG</mstns:Nickname>
<mstns:Class>SA</mstns:Class>
</mstns:CGPerfSched>
<mstns:CGPerfSched>
<mstns:RegionalID>Denver</mstns:RegionalID>
<mstns:SeqNbr>1</mstns:SeqNbr>
<mstns:PerfTime>2004-07-24T09:08:00.0000000-06:00</mstns:PerfTime>
<mstns:UnitID>606</mstns:UnitID>
<mstns:Nickname>Loveland HS CG</mstns:Nickname>
<mstns:Class>SA</mstns:Class>
</mstns:CGPerfSched>
..................

Nov 12 '05 #2
Thanks Lucas;

I'll look at that approach

Wayne

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

"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:ed****************@TK2MSFTNGP11.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>Denver</RegionalID>
<SeqNbr>1</SeqNbr>
<ShowName>Denver SA Prelims Rnd 1</ShowName>
<ShowDate>2004-07-24T00:00:00.0000000-06:00</ShowDate>
<Type>SC</Type>
<PorF>P</PorF>
<Round>1</Round>
<Eqp1Judge>ADAMO S</Eqp1Judge>
<Mov1Judge>ADAMS R</Mov1Judge>
<Ens1Judge>BEENS E</Ens1Judge>
<GE1Judge>ANDERSON M</GE1Judge>
<GE2Judge>BERTELLE S</GE2Judge>
<TaPJudge>ARGY T</TaPJudge>
<CGPerfSched>
<RegionalID>Denver</RegionalID>
<SeqNbr>1</SeqNbr>
<PerfTime>2004-07-24T09:00:00.0000000-06:00</PerfTime>
<UnitID>10</UnitID>
<Nickname>Arapahoe HS WG</Nickname>
<Class>SA</Class>
</CGPerfSched>
.............

========== XML With Namespace Info ====================
<?xml version="1.0"?>
<mstns:NewDataSet xmlns:mstns="http://tempuri.org/SingleCGShow.xsd"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tempuri.org/SingleCGShow.xsd
SingleCGShow.xsd">
<mstns:CGShows>
<mstns:RegionalID>Denver</mstns:RegionalID>
<mstns:SeqNbr>1</mstns:SeqNbr>
<mstns:ShowName>Denver SA Prelims Rnd 1</mstns:ShowName>
<mstns:ShowDate>2004-07-24T00:00:00.0000000-06:00</mstns:ShowDate>
<mstns:Type>SC</mstns:Type>
<mstns:PorF>P</mstns:PorF>
<mstns:Round>1</mstns:Round>
<mstns:Eqp1Judge>ADAMO S</mstns:Eqp1Judge>
<mstns:Mov1Judge>ADAMS R</mstns:Mov1Judge>
<mstns:Ens1Judge>BEENS E</mstns:Ens1Judge>
<mstns:GE1Judge>ANDERSON M</mstns:GE1Judge>
<mstns:GE2Judge>BERTELLE S</mstns:GE2Judge>
<mstns:TaPJudge>ARGY T</mstns:TaPJudge>
<mstns:CGPerfSched>
<mstns:RegionalID>Denver</mstns:RegionalID>
<mstns:SeqNbr>1</mstns:SeqNbr>
<mstns:PerfTime>2004-07-24T09:00:00.0000000-06:00</mstns:PerfTime>
<mstns:UnitID>10</mstns:UnitID>
<mstns:Nickname>Arapahoe HS WG</mstns:Nickname>
<mstns:Class>SA</mstns:Class>
</mstns:CGPerfSched>
<mstns:CGPerfSched>
<mstns:RegionalID>Denver</mstns:RegionalID>
<mstns:SeqNbr>1</mstns:SeqNbr>
<mstns:PerfTime>2004-07-24T09:08:00.0000000-06:00</mstns:PerfTime>
<mstns:UnitID>606</mstns:UnitID>
<mstns:Nickname>Loveland HS CG</mstns:Nickname>
<mstns:Class>SA</mstns:Class>
</mstns:CGPerfSched>
..................


Nov 12 '05 #3

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

Similar topics

1
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...
3
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...
5
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...
1
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)...
2
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
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...
1
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...
1
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...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...
0
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...

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.