0

I am creating an xml document using xsd. When the xml got created the encoding value is

<?xml version="1.0" encoding="WINDOWS-1252"?>

what i required is

<?xml version="1.0" encoding="utf-8"?>

Here is my xsd.

<xs:element name="shiporder">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="orderperson" type="xs:string" />
            <xs:element name="shipto">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="name" type="xs:string" />
                        <xs:element name="address" type="xs:string" />
                        <xs:element name="city" type="xs:string" />
                        <xs:element name="country" type="xs:string" />
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="item" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="title" type="xs:string" />
                        <xs:element name="note" type="xs:string" minOccurs="0" />
                        <xs:element name="quantity" type="xs:positiveInteger" />
                        <xs:element name="price" type="xs:decimal" />
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
        <xs:attribute name="orderid" type="xs:string" use="required" />
    </xs:complexType>
</xs:element>

Can any please let me know why this is happening.

Hari
  • 245
  • 3
  • 6
  • 13
  • What did you use to make the XML? – Anders Lindahl May 07 '12 at 07:10
  • According to the link below, schema does not dictate the encoding: http://stackoverflow.com/questions/4412343/can-xsd-schema-validate-encoding-e-g-utf-8-possible – Edwin Bautista May 07 '12 at 07:19
  • am using Benerator, and the command is createXML.bat transactions.xsd shiporder tx-{0}.xml 2 – Hari May 07 '12 at 08:07
  • As both encoding="WINDOWS-1252" and encoding="utf-8" are single byte encoding the code will work. Bautista : Link was informative, Thank U – Hari May 08 '12 at 06:50

0 Answers0