怎样把Google Blogger(博客)的JSON Schema转换成XML的Schema(XSD)?

时间:2022-04-13 08:36:58

在Google RESTFul API中,Google Blogger API(Google博客API)应该和我们的生活离得近期;由于差点儿非常多人每天都在看博客,都在写博客,,都听说过博客。在前面的Google的应用系统进行集成(5)和Google的应用系统进行集成(6)的系列文章中。我们提到了怎样把Google Calendar和Google Tasks的JSON Schema转换成XML的XSD的Schema。从博客的訪问量来看,还是有非常多志同道合的朋友们对这个比較感兴趣,因此,这个章节。我继续给大家奉献和分享一下怎样把Google Blogger的JSON Schema转换成XML的Schema(XSD)。首先我们先列出Google Blogger的JSON的Schema(https://www.googleapis.com/discovery/v1/apis/blogger/v3/rest)

怎样把Google Blogger(博客)的JSON Schema转换成XML的Schema(XSD)?

那么。怎样把Google Blogger的JSON Schema转换成XML的XSD Schema?XML的Schema将会是什么样子的呢?请參考以下转换实现。

<?xml version="1.0" encoding="UTF-8"?

> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:complexType> <xs:sequence> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="locale" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="pages" form="unqualified" minOccurs="0"/> <xs:element type="posts" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="BlogUserInfo" form="unqualified" minOccurs="0" maxOccurs="unbounded"/> <xs:element type="Blog" form="unqualified" minOccurs="0" maxOccurs="unbounded"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:boolean" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="Blog" form="unqualified" minOccurs="0" maxOccurs="unbounded"/> <xs:element type="BlogPerUserInfo" form="unqualified" minOccurs="0" maxOccurs="unbounded"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="Blogitems" form="unqualified" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="author" form="unqualified" minOccurs="0"/> <xs:element type="blog" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="inReplyTo" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="post" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="Comment" form="unqualified" minOccurs="0" maxOccurs="unbounded"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="author" form="unqualified" minOccurs="0"/> <xs:element type="blog" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="Page" form="unqualified" minOccurs="0" maxOccurs="unbounded"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="Pageviewsitems" form="unqualified" minOccurs="0" maxOccurs="unbounded"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="Pageviewsitems" form="unqualified" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="author" form="unqualified" minOccurs="0"/> <xs:element type="blog" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="Blogimages" form="unqualified" minOccurs="0" maxOccurs="unbounded"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element form="unqualified" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> <xs:element type="location" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="replies" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="Post" form="unqualified" minOccurs="0" maxOccurs="unbounded"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:boolean" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="Post" form="unqualified" minOccurs="0" maxOccurs="unbounded"/> <xs:element type="PostPerUserInfo" form="unqualified" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="PostUserInfo" form="unqualified" minOccurs="0" maxOccurs="unbounded"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="blogs" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="locale" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="image" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="xs:double" form="unqualified" minOccurs="0"/> <xs:element type="xs:double" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="Post" form="unqualified" minOccurs="0" maxOccurs="unbounded"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType> <xs:sequence> <xs:element type="Comment" form="unqualified" minOccurs="0" maxOccurs="unbounded"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> <xs:element type="xs:string" form="unqualified" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:element type="Blog"/> <xs:element type="BlogList"/> <xs:element type="BlogPerUserInfo"/> <xs:element type="BlogUserInfo"/> <xs:element type="Comment"/> <xs:element type="CommentList"/> <xs:element type="Page"/> <xs:element type="PageList"/> <xs:element type="Pageviews"/> <xs:element type="Post"/> <xs:element type="PostList"/> <xs:element type="PostPerUserInfo"/> <xs:element type="PostUserInfo"/> <xs:element type="PostUserInfosList"/> <xs:element type="User"/> </xs:schema>


 

怎样用Google APIs和Google的应用系统进行集成(8)----怎样把Google Blogger(博客)的JSON Schema转换成XML的Schema(XSD)?