Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

AppML 参考 - 数据文件


"data" 属性

"data" 属性将数据文件定义为数据源。它具有以下**子属性**

元素 描述
"type" 数据文件的类型("csvfile"、"xmlfile" 或 "jsonfile")
"filename" 文件名
"record" XML 数据节点的名称(如果为 xmlfile)
"items" 数据项

来自文本文件的数据

此模型从逗号分隔的文本文件中获取包含标题、艺术家和价格(作为项目 1、2 和 5)的记录

模型

{
"data": {
    "type"    : "csvfile",
    "filename": "cd_catalog.txt",
    "items"   : [
        {"name": "Title", "index": 1},
        {"name": "Artist","index": 2},
        {"name": "Price", "index": 5}
    ]
}
}
自己尝试 »

示例说明:案例文本文件


来自 XML 文件的数据

此模型从 XML 文件中 CD 节点获取包含标题、艺术家和价格的记录

模型

{
"data": {
    "type"    : "xmlfile",
    "filename": "cd_catalog.xml",
    "record"  : "CD",
    "items"   : [
        {"name": "Artist", "nodename": "ARTIST"},
        {"name": "Title",  "nodename": "TITLE"},
        {"name": "Country","nodename": "COUNTRY"}
    ]
}
}
自己尝试 »

示例说明:案例 XML 文件



来自 JSON 文件的数据

此模型从 JSON 文件中 CD 对象的数组获取包含标题、艺术家和价格的记录

模型

{
"data" : {
    "type" : "jsonfile",
    "filename" : "cd_catalog.js",
    "record" : "cd",
    "items" : [
        {"name" : "Title", "nodename" : "title"},
        {"name" : "Artist", "nodename" : "artist"},
        {"name" : "Price", "nodename" : "price"}
    ]
}
}
自己尝试 »

示例说明:案例 JSON 文件


×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
[email protected]

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
[email protected]

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.