TClientDataSet导出的xml格式是怎样的?

解决方案 »

  1.   

    把TClientDataSet.Xmldata的内容显示出来看一下就行了
    Xml格式网上很多的,随便搜索一下就有了
      

  2.   

    你打开看一下不就知道了, 不是标准的XML格式
      

  3.   

    元数据示例:
    <?xml version="1.0" standalone="yes"?>  
    <DATAPACKET Version="2.0">
    <METADATA>
    <FIELDS>
    <FIELD attrname="F_ID" fieldtype="i4"/>
    <FIELD attrname="F_Name" fieldtype="string" WIDTH="32"/>
    <FIELD attrname="F_Note" fieldtype="string" WIDTH="255"/>
    <FIELD attrname="F_String" fieldtype="string" WIDTH="32"/>
    <FIELD attrname="F_Integer" fieldtype="i4"/>
    <FIELD attrname="F_Smallint" fieldtype="i2"/>
    <FIELD attrname="F_Word" fieldtype="ui2"/>
    <FIELD attrname="F_Float" fieldtype="r8"/>
    <FIELD attrname="F_Currency" fieldtype="r8" SUBTYPE="Money"/>
    <FIELD attrname="F_BCD" fieldtype="fixed" DECIMALS="10" WIDTH="32"/>
    <FIELD attrname="F_Boolean" fieldtype="boolean"/>
    <FIELD attrname="F_Date" fieldtype="date"/>
    <FIELD attrname="F_Bytes" fieldtype="bin.hex" WIDTH="16"/>
    <FIELD attrname="F_Time" fieldtype="time"/>
    <FIELD attrname="F_DateTime" fieldtype="dateTime"/>
    <FIELD attrname="F_WideString" fieldtype="string.uni" WIDTH="64"/>
    </FIELDS><PARAMS/>
    </METADATA>
    <ROWDATA>
    </ROWDATA>
    </DATAPACKET>

    字段类型参考:
    类型        类型名称                子类型名             DECIMALS             字段宽度
    整型:       fieldtype="i4"
    字符型:     fieldtype="string"                                                WIDTH="32"
    短整型:     fieldtype="i2"
    Word:       fieldtype="ui2"
    浮点型:     fieldtype="r8"
    货币型:     fieldtype="r8"          SUBTYPE="Money"
    BCD:        fieldtype="fixed"                            DECIMALS="10"        WIDTH="32"
    Boolean:    fieldtype="boolean"
    日期型:     fieldtype="date"
    时间型:     fieldtype="time"
    字节型:     fieldtype="bin.hex"                                               WIDTH="16"
    日期时间型: fieldtype="dateTime"
    Unicode:    fieldtype="string.uni"                                            WIDTH="32"使用非ASCII码的多语言,请使用Uicode字符串.
    注意:使用Unicode字符串时,WIDTH参数为字节数,如果想显示8个中文,则应该使用32.我研究过动态生成字段,即用以上的规则自动生成一个XML元数据文件,然后载入到ClientDataSet中,实现字段的横向动态,用于复杂的报表,很好使。上面的内容是原创。
      

  4.   

    <PARAMS CHANGE_LOG="1 0 4 2 0 4 3 0 4 4 0 4 5 0 4 6 0 4 7 0 4 8 1 8 9 2 8 10 3 8 11 5 8 12 11 8 13 12 8 14 6 8 15 10 8 16 9 8 17 14 8"/>能不能问一下这是什么?
    standalone="yes"代表什么?
      

  5.   

    yifei1900(逸飞):正是需要这些,谢谢你,对了,你的QQ是多少?这方面的资料哪里有?