- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
需要您的帮助..对于经验丰富的 Xmls 开发人员来说,这肯定是一个愚蠢的问题
我正在尝试阅读以下提要:
http://feeds.feedburner.com/Orangette
使用InputStream和Document来解析xml
如:文档 dom = db.parse(in);
这就是条目元素的样子:
<entry>
<id>tag:blogger.com,1999:blog-7793856.post-7139617615025474381</id>
<published>2011-03-21T10:42:00.000-07:00</published>
<updated>2011-03-21T10:44:11.297-07:00</updated>
<title type="text">It's called the Pantry</title>
<summary type="html">Well. World events don’t seem to get any less troubling, so we might as well get back to business. Yes?Last week, I said that I wanted to tell you about a new project, and I still do. It’s a project that grows out of Delancey, but it’s a whole new thing: a business headed up by two of our friends, Brandi Henderson and Olaiya Land. Brandon is technically the third partner, but this baby really <img src="http://feeds.feedburner.com/~r/Orangette/~4/X6Tm2_LpxYI" height="1" width="1"/></summary>
<link rel="replies" type="application/atom+xml" href="http://orangette.blogspot.com/feeds/7139617615025474381/comments/default" title="Post Comments" />
<link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=7793856&postID=7139617615025474381" title="163 Comments" />
<link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7793856/posts/default/7139617615025474381" />
<link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7793856/posts/default/7139617615025474381" />
<link rel="alternate" type="text/html" href="http://orangette.blogspot.com/2011/03/its-called-pantry.html" title="It's called the Pantry" />
<author>
<name>Molly</name>
<uri>http://www.blogger.com/profile/01493708300940204826</uri>
<email>cheeseandchocolate@gmail.com</email>
<gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07818414465072164731" />
</author>
<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-G2usp64xroc/TYaQ0wdcaUI/AAAAAAAAC_o/L4l6deIvm6U/s72-c/5544384475_858400a1f7_z.jpg" height="72" width="72" />
<thr:total>163</thr:total></entry>
除了只获取一个 rel 并采用 href 值外,一切正常
在本例中备用rel是相关的
<link rel="alternate" type="text/html" href="http://orangette.blogspot.com/2011/03/its-called pantry.html" title="It's called the Pantry" />
浪费了很多时间试图让他离开那里..但是nada,会很高兴得到任何线索..
最佳答案
好的,找到了我自己的解决方案,100% 确定有更干净的方法,但是......
因为我的应用程序支持低级别的 Android 平台,所以我无法使用 8 级 (2.2) 支持的 xpath
我的解决方案是:
public static String getTagValueWithMultiItem(Element eElement){
String returnVal = "" ;
Node eNode ;
int NumOFItem = eElement.getElementsByTagName("link").getLength();
for (int y = 0; y < NumOFItem; y++) {
eNode = eElement.getElementsByTagName("link").item(y);
NamedNodeMap attributes = eNode.getAttributes();
for (int g = 0; g < attributes.getLength(); g++) {
Attr attribute = (Attr)attributes.item(g);
if(attribute.getNodeName().equals("rel")&&attribute.getNodeValue().equals("alternate"))
{
try {
returnVal =eNode.getAttributes().getNamedItem("href").getNodeValue();
}
catch (Exception e) {
returnVal = e.toString();
}
}
}
}
return returnVal;
}
任何改进都会受到祝福
关于java - 使用 java DocumentBuilder 从 xml feed 获取 rel ="alternate"href 值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5452501/
我在尝试将网站图标和样式表添加到我正在尝试构建的个人网站时遇到问题。这是我目前拥有的: Super Chilun's Portfolio Hello World! favicon 部
我一直在和我的 friend 们一起从头开始建立一个论坛,只是为了好玩,我们开始看到机器人和爬虫过去了。我们遇到的问题是您可以加载包含四个回复的页面/post/1,并且每个回复都包含一个指向自身/re
在我的大部分网站中,我都有很多指向我的其他网站和其他外部网站的外部链接。我需要知道什么时候在网站中使用 rel="nofollow" 或 rel="external" 更好? 最佳答案 您可以使用 e
下图描述了ELF可重定位目标文件的格式: 我们知道 .rel.text 和 .rel.data 部分包含链接器需要重定位以生成最终可执行文件的重定位条目。 我的问题是,为什么要区分.rel.text
我有一个带有上一个和下一个链接的页面: 如果用户按向左箭头或向右箭头,是否可以使用 Javascript 来导航这些链接?如果他们正在编辑文本并且按下向左或向右箭头,则不应激活该链接。 这将用于简
我经常看到以下模式: " target="_blank" rel="noopener noreferrer"> 但据我所知,noreferrer暗示 noopener 的影响.那么为什么是 noope
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题吗? 通过 editing this post 添加细节并澄清问题. 关闭 8 年前。 Improve
我正在尝试对网站上的分页控件执行一些 SEO。 在 Google guidelines 之后,我想添加链接 rel=next/prev 即 到 我的搜索结果页面。 不幸的是,由于 MVC3 的设计决策
我正在尝试为我的 HTML5 站点实现一个为 XHTML 1.0 文档类型编写的 JQuery 图片库,问题是我不能在 HTML5 中使用自定义“rel”属性: tag --> $(documen
正如我在搜索结果中看到的许多丰富网页摘要标记,他们使用个人(个人)Google+ 个人资料完成了这些标记。那太好了。 那么,如果我使用我的 Google+ 企业品牌个人资料,是否合法。 请查看 Goo
我有一个页面,其中内置了基于 ajax 的分页。分页用于页面中的“评论”功能。根据 Google 的网站管理员博客,具有 rel="next"和 rel="prev"值有利于 SEO。 我在头部添加了
我们的网站目前正在使用“Yoast 的 WordPress SEO” rel="next" 和 rel="prev" 在类别和存档页面上工作正常,但是在我们创建的页面模板中,rel="next" 和
我想知道是因为我想存储除通常分配给 rel 的预定义关键字之外的其他内容……我只是想知道这是否是有效的 XHTML Strict。 最佳答案 据我所知,在 DTD(可以下载 from here )中:
我们有很多与 rel 的链接属性: One Two Three Four Five 还有一个ul : Some text Some text Some text Some te
只是为了确保它可以安全地与 JQuery 一起使用脚本。 最佳答案 它是 HTML 4.01 规范的一部分,只能用作 a 和 link 标签的属性(参见 the spec )。在 a 和 link 标
我在 PHPBB 论坛上使用移动模板 HTML 文件。我在 http://validator.w3.org/ 测试了 html 是否有错误测试结果出现如下错误 第 24 行,第 66 列:{navli
我注意到浏览器根本不使用“rel”属性,这是否使其成为存储 javascript 附加信息的理想位置(例如,删除 ajax 请求可以从 rel 中读取 id) 最佳答案 我假设您正在寻找一种方法来存储
我正在尝试验证我在其中实现了 Lightbox 的页面,但 W3C 认为 rel="lightbox['gallery']"是无效代码。代码是: ...image... 错误: Bad val
我可以为 rel 属性设置多个值吗?像这样: Link .. 它是否有效且跨浏览器兼容? 最佳答案 It's valid.不过,我不确定是否所有浏览器都支持它,但我猜是的。 rel = link-ty
我第一次尝试 rel=preload,将它用于几个样式表。这是有问题的代码: 我正在 Chrome 61 中进行测试,我可以看到样式表已按预期下载,但它们从未真正应用过,并且我在控制台上收到消息说
我是一名优秀的程序员,十分优秀!