Groups | Blog | Home
all groups > dotnet xml > april 2004 >

dotnet xml : schema error



fivemagic
4/28/2004 11:26:05 AM
Hi all !

My app is a asp .net page that validate a xml using a schema. But it only works (validate the xml file) when i replace the namespace "http://tempuri.org/" in xml and xsd files with a physical path of my app "c:\inetpub\wwwroot\xml\".
How can i use the virtual path ?

Priya Lakshminarayanan [MSFT]
4/28/2004 2:17:04 PM
Can you post your xml and xsd?

Thanks,
Priya

[quoted text, click to view]
works (validate the xml file) when i replace the namespace
"http://tempuri.org/" in xml and xsd files with a physical path of my app
"c:\inetpub\wwwroot\xml\".
[quoted text, click to view]

five magic
4/29/2004 10:43:45 AM
my xml:

<?xml version="1.0" encoding="UTF-8"?>
<Books xmlns="http://tempuri.org/Books.xsd">
<book>
<name>TESTE 1</name>
<isbn>isbn-0001</isbn>
</book>
<book>
<name>TESTE 2</name>
<isbn>isbn-0002</isbn>
</book>
</Books>

my xsd:

<?xml version="1.0"?>
<xs:schema id="Books" targetNamespace="http://tempuri.org/Books.xsd"
xmlns:mstns="http://tempuri.org/Books.xsd"
xmlns="http://tempuri.org/Books.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:element name="Books" msdata:IsDataSet="true" msdata:Locale="pt-BR"
msdata:EnforceConstraints="False">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="book">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string" minOccurs="0" />
<xs:element name="isbn" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>



*** Sent via Developersdex http://www.developersdex.com ***
AddThis Social Bookmark Button