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

在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的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 name="Blog">
		<xs:sequence>
			<xs:element name="customMetaData" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="description" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="id" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="kind" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="locale" type="locale" form="unqualified" minOccurs="0"/>
			<xs:element name="name" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="pages" type="pages" form="unqualified" minOccurs="0"/>
			<xs:element name="posts" type="posts" form="unqualified" minOccurs="0"/>
			<xs:element name="published" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="selfLink" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="updated" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="url" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="BlogList">
		<xs:sequence>
			<xs:element name="blogUserInfos" type="BlogUserInfo" form="unqualified" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="items" type="Blog" form="unqualified" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="kind" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="BlogPerUserInfo">
		<xs:sequence>
			<xs:element name="blogId" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="hasAdminAccess" type="xs:boolean" form="unqualified" minOccurs="0"/>
			<xs:element name="kind" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="photosAlbumKey" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="role" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="userId" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="BlogUserInfo">
		<xs:sequence>
			<xs:element name="blog" type="Blog" form="unqualified" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="blog_user_info" type="BlogPerUserInfo" form="unqualified" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="kind" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="Blogimages">
		<xs:sequence>
			<xs:element name="items" type="Blogitems" form="unqualified" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="Blogitems">
		<xs:sequence>
			<xs:element name="url" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="Comment">
		<xs:sequence>
			<xs:element name="author" type="author" form="unqualified" minOccurs="0"/>
			<xs:element name="blog" type="blog" form="unqualified" minOccurs="0"/>
			<xs:element name="content" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="id" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="inReplyTo" type="inReplyTo" form="unqualified" minOccurs="0"/>
			<xs:element name="kind" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="post" type="post" form="unqualified" minOccurs="0"/>
			<xs:element name="published" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="selfLink" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="status" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="updated" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="CommentList">
		<xs:sequence>
			<xs:element name="items" type="Comment" form="unqualified" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="kind" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="nextPageToken" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="prevPageToken" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="Page">
		<xs:sequence>
			<xs:element name="author" type="author" form="unqualified" minOccurs="0"/>
			<xs:element name="blog" type="blog" form="unqualified" minOccurs="0"/>
			<xs:element name="content" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="id" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="kind" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="published" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="selfLink" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="status" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="title" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="updated" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="url" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="PageList">
		<xs:sequence>
			<xs:element name="items" type="Page" form="unqualified" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="kind" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="Pageviews">
		<xs:sequence>
			<xs:element name="blogId" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="counts" type="Pageviewsitems" form="unqualified" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="kind" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="Pageviewscounts">
		<xs:sequence>
			<xs:element name="items" type="Pageviewsitems" form="unqualified" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="Pageviewsitems">
		<xs:sequence>
			<xs:element name="count" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="timeRange" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="Post">
		<xs:sequence>
			<xs:element name="author" type="author" form="unqualified" minOccurs="0"/>
			<xs:element name="blog" type="blog" form="unqualified" minOccurs="0"/>
			<xs:element name="content" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="customMetaData" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="id" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="images" type="Blogimages" form="unqualified" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="kind" type="xs:string" form="unqualified" minOccurs="0"/>
                           <xs:element name="labels" form="unqualified" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="location" type="location" form="unqualified" minOccurs="0"/>
			<xs:element name="published" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="replies" type="replies" form="unqualified" minOccurs="0"/>
			<xs:element name="selfLink" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="status" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="title" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="titleLink" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="updated" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="url" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="PostList">
		<xs:sequence>
			<xs:element name="items" type="Post" form="unqualified" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="kind" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="nextPageToken" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="PostPerUserInfo">
		<xs:sequence>
			<xs:element name="blogId" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="hasEditAccess" type="xs:boolean" form="unqualified" minOccurs="0"/>
			<xs:element name="kind" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="postId" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="userId" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="PostUserInfo">
		<xs:sequence>
			<xs:element name="kind" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="post" type="Post" form="unqualified" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="post_user_info" type="PostPerUserInfo" form="unqualified" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="PostUserInfosList">
		<xs:sequence>
			<xs:element name="items" type="PostUserInfo" form="unqualified" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="kind" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="nextPageToken" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="User">
		<xs:sequence>
			<xs:element name="about" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="blogs" type="blogs" form="unqualified" minOccurs="0"/>
			<xs:element name="created" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="displayName" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="id" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="kind" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="locale" type="locale" form="unqualified" minOccurs="0"/>
			<xs:element name="selfLink" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="url" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="author">
		<xs:sequence>
			<xs:element name="displayName" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="id" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="image" type="image" form="unqualified" minOccurs="0"/>
			<xs:element name="url" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="blog">
		<xs:sequence>
			<xs:element name="id" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="blogs">
		<xs:sequence>
			<xs:element name="selfLink" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="image">
		<xs:sequence>
			<xs:element name="url" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="inReplyTo">
		<xs:sequence>
			<xs:element name="id" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="locale">
		<xs:sequence>
			<xs:element name="country" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="language" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="variant" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="location">
		<xs:sequence>
			<xs:element name="lat" type="xs:double" form="unqualified" minOccurs="0"/>
			<xs:element name="lng" type="xs:double" form="unqualified" minOccurs="0"/>
			<xs:element name="name" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="span" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="pages">
		<xs:sequence>
			<xs:element name="selfLink" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="totalItems" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="post">
		<xs:sequence>
			<xs:element name="id" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="posts">
		<xs:sequence>
			<xs:element name="items" type="Post" form="unqualified" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="selfLink" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="totalItems" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="replies">
		<xs:sequence>
			<xs:element name="items" type="Comment" form="unqualified" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="selfLink" type="xs:string" form="unqualified" minOccurs="0"/>
			<xs:element name="totalItems" type="xs:string" form="unqualified" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:element name="Blog" type="Blog"/>
	<xs:element name="BlogList" type="BlogList"/>
	<xs:element name="BlogPerUserInfo" type="BlogPerUserInfo"/>
	<xs:element name="BlogUserInfo" type="BlogUserInfo"/>
	<xs:element name="Comment" type="Comment"/>
	<xs:element name="CommentList" type="CommentList"/>
	<xs:element name="Page" type="Page"/>
	<xs:element name="PageList" type="PageList"/>
	<xs:element name="Pageviews" type="Pageviews"/>
	<xs:element name="Post" type="Post"/>
	<xs:element name="PostList" type="PostList"/>
	<xs:element name="PostPerUserInfo" type="PostPerUserInfo"/>
	<xs:element name="PostUserInfo" type="PostUserInfo"/>
	<xs:element name="PostUserInfosList" type="PostUserInfosList"/>
	<xs:element name="User" type="User"/>
</xs:schema>
时间: 2024-10-12 16:51:17

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

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

在Google RESTFul API中,Google Blogger API(Google博客API)应该和我们的生活离得最近:因为几乎很多人每天都在看博客,都在写博客,都听说过博客.在前面的Google的应用系统进行集成(5)和Google的应用系统进行集成(6)的系列文章中,我们提到了如何把Google Calendar和Google Tasks的JSON Schema转换成XML的XSD的Schema:从博客的访问量来看,还是有很多志同道合的朋友们对这个比较感兴趣,因此,这个章节,我继续

如何用Google APIs和Google的应用系统进行集成(5)----如何把Google Tasks的JSON Schema转换成XML的Schema(XSD)?

前面说了一些Google API的介绍,但是在实际的开发当中,我们可能需要把Google RESTful API返回的JSON数据转换成XML数据输入到第三方系统,这在企业应用集成里面非常的常见.那么里面就有一个问题,如何确保转换后的XML数据格式是规范的,这就需要XML Schema(XML)来进行校验.现在关键是,我们只知道Google API的JSON的schema,但是Google RESTful并没有提供返回数据的XML的schema,那么XML的Schema将会是什么样子的呢?让我以

如何用Google APIs和Google的应用系统进行集成(6)----如何把Google Calendar的JSON Schema转换成XML的Schema(XSD)?

有Google Task的地方,一般都会有Google Calendar,我在上个章节给大家分享了,如何用Google APIs和Google的应用系统进行集成(5)----如何把Google Tasks的JSON Schema转换成XML的Schema(XSD)?(http://blog.csdn.net/chancein007/article/details/29645055),那么Google Calendar的JSON Schema转换成XML的Schema将会是什么样子的呢?首先我们先

如何用Google APIs和Google的应用系统进行集成(7)----在把JSON转换成XML数据过程中,JSON数据中包含违背XML数据规范:XML节点名不能只是数字的解决方案

http://passport.baidu.com/?business&un=%E6%8C%89%E6%91%A9%E7%BE%8E%E5%A5%B3%E6%89%BE%E5%89%91%E6%B2%B3#0 http://passport.baidu.com/?business&un=%E5%8C%85%E5%A4%9C%E9%95%87%E8%BF%9C%E7%BE%8E%E5%A5%B3%E6%89%BE#0 http://passport.baidu.com/?business&a

Unable to resolve target &#39;Google Inc.:Google APIs:8&#39;

当从网上下载一个Android项目打开的时候,有可能就会报错:Unable to resolve target 'Google Inc.:Google APIs:8' 这是由于项目的target使用的是Google的API,但我们的Eclipse中并没有装相应的SDK包,系统查找不到自然就报错了,自己也遇到过这个问题,现在把解决方法写出来给一些遇到同样问题的朋友一点帮助吧! 首先我要讲的第一个方法是网上大部分人说的解决办法 (一)在项目里面找到project.properties打开,将里面的t

Google的黑科技Swiffy:Flash文件转换成HTML5将于7月下线

Google于今日宣布了将停止支持Swiffy的消息,作为一款将.SWF(Adobe Flash)文件转换成HTML5格式的工具,它将于7月1号与大家告别.与此同时,Swiffy Flash扩展也将停止工作.Google AdWords应用程序接口(API)团队的Danial Klimkin在一篇博客文章中写到:“我们将结束Swiffy运行时,但你在截止日期前转换的任意文件都还可以继续播放”. Google于5年前开放了Swiffy,最初只是作为谷歌实验室的一款产品而存在,旨在让Flash动画在

【转载】国内网站博客数据统计选免费Google Analytics还是百度统计

[转载]国内网站博客数据统计选免费Google Analytics还是百度统计 Google Analytics谷歌统计是我用的第一个网站统计工具,当然现在也一直在用.Google Analytics凭借其强大的功能和超强的稳定性.快速的反应能力.广泛的数据应用功能,受到了广大站长的追捧. 使用Google Analytics的站长们应该不在少数吧,每天登录Google Analytics免费网站上查看网站的流量也是我们这些站长们必须做的事情,认真分析Google Analytics当中的数据信

让搭建在Github Pages上的Hexo博客可以被Google搜索到

title: 让搭建在Github Pages上的Hexo博客可以被Google搜索到 date: 2019-05-30 23:35:44 tags: 配置 --- 准备工作 搭建好的博客 npm & hexo 版本合适 Google服务可用 本地配置 运行:npm install hexo-generator-sitemap --save,这样每次使用hexo g都会生成sitemap.xml Google Search端配置 首先进行验证,推荐使用添加meta信息到主页的方式进行验证,我之前

Hexo博客maupassant主题添加Google Adsense广告

自从在 Github Page 落户以后,很长一段时间使用的是极简且有点艺术范儿的 fexo 主题,而不是大名鼎鼎的 next 主题.后来偶然发现了符合我审美的Hexo博客 maupassant 主题,准备好好经营,但是更新博客的动力不足.新的一年开始,我终于决定引入 Google Adsense ,让自己的博客显得主流一点,如果能够顺便赚些零花钱当然更好了.本文默认读者已经注册了 Adsense 账号,下面仅仅分享一下具体的设置步骤,方便自己以后备查. 从 Adsense 中下载具体广告模块代