在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

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvY2hhbmNlaW4wMDc=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center">

那么。怎样把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>

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

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

    前面说了一些Google API的介绍,可是在实际的开发其中,我们可能须要把Google RESTful API返回的JSON数据转换成XML数据输入到第三方系统,这在企业应用集成里面很的常见. 那么 ...

  2. 邮件发布google blogger 博客

    <?php $to = "@gmail.com";$subject = "Test mail";$message = "Hello! This ...

  3. 怎样用Google APIs和Google的应用系统进行集成(4)----获得Access Token以通过一些Google APIs的OAuth2认证

    在上篇文章中: "怎样用Google APIs和Google的应用系统进行集成(3)----调用发现Google APIs的RESTful的服务"一文中,我们直接用jdk的java ...

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

    [转载]国内网站博客数据统计选免费Google Analytics还是百度统计 Google Analytics谷歌统计是我用的第一个网站统计工具,当然现在也一直在用.Google Analytics ...

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

    title: 让搭建在Github Pages上的Hexo博客可以被Google搜索到 date: 2019-05-30 23:35:44 tags: 配置 --- 准备工作 搭建好的博客 npm & ...

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

    自从在 Github Page 落户以后,很长一段时间使用的是极简且有点艺术范儿的 fexo 主题,而不是大名鼎鼎的 next 主题.后来偶然发现了符合我审美的Hexo博客 maupassant 主题 ...

  7. 谷歌正式发布Google APIs Client Library for .NET

    好消息,特大好消息! 英文原文:Google API library for .NET paves the way for Google services on Windows phone 本月 17 ...

  8. Android SDK Manager Google Apis 下载

    本意是想利用google的gcm来实装android推送功能的,很遗憾, google貌似已经停止提供啥服务给国内了,或者说国内想继续使用google 服务暂时变得几乎不可能了.找了个代理来进行goo ...

  9. 怎样用Google APIs和Google的应用系统进行集成(3)----调用Google 发现(Discovery)API的RESTful服务

    说了这么多,那么首先同意我以Google Discovery RESTful服务为例,给大家演示怎样用最普通的Java代码调用Google Discovery RESTful服务. 引言: 在&quo ...

随机推荐

  1. RTSP详解

    关于 RTSP. RTSP协议是一个非常类似HTTP协议的流控制协议.它们都使用纯文本来发送信息,而且rtsp协议的语法也和HTTP类似.Rtsp一开始这样设计,也是为了能够兼容使用以前写的HTTP协 ...

  2. 牛客网数据库SQL实战 1-11

    1. 查找最晚入职员工的所有信息 CREATE TABLE `employees` ( `emp_no` ) NOT NULL, `birth_date` date NOT NULL, `first_ ...

  3. Melancholy(磨懒虫主义)

    题目大意:给出n个地点和q个询问.其中每个地点有距离和权值,每个询问给出l,r,k,表示在[l,r]区间内不取最小点的情况下任取k个,求所有情况权值之积之和(n,q<=1e5,k<=6). ...

  4. mysql多字段组合删除重复行

    DELETEFROM boll_paramWHERE id in ( SELECT a.id FROM ( SELECT id FROM boll_param WHERE (symbol, time_ ...

  5. 「LibreOJ β Round #3」绯色 IOI(抵达)

    [题解] 我们可以发现叶子节点的关联点一定是它的父亲节点,那么我们dfs一遍就可以求出所有节点的关联点,或者判断出无解. 对于每个点i,它的关联点u的危险度肯定比它连接的其他点vi的危险度小,我们从u ...

  6. PS日记二(调色:色阶,曲线,色相/饱和度,色彩平衡,蒙板)

    基础知识一:在PS操作中为什么要复制图层(ctrl+J)? 答:复制图层主要是为了 备份原图层,在副本中进行操作 如果说你副本弄坏了,还有原来的PS复制图层一方面是保全原图.二是因为图层是ps操作的基 ...

  7. PTA 03-树1 树的同构 (25分)

    题目地址 https://pta.patest.cn/pta/test/15/exam/4/question/711 5-3 树的同构   (25分) 给定两棵树T1和T2.如果T1可以通过若干次左右 ...

  8. 【转】关于大型网站技术演进的思考(十三)--网站静态化处理—CSI(5)

    讲完了SSI,ESI,下面就要讲讲CSI了 ,CSI是浏览器端的动静整合方案,当我文章发表后有朋友就问我,CSI技术是不是就是通过ajax来加载数据啊,我当时的回答只是说你的理解有点片面,那么到底什么 ...

  9. SPOJ LCS2 多个串的最长公共子串

    这里串最多有10个,找所有串的最长公共子串 这里后缀自动机做,以第一个串建立后缀自动机,后面的串一个个去匹配,每次得到当前串在可到达状态上所能得到的最长后缀长度 拿所有串匹配后得到的结果进行计算 #i ...

  10. HDU 5245

    题目大意: 每次随机选择两个点,便把这两个点之间形成的子矩阵上的每一个方块涂色,问随机选择k次,整个m*n的矩阵中有多少个小方块被涂上了颜色 这道题不难,但自己智商实在捉急,一直想不出来... 因为这 ...