[Mono-bugs] [Bug 543742] New: XSL generation doesn't work

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Oct 2 03:00:27 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=543742


           Summary: XSL generation doesn't work
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.XML
        AssignedTo: atsushi at ximian.com
        ReportedBy: mkrueger at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Code for generating xsl:

public static string CreateSchema (string xml)
{
using (System.Data.DataSet dataSet = new System.Data.DataSet()) {
dataSet.ReadXml(new StringReader (xml), System.Data.XmlReadMode.InferSchema);
using (EncodedStringWriter writer = new EncodedStringWriter (Encoding.UTF8)) {
using (XmlTextWriter xmlWriter = XmlEditorService.CreateXmlTextWriter (writer))
{
   dataSet.WriteXmlSchema(xmlWriter);
   return writer.ToString();
}
}
}
}

Input:

<SyntaxMode name = "Xml">
    <Property name="BlockCommentStart">&lt;!--</Property>
</SyntaxMode>

Output mono:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xs:element name="NewDataSet" msdata:IsDataSet="true"
msdata:Locale="en-US">
        <xs:complexType>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:element name="SyntaxMode">
                    <xs:complexType>
                        <xs:attribute name="name" type="xs:string" />
                    </xs:complexType>
                </xs:element>
            </xs:choice>
        </xs:complexType>
    </xs:element>
</xs:schema>

Output Microsoft.NET:

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

<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">

    <xs:element name="SyntaxMode">

        <xs:complexType>

            <xs:sequence>

                <xs:element name="Property" nillable="true" minOccurs="0"
maxOccurs="unbounded">

                    <xs:complexType>

                        <xs:simpleContent msdata:ColumnName="Property_Text"
msdata:Ordinal="1">

                            <xs:extension base="xs:string">

                                <xs:attribute name="name" type="xs:string" />

                            </xs:extension>

                        </xs:simpleContent>

                    </xs:complexType>

                </xs:element>

            </xs:sequence>

            <xs:attribute name="name" type="xs:string" />

        </xs:complexType>

    </xs:element>

    <xs:element name="NewDataSet" msdata:IsDataSet="true"
msdata:UseCurrentLocale="true">

        <xs:complexType>

            <xs:choice minOccurs="0" maxOccurs="unbounded">

                <xs:element ref="SyntaxMode" />

            </xs:choice>

        </xs:complexType>

    </xs:element>

</xs:schema>

The microsoft xsl could be a bit prettier, but at leas it's valid for the
input.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list