all groups > dotnet xml > august 2004 >
You're in the

dotnet xml

group:

Add Namespace to element tags?


Add Namespace to element tags? Wayne Wengert
8/6/2004 8:40:32 AM
dotnet xml:
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>
...................

Re: Add Namespace to element tags? Lukas Alber
8/11/2004 9:03:15 PM
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

[quoted text, click to view]

Re: Add Namespace to element tags? Wayne Wengert
8/12/2004 12:48:59 PM
Thanks Lucas;

I'll look at that approach

Wayne

[quoted text, click to view]

AddThis Social Bookmark Button