M
Maansi Sanghi
Hello,
I am trying to write an xsd file using .NET System.Xml.Sxhema Class Library.
(1) I get an error while writitng if the XSD has a taregetnamespace.
(II) for any xsd with no targetnamespace the program works fine.
I want to create an xsd with the following namespaces
<xsd:schema targetNamespace"http://www.homedepot.com/HD"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:hd="http://www.homedepot.com/HD">
Following is the code
XmlSchema* schema = new XmlSchema();
XmlNamespaceManager* nsmgr = new XmlNamespaceManager(new NameTable());
nsmgr->AddNamespace("xs", "http://www.w3.org/2001/XMLSchema");
nsmgr->AddNamespace("hd", "http://www.homedepot.com/HD");
schema->TaregetNamspace = "http://www.homedepot.com/HD";
System::IO::FileStream* fs = new FileStream("XSDWrite.xsd",
FileMode::OpenOrCreate);
schema->Write(fs, nsmgr); ///UNKNOWN EXCEPTION WHILE writing
(111) Is there a limitation that the targetnamespace cannot be in the
namespace manager???
I am unable to find out the problem here
Thanks,
Maansi
I am trying to write an xsd file using .NET System.Xml.Sxhema Class Library.
(1) I get an error while writitng if the XSD has a taregetnamespace.
(II) for any xsd with no targetnamespace the program works fine.
I want to create an xsd with the following namespaces
<xsd:schema targetNamespace"http://www.homedepot.com/HD"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:hd="http://www.homedepot.com/HD">
Following is the code
XmlSchema* schema = new XmlSchema();
XmlNamespaceManager* nsmgr = new XmlNamespaceManager(new NameTable());
nsmgr->AddNamespace("xs", "http://www.w3.org/2001/XMLSchema");
nsmgr->AddNamespace("hd", "http://www.homedepot.com/HD");
schema->TaregetNamspace = "http://www.homedepot.com/HD";
System::IO::FileStream* fs = new FileStream("XSDWrite.xsd",
FileMode::OpenOrCreate);
schema->Write(fs, nsmgr); ///UNKNOWN EXCEPTION WHILE writing
(111) Is there a limitation that the targetnamespace cannot be in the
namespace manager???
I am unable to find out the problem here
Thanks,
Maansi