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.
|
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
|