xml-namespaces

HTML: What is `xmlns:fb=“http://www.facebook.com/2008/fbml”`?

泄露秘密 提交于 2019-12-02 20:11:39
What is xmlns:fb="http://www.facebook.com/2008/fbml" ? I've been seeing it in a lot of <html> tags recently. What does it do? Matthew Scharley While I haven't seen it in use, this is standard XML notation for extending the current XML namespace (in this case XHTML) with another one (in this case FBML). This tells your browser where to find the specification for FBML which in turn tells it how to handle the <fb:*> tags. Technically speaking, the value of the xmlns:* attribute is simply a unique identifier, but often it is a URL which points to a definition in one form or another. In this

What causes a difference between a web service URL and a namespace?

大憨熊 提交于 2019-12-02 19:33:26
I have an ASP.NET web project that contains a Web Service. When I run the service it brings me to a page showing all the methods that are exposed, using a URL similar to http://api.example.com/game/service.asmx . In the code for the Web Service there are methods that have the following attributes: [WebService(Namespace = "http://webservices.example.com/GameServices/Game1")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class Game1 : System.Web.Services.WebService { // code } I am a little confused over why the namespace on a class with the webService attribute is

Resolve namespaces with SimpleXML regardless of structure or namespace

浪子不回头ぞ 提交于 2019-12-02 19:22:28
问题 I got a Google Shopping feed like this (extract): <?xml version="1.0" encoding="utf-8" ?> <rss version="2.0" xmlns:g="http://base.google.com/ns/1.0"> ... <g:id><![CDATA[Blah]]></g:id> <title><![CDATA[Blah]]></title> <description><![CDATA[Blah]]></description> <g:product_type><![CDATA[Blah]]></g:product_type> Now, SimpleXML can read the "title" and "description" tags but it can't read the tags with "g:" prefix. There are solutions on stackoverflow for this specific case, using the "children"

php script cant read xml data with colon (:)

Deadly 提交于 2019-12-02 18:58:06
问题 I tried to read youtube xml data width php but stuck because youtube uses colon (:)in his API To be precise, here is script I use: $video = array('/some arrays here,separated width commas/');// array of youtube videos $v = preg_replace("/[^A-Za-z0-9\-\_]/","",$_GET["v"]); // make sure "v" parameter is sanitized if(!empty($v) && in_array($v,$video)){ //check if parameter "v" is empty and is yours video echo('<object width="853" height="505"><param name="movie" value="http://www.youtube.com/v/'

XPath for element with namespace

三世轮回 提交于 2019-12-02 17:26:37
问题 What is the XPATH for attribute newVersion in the element <dependentAssembly> <assemblyIdentity name="System.Reactive.Linq" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-2.2.5.0" newVersion="2.2.5.0" /> </dependentAssembly> I have tried my best to do it by myself. But don't know how to get XPATH for elements with namespace. Its very confusing. Somebody please provide me a XPATH. XPATH which I came up with is /configuration/runtime/assemblyBinding

.Net Add namespace to XML document as default and with a prefix

假装没事ソ 提交于 2019-12-02 14:58:13
问题 When using XMLSerializer to create an XML string of a serialization of a class oXML in vb.net as follows: Dim x As New Xml.Serialization.XmlSerializer(oXML.GetType, "urn:oecd:blah:blah") Dim xmlns = New XmlSerializerNamespaces() xmlns.Add(String.Empty, "urn:oecd:blah:blah") xmlns.Add("xsi", "http://www.w3.org/2001/XMLSchema-instance") xmlns.Add("sfa", "urn:oecd:blah:blah1") xmlns.Add("iso", "urn:oecd:blah:blah2") xmlns.Add("ftc", "urn:oecd:blah:blah") Dim sw As New IO.StringWriter() x

Oracle XSLT: default namespace results in empty tags

一曲冷凌霜 提交于 2019-12-02 13:48:17
问题 I think the best way to ask this question is: How do I specify a default namespace for the root element in the output? Doing this: <xsl:template match="/"> <r xmlns:s"http://www.mycompany.com/s/schema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.mycompany.com/default/schema" > .... .... Gives me an error in Oracle: ORA-31011: XML Parsing Failed ORA-19201: Error occurred in in XML Processing LPX-00604: Invalid attribute 'nIfNotExist', for attribute 'name' ORA-06512:

Getting viewCount from XML [duplicate]

拈花ヽ惹草 提交于 2019-12-02 13:27:50
This question already has an answer here: Get XML Attribute with SimpleXML 3 answers I'm currently using the YouTube API form Google and I'm trying to get the "viewCount" array. I've tried this already with no luck at all. Here is the link that I'm currently using. I tried this before with no luck at all. $url = 'http://gdata.youtube.com/feeds/api/users/gudjondaniel/uploads?max-results=1'; $source = file_get_contents($url); $xml = new SimpleXMLElement($source); $title = $xml->entry->viewCount; Any help is greatly appreciated. For other people: the OP wants to access the <yt:statistics

XMLReader - How to handle undeclared namespace

☆樱花仙子☆ 提交于 2019-12-02 12:49:22
I'm reading a large ~300Mb gzipped XML file with XMLReader that get's automatically dumped to my server nightly (archaic, I know..) It is malformed ie, it has an undefined namespace and it's throwing an error ErrorException [ Warning ]: XMLReader::read() namespace error : Namespace prefix xsi for AttrName on NodeName is not defined What is the best way to deal with this? It seems impractical to uncompress, load the whole thing into memory, replace a string, write it again -- gzipped. The file is huge. The whole reason I'm using XMLReader is to prevent loading the whole file into memory during

XPath for element with namespace

主宰稳场 提交于 2019-12-02 10:48:54
What is the XPATH for attribute newVersion in the element <dependentAssembly> <assemblyIdentity name="System.Reactive.Linq" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-2.2.5.0" newVersion="2.2.5.0" /> </dependentAssembly> I have tried my best to do it by myself. But don't know how to get XPATH for elements with namespace. Its very confusing. Somebody please provide me a XPATH. XPATH which I came up with is /configuration/runtime/assemblyBinding/dependentAssembly[2]/bindingRedirect[@newVersion='2.2.5.0']/@newVersion <?xml version="1.0" encoding=