Output a record in the Bag-proficient in android, IOS App application service development, and bagandroid

Source: Internet
Author: User

Output a record in the Bag-proficient in android, IOS App application service development, and bagandroid

Closed json format content

{“item”:    {<chtml>… …</chtml>    },"sort":@{int:@{item:getSuffix}+1}}

Organize a complete json format text output to the App together with the running result of the inner tag

Initialize records in the Bag (you can also query records from the database)

<Bag id = item suffix = 0> <we name = name> potato </we> <we name = price> 1.24 </we> <we name = unit> KG </ we> </bag> <bag id = item suffix = 1> <we name = name> T-shirt </we> <we name = price> 68 </we> <we name = unit> parts </we> </bag> <bag id = item suffix = 2> <we name = name> cola </we> <we name = price> 2.20 </we> <we name = unit> bottle </we> </bag> <bag id = item suffix = 3> <we name = name> book </we> <we name = price> 51.24 </we> <we name = unit> current </we> </bag>

Output one of them

<Name >@{ item: name }</name> <price value >@{ item: price }</price> <! -- Value attribute parameter indicates the output value without quotation marks --> <unit >@{ item: unit} </unit>

The value attribute parameter indicates the output value without quotation marks.

Result

{"Item": {"name": "", "price": 51.24, "unit": ""}, "sort": 4}

Complete code

{"Item": {<chtml> <! -- Data preparation, you can query from the database --> <bag id = item suffix = 0> <we name = name> Tudou </we> <we name = price> 1.24 </we> <we name = unit> KG </we> </bag> <bag id = item suffix = 1> <we name = name> T-shirt </we> <we name = price> 68 </we> <we name = unit> pieces </we> </bag> <bag id = item suffix = 2> <we name = name> cola </we> <we name = price> 2.20 </we> <we name = unit> bottle </we> </bag> <bag id = item suffix = 3> <we name = name> book </we> <we name = price> 51.24 </we> <we name = unit> book </we> </Bag> </chtml> <! -- Content in json format --> <name >@{ item: name} </name> <price value >@{ item: price} </price> <! -- Value attribute parameter indicates the output value without quotation marks --> <unit >@{ item: unit }</unit> </chtml >}, "sort" :@{ int: @ {item: getSuffix} + 1 }}

The example file _ samples/app/one. json is in the _ samples/app/directory of the Light-open platform.

Download related resources:
Mobile App server development from entry to entry: http://download.csdn.net/detail/tx18/8741611
Building mobile App server: http://download.csdn.net/detail/tx18/8737507 quickly
Light Open Platform will occasionally upgrade to provide you with more powerful and Easy functions, please pay attention to download the latest version: http://download.csdn.net/user/tx18

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.