xml-namespaces

PHP: retrieve all declared namespaces of a DOMElement

一世执手 提交于 2019-12-19 17:38:04
问题 I am using the DOM extension to parse an xml file containing xml namespaces. I would have thought that namespace declarations are treated just like any other attribute, but my tests seem to disagree. I have a document that starts like this: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/"

Create similar to fb:tag

丶灬走出姿态 提交于 2019-12-19 11:27:16
问题 I would like to create something similar to fb: tag. For example if you put fb:comments in your code it would display your comments from Facebook. Ofcourse you need to include the Facebook xmlns in your HTML head. How can I create my own tags to perform for example encryption? For example: <myEncrypt:key>encrypted word</myEncrypt:key> Is that possible? I think it is. Can someone give me some directions on how to achive that? Thanks 回答1: Its actually done by javascript (if you are talking

Select default namespace in XPath with HtmlUnit

落爺英雄遲暮 提交于 2019-12-19 10:14:03
问题 I want to parse a Feedburner feed with HtmlUnit. The feed is this one: http://feeds.feedburner.com/alcoanewsreleases From this feed I want to read all item nodes, so normally a //item XPath should do the trick. Unfortunately that does not work in this case. groovy code snippet: def page = webClient.getPage("http://feeds.feedburner.com/alcoanewsreleases") def elements = page.getByXPath("//item") Sample of the XML feed: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl"

How can I handle XML namespaces in CSS Selectors or in jQuery?

时光总嘲笑我的痴心妄想 提交于 2019-12-19 07:53:37
问题 I use jQuery to parse an RSS feed. I can successfully get the RSS feed using AJAX: $.get("podcast.xml", function (data) { xml = $(data); }, "xml"); Now I can get the title of the podcast by using xml.find("channel > title").text() . How can I select the <itunes:image> tag in my RSS feed? The command xml.find("channel > itunes:image") does not work, because : separates in CSS the tag name and the pseudo class. I also tried xml.find("channel > image") but it does not work. How can I handle XML

Firefox add <a xmlns=“http://www.w3.org/1999/xhtml”>

巧了我就是萌 提交于 2019-12-18 17:02:09
问题 EDIT: This isn't happening because of the ajax call. I changed it to use a value from a TinyMCE component for fun and I get the same thing. content = tinyMCE.get('cComponent').getContent(); //content at this point is <p>test</p> valueToDisplay = content; If I do: jQuery(selector).html(valueToDisplay); I get: <p><a xmlns="http://www.w3.org/1999/xhtml">test</a></p> Has anyone ever seen this before using Firefox 3.6.10 and jQuery 1.4.2, I am trying to change a link text using the result from a

Without internet connection, how xmlns attribute can work and understand by browser?

梦想的初衷 提交于 2019-12-18 16:10:30
问题 A simple XHTML document, with the minimum of required tags: and xmlns attribute has a http link. If I am working on localhost and if I don't have an Internet connection, can't I work on XHTML? <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Title of the document</title> </head> <body> The content of the document...... </body> </html> 回答1: The XML namespace is just there to identify elements based on a namespace, which happens to be in a URI format. See the XML Namespaces spec. In

Android - The prefix “xmlns” cannot be bound to any namespace explicitly; neither can the namespace for “xmlns” be bound to any prefix explicitly

不问归期 提交于 2019-12-18 15:10:18
问题 Is anyone getting this "xmlns" namespace issue (see below)? I cannot build my work project anymore. At first I thought it was my git branch, so I switched to the origin develop and master branches - issue persists. I cleaned and rebuilt my project - issue persists. I cleaned and synched my grade files - issue persists. Finally I tried re-installing Android Studio and re-creating my git repository - issue persists. The prefix "xmlns" cannot be bound to any namespace explicitly; neither can the

Set up my own XML namespace?

こ雲淡風輕ζ 提交于 2019-12-18 13:19:48
问题 How can I setup my own XML namespace? 回答1: Just define a namespace in the root tag (or wherever you need the namespace). Example: <root xmlns:ns="some_identifier"> ns and the identifier can be (nearly) anything. See this quote: What Do Namespace Names Point At? One of the confusing things about all this is that namespace names are URLs; it's easy to assume that since they're Web addresses, they must be the address of something. They're not; these are URLs, but the namespace draft doesn't care

XML: do child nodes inherit parent's namespace prefix?

ε祈祈猫儿з 提交于 2019-12-18 12:48:36
问题 Assume the following XML document: <root xmlns:foo="..."> <foo:parent> <child/> </foo:parent> </root> does child element belong to a namespace that corresponds to the prefix foo ? Just like in case <foo:child/> ? 回答1: No. Child nodes do not inherit prefixed namespace by default, and explicit prefix addition needed as you mentioned : <foo:child/> . But they do inherit ancestor's default namespace (the one without prefix), if any : <root xmlns:foo="..."> <parent xmlns="bar"> <child/> </parent>

Why is XmlNamespaceManager necessary?

£可爱£侵袭症+ 提交于 2019-12-18 10:10:04
问题 I've come up kinda dry as to why -- at least in the .Net Framework -- it is necessary to use an XmlNamespaceManager in order to handle namespaces (or the rather clunky and verbose [local-name()=... XPath predicate/function/whatever) when performing XPath queries. I do understand why namespaces are necessary or at least beneficial, but why is it so complex? In order to query a simple XML Document (no namespaces)... <?xml version="1.0" encoding="ISO-8859-1"?> <rootNode> <nodeName>Some Text Here