Home All Groups Group Topic Archive Search About

add xml validation schema in the xml file

Author
9 Nov 2006 3:45 PM
martin1
Hi, All,

I want to add xml validation schema namespace attribute for AutoData root
node(xsi:noNamespaceSchemaLocation="C:\AutoDataSchema.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.xsd">
<Table1>
<Data1>  10 </Data1>
<Data2>  20 </Data2>
<Data3>  40 </Data3>
<Table1>
</AutoData>

Anyone knows how to add it?

Thanks
Martin

Author
9 Nov 2006 5:03 PM
Martin Honnen
martin1 wrote:

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

> <AutoData xsi:noNamespaceSchemaLocation="C:\AutoDataSchema.xsd">

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/
Author
17 Nov 2006 2:31 PM
martin1
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

Show quoteHide quote
"Martin Honnen" wrote:

> martin1 wrote:
>
> > I want to add xml validation schema namespace attribute for AutoData root
> > node(xsi:noNamespaceSchemaLocation="C:\AutoDataSchema.xsd")in the following
> > file
>
> > <AutoData xsi:noNamespaceSchemaLocation="C:\AutoDataSchema.xsd">
>
> 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/
>