xml-namespaces

XSLT works in IE, not in Chrome or Firefox

馋奶兔 提交于 2019-11-28 02:10:14
Given a normal nhibernate config file: <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="http://localhost/xmlStylesheets/nhibernate.xsl"?> <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> <session-factory> <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property> <property name="dialect">NHibernate.Dialect.Oracle10gDialect</property> <property name="connection.driver_class">NHibernate.Driver.OracleDataClientDriver</property> <property name="connection.connection_string">Data Source=MyDB;User ID=MyUser;Connection Lifetime=0

Facebook Connect Won't Validate

时光总嘲笑我的痴心妄想 提交于 2019-11-28 02:06:01
I'm trying to get my Facebook Connect code to validate, but it won't. I think the problem is that their xmlns page isn't loading. I have the code: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xml:lang="en" lang="en"> But http://www.facebook.com/2008/fbml isn't found. Does anyone have a copy of what it should be? Is there a different URL i should use? The XML namespace doesn't need to actually exist, they are just a way to qualify elements and attributes. If you're interested (this is unrelated to your issue), there is more about XML namespaces here

How to detect and remove unnecessary xmlns:<something> attributes in PHP DOM?

梦想与她 提交于 2019-11-28 02:03:35
问题 Say I have a source document like this: <element> <subelement xmlns:someprefix="mynamespace"/> </element> The xmlns:someprefix is obviously not needed here and doesn't do anything since that prefix is not being used in that element (or in my case, anywhere in the document). In PHP, after I've loaded this into a DOM tree with DOMDocument->loadXML(), I'd like to be able to detect that such a namespace declaration exists, and remove it. I know that I can read it with hasAttribute() and even

javax.faces.view.facelets.FaceletException: Error Parsing /my.xhtml: Error Traced[line: 42] The prefix “f” for element “f:facet” is not bound

岁酱吖の 提交于 2019-11-28 02:02:10
I would like to create table which can display data from database into JSF page. I found this code: <h:dataTable value="#{bookStore.items}" var="store"> <h:column> <f:facet name="header"> <h:outputText value="#{msg.storeNameLabel}"/> </f:facet> <h:outputText value="#{store.name}"/> </h:column> <h:column> <f:facet name="header"> Subject </f:facet> <h:outputText value="#{store.subject}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText value="#{msg.storePriceLabel}"/> </f:facet> <h:outputText value="#{store.price}"/> </h:column> </h:dataTable> When I use this code I get this error

How can I access namespaced XML elements using BeautifulSoup?

被刻印的时光 ゝ 提交于 2019-11-28 01:53:41
I have an XML document which reads like this: <xml> <web:Web> <web:Total>4000</web:Total> <web:Offset>0</web:Offset> </web:Web> </xml> my question is how do I access them using a library like BeautifulSoup in python? xmlDom.web["Web"].Total ? does not work? BeautifulSoup isn't a DOM library per se (it doesn't implement the DOM APIs). To make matters more complicated, you're using namespaces in that xml fragment. To parse that specific piece of XML, you'd use BeautifulSoup as follows: from BeautifulSoup import BeautifulSoup xml = """<xml> <web:Web> <web:Total>4000</web:Total> <web:Offset>0</web

xpath expression from xml with namespace prefix

被刻印的时光 ゝ 提交于 2019-11-28 01:50:09
I could not get the following xpath expression to work when the xml path namespace prefix set. /bk:BookStore/bk:Books/bk:Book[text()='Time Machine'] XML is: <BookStore xmlns:bk="http://www.bookstore.com/book#"> <bk:Books> <bk:Book id="1">Time Machine></bk:Book> </bk:Books> </bk:BookStore> Dimitre Novatchev Without more information about the host language (in which you attempt to evaluate XPath expressions) it is not possible to provide an useful recommendation . Generally, one needs to "register" a namespace with a namespace manager and this also associates a prefix to the registered namespace

Unable to add Attribute with Namespace Prefix using PHP Simplexml

六眼飞鱼酱① 提交于 2019-11-28 01:26:20
问题 Trying to edit an XML document that uses Excels XML-Namespaces: <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"> I need to get to this result (need the ss: prefix befire Type ): <Cell ...><Data ss:Type="String">value</Data></Cell> I've looked over the question Unable add namespace with PHPs SimpleXML but this method is not helping here. In other words, running this as outlined there $data = $cells[$i]->addChild('Data',

unable to scrape content from a website

微笑、不失礼 提交于 2019-11-28 00:14:54
I am trying to scrap some content from a website but the code below is not working(not showing any output). here is the code $url="some url"; $otherHeaders=""; //here i am using some other headers like content-type,userAgent,etc some curl to get the webpage ... .. curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); $content=curl_exec($ch);curl_close($ch); $page=new DOMDocument(); $xpath=new DOMXPath($page); $content=getXHTML($content); //this is a tidy function to convert bad html to xhtml $page->loadHTML($content); // its okay till here when i echo $page->saveHTML the page is displayed $path1="//body

XML Namespace URI with HTTPS?

雨燕双飞 提交于 2019-11-27 23:29:42
Is it better to have a xmlns URI with https protocol? For example this is the recommended way by the manual: <http xmlns="http://www.springframework.org/schema/security"/> Is it legal and better to use this way? <http xmlns="https://www.springframework.org/schema/security"/> Are there XML parsers that try to connect to an address defined by xmlns URI? Parsers always download schemas by xsi:schemaLocation attribute? The URI is the namespace name , which identifies the namespace. While, in case of some URI schemes (like http , https , ftp etc.), it would be possible to provide the schema (or

SimpleXmlElement and XPath, getting empty array()

跟風遠走 提交于 2019-11-27 23:03:58
I am having a little trouble with parsing XML from a google checkout response. The XML is coming straight from the google server so there is no problem with the XML itself. I want to get hold of all the new-order-notification tags I tried this but get an empty array() returned everytime. $xml = new SimpleXmlElement($raw_xml); $notifications = $xml->xpath('notifications'); $notifications = $xml->xpath('/notification-history-response/notifications/new-order-notification'); $notifications = $xml->xpath('//new-order-notification'); An XML snipet (Just the beginning) <notification-history-response