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.

XSD Schema to C# - Namespace Prefix Options? Options · View
SvenB
Posted: Tuesday, September 12, 2017 3:09:37 PM
Rank: Newbie

Joined: 9/12/2017
Posts: 1
Location: Germany
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
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

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