IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Profile: SvenB
About
User Name: SvenB
Forum Rank: Newbie
Real Name:
Location Germany
Occupation:
Interests:
Gender: None Specified
Statistics
Joined: Tuesday, September 12, 2017
Last Visit: Tuesday, September 12, 2017 4:02:51 PM
Number of Posts: 1
[0.01% of all post / 0.00 posts per day]
Avatar
Last 10 Posts
Topic: XSD Schema to C# - Namespace Prefix Options?
Posted: Tuesday, September 12, 2017 3:09:37 PM
hello together,

I`m trying the Evaluation of XMLSpy. I have generate c# Code from my xsd.
So far ok. In my XML there is a Namespace and a prefix and in my xsd too.
For XML Example:
Code:

<itl:ExchangePackage xmlns:itl="http://standard/2-2008" xsi:schemaLocation="http://gsat/1.0 ../xsd/gsat/1.0/gsat.xsd">


and
Code:

<itl:PackageInformation>
        <ansi-nist:RecordCode>1</ansi-nist:RecordCode>
</itl:PackageInformation>


but in my c# Code the DataTypes was generate without Prefix "itl"
Code:

test doc = test.CreateDocument();
ExchangePackage root = doc.ExchangePackage.Append();
root.SetXsiType();
PackageInformation info = root.PackageInformation.Append();
RecordCode code = info.RecordCode.Append();
code.Value = "2";
doc.SaveToFile("test.xml", true);


The Output File Show me the DataType without prefix "itl"
Code:

<ExchangePackage
<PackageInformation>
    <RecordCode>1</RecordCategoryCode>
  </PackageInformation>
</ExchangePackage>


I would desire this outputfile and how can i set witch namesspaces will be Show for the datatypes?
Code:

<itl:ExchangePackage
<itl:PackageInformation>
    <itl:RecordCode>1</itl:RecordCategoryCode>
  </itl:PackageInformation>
</itl:ExchangePackage>


Best regards

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.