Re: Writing SchemaLocation with XmlSerializer



declare a member of your type as this example in C#


[System.Xml.Serialization.XmlAttributeAttribute("schemaLocation",
Namespace = System.Xml.Schema.XmlSchema.InstanceNamespace)]
private string xsiSchemaLocation = "your schemalocation";

This will serliaze it as the schema location in your XML .

Joe Robe
RobeSoft.com


Marvin Massih wrote:
I've searched the entire MSDN documentation and Google, but I just don't
find a solution:

I have an .xsd file from which I had xsd.exe create classes.
How can I make the XmlSerializer write the SchemaLocation when it
serializes my XML classes? Maybe by using an XmlWriter?

-Marvin

.



Relevant Pages

  • Re: cannot load schema for the namespace
    ... Can you provide your schema and XML instance so the problem can be tracked ... It seems unlikely that this is simply due to schema location issues. ... > I have the XML document which refers to a xsd file located on a directory ... > I am able to view the XSD file in IE using the URL ...
    (microsoft.public.dotnet.xml)
  • Re: .NET features youd like to see in Win32
    ... VCL would support generics. ... XML classes built into VCL ...
    (borland.public.delphi.non-technical)
  • Re: Parsing XML from a String
    ... If you already have the XML in a string format, ... InnerText property of the XmlDocument to create a DOM Tree. ... > A problem I'm having is getting my head around the different XML classes ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: For security reasons DTD is prohibited in this XML document.
    ... XML classes. ... For security reasons DTD is prohibited in this XML document. ... settings)) ...
    (microsoft.public.dotnet.xml)
  • Re: Parsing XML with PHP - not DOM XML
    ... The XML extension to php implements expat. ... The manual has a very straight forward examples. ... But if you want a wrapper: I like the xml classes found here ...
    (comp.lang.php)