namespace prefix problem

Sep 27, 2011 at 9:32 AM

Hello,

i use a linq to xsd to generate xml file following the xsd

i use a xsd like

 <xsd:schema xmlns:ocm="urn:my:namespace:Catalogue:1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:my:namespace:Catalogue:1" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1"

>

 

 

 

 

 

 

  <xsd:element name="Catalogue" type="ocm:CatalogueType"/>

 

 

 

 

 

 <xsd:complexType name="CatalogueType">

 



etc...

when i generate my xml file with the class generated with xsd to linq

I get

<?xml version="1.0" encoding="utf-8"?>
<Catalogue xmlns="urn:my:namespace:Catalogue:1">

etc..

 

 

and I would like to have the prefix namespace like

<?xml version="1.0" encoding="utf-8"?>
<ocm:Catalogue xmlns:ocm="urn:my:namespace:Catalogue:1">

etc....

How I can do this

 

thanks for your response

 

Sep 30, 2011 at 12:37 PM

Can we have a proper example Xsd please?

I don't know the answer but with an example I could have a stab.

J.