HighTechTalks DotNet Forums  

add xml validation schema in the xml file

VB.net microsoft.public.dotnet.languages.vb


Discuss add xml validation schema in the xml file in the VB.net forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
martin1
 
Posts: n/a

Default add xml validation schema in the xml file - 11-09-2006 , 09:45 AM






Hi, All,

I want to add xml validation schema namespace attribute for AutoData root
node(xsi:noNamespaceSchemaLocation="C:\AutoDataSch ema.xsd")in the following
file

<AutoData >
<Table1>
<Data1> 10 </Data1>
<Data2> 20 </Data2>
<Data3> 40 </Data3>
<Table1>
</AutoData>

So finally the file with valiation schema namespace is like this:

<AutoData xsi:noNamespaceSchemaLocation="C:\AutoDataSchema.x sd">
<Table1>
<Data1> 10 </Data1>
<Data2> 20 </Data2>
<Data3> 40 </Data3>
<Table1>
</AutoData>

Anyone knows how to add it?

Thanks
Martin


Reply With Quote
  #2  
Old   
Martin Honnen
 
Posts: n/a

Default Re: add xml validation schema in the xml file - 11-09-2006 , 11:03 AM






martin1 wrote:

Quote:
I want to add xml validation schema namespace attribute for AutoData root
node(xsi:noNamespaceSchemaLocation="C:\AutoDataSch ema.xsd")in the following
file

AutoData xsi:noNamespaceSchemaLocation="C:\AutoDataSchema.x sd"
But why did you want to remove the xmlns:xsi namespace declaration in an
earlier post? That does not make sense, you cannot simply have the
xsi:noNamespaceSchemaLocation attribute without having xmlns:xsi
declared properly.

As for adding an attribute look into the SetAttribute method on XmlElement.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/


Reply With Quote
  #3  
Old   
martin1
 
Posts: n/a

Default Re: add xml validation schema in the xml file - 11-17-2006 , 08:31 AM



Hi, Martin,

when I add attibute <xsi:noNamespaceSchemaLocation="C:\AutoDataSchema. xsd">
using SetAttibute, it drop "xsi:" and just add
<noNamespaceSchemaLocation="C:\AutoDataSchema.xsd" >, do you know why?

Thanks for your time

Martin

"Martin Honnen" wrote:

Quote:
martin1 wrote:

I want to add xml validation schema namespace attribute for AutoData root
node(xsi:noNamespaceSchemaLocation="C:\AutoDataSch ema.xsd")in the following
file

AutoData xsi:noNamespaceSchemaLocation="C:\AutoDataSchema.x sd"

But why did you want to remove the xmlns:xsi namespace declaration in an
earlier post? That does not make sense, you cannot simply have the
xsi:noNamespaceSchemaLocation attribute without having xmlns:xsi
declared properly.

As for adding an attribute look into the SetAttribute method on XmlElement.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.