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.

Generated Coded - C# Options · View
fsi
Posted: Friday, May 18, 2012 7:11:06 PM
Rank: Newbie

Joined: 11/25/2010
Posts: 2
I was given a XSD with the following definition

1a) <xsd:complexType name="DayCountFraction">
<xsd:annotation>
<xsd:documentation xml:lang="en">Calculation Basis</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="xsd:normalizedString">
<xsd:attribute name="dayCountFractionScheme" type="xsd:anyURI" default="http://www.fpml.org/coding-scheme/day-count-fraction-2-1"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>


1b) The sample XML associated with name="DayCountFraction".

<dayCountFraction dayCountFractionScheme="http://www.fpml.org/coding-scheme/day-count-fraction-2-1">ACT/360</dayCountFraction>




2a) Via XMLSpy's menu function: DTD/SChema > Generate Program Code, targeting Visual Studio 2008 C#. The code snippet is:


MyRootDoc.MyBase.Append().dayCountFractionScheme.Value ="ACT/360";


"Value" is the only settable field available.


2b) The generated XML is:

<dayCountFraction dayCountFractionScheme="ACT/360"/>



How can I get the program code to generate XML specified in "1b" ? Can this be accomplished without changing the XSD? If the XSD must be changed, please supply an example.
vlad
Posted: Saturday, May 19, 2012 10:53:54 AM
Rank: Advanced Member

Joined: 12/13/2005
Posts: 2,856
Location: Mauritius
dayCountFractionScheme is an attribute in your case. Why do you set it to "ACT/360" and not to "http://www.fpml.org/coding-scheme/day-count-fraction-2-1" ?

After Append(). there must be other functionality - not only dayCountFractionScheme. Read documentation
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.