By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,041 Members | 1,018 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,041 IT Pros & Developers. It's quick & easy.

add xml validation schema in the xml file

P: n/a
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

Nov 9 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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/
Nov 9 '06 #2

P: n/a
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:
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/
Nov 17 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.