xml-namespaces

xmln:tns and targetNamespace

倖福魔咒の 提交于 2019-12-03 08:32:19
问题 I am seeing some XSD schema documents that declare both a targetNamespace and an xmlns:tns attribute in their top schema element. E.g. the following one taken from here. They also seem to have the same string value. I understand the role of targetNamespace but what does xmlns:tns do on top of that? <?xml version="1.0" encoding="UTF-8"?> <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/Product" xmlns:tns="http://www.example.org/Product"

JAX-WS: why nested elements are in “” namespace?

醉酒当歌 提交于 2019-12-03 07:49:49
Having a toy service as below @WebService(targetNamespace="http://www.example.org/stock") @SOAPBinding(style=Style.RPC,parameterStyle=ParameterStyle.WRAPPED) public class GetStockPrice { @WebMethod(operationName="GetStockPrice",action="urn:GetStockPrice") @WebResult(partName="Price") public Double getPrice( @WebParam(name="StockName") String stock ) { return null; } } JAX-WS-generated client creates a SOAP message where StockName parameter has no namespace: <?xml version='1.0' encoding='UTF-8'?> <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:GetStockPrice xmlns

JAXB appending unneeded namespace declarations to tags

北战南征 提交于 2019-12-03 06:55:34
I'm implementing a homebrew subprotocol of XMPP, and i'm using combination of StAX and JAXB for parsing/marshalling mesages. And when I marshall a message I end up with loads of unneded namespace declarations: <ns2:auth xmlns:ns2="urn:ietf:params:xml:ns:ilf-auth" xmlns:ns4="ilf:iq:experiment:power" xmlns:ns3="ilf:iq:experiment:init" xmlns:ns5="ilf:iq:experiment:values" xmlns:ns6="ilf:iq:experiment:result" xmlns:ns7="ilf:iq:experiment:stop" xmlns:ns8="ilf:iq:experiment:end"> compton@ilf</ns2:auth> instead of: <ns:auth xmlns:ns="urn:ietf:params:xml:ns:ilf-auth>compton@ilf</ns:auth> Is there any

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

做~自己de王妃 提交于 2019-12-03 06:32:38
问题 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? 回答1: 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

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

人盡茶涼 提交于 2019-12-03 05:10:36
问题 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 { //

Getting viewCount from XML [duplicate]

折月煮酒 提交于 2019-12-02 23:37:31
问题 This question already has answers here : Get XML Attribute with SimpleXML (3 answers) Closed 6 years ago . 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 =

Reference to undeclared namespace prefix when parsing MSXML

泪湿孤枕 提交于 2019-12-02 22:55:13
How do I solve the Reference to undeclared namespace prefix: '%s' problem with Microsoft's msxml implementation? I'm using an XML feed from a government web-site that contains values i need to parse. The xml contains namespaces: <?xml version="1.0" encoding="ISO-8859-1"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:cb="http://www.cbwiki.net/wiki/index.php/Specification_1.1" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3c.org/2001/XMLSchema-instance" xsi:schemaLocation=

xmln:tns and targetNamespace

喜你入骨 提交于 2019-12-02 22:18:54
I am seeing some XSD schema documents that declare both a targetNamespace and an xmlns:tns attribute in their top schema element. E.g. the following one taken from here . They also seem to have the same string value. I understand the role of targetNamespace but what does xmlns:tns do on top of that? <?xml version="1.0" encoding="UTF-8"?> <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/Product" xmlns:tns="http://www.example.org/Product" elementFormDefault="qualified"> ... It lets you refer to the namespace later in the schema. For example, if you declare

Strange behavior with xml-namespace

耗尽温柔 提交于 2019-12-02 22:18:41
问题 Why do I get an empty output? When I remove the xmlns part in the xml the output is as expected, but then intellisense doesn't work anymore. warehouse.xml <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="warehouse.xsl"?> <warehouse xmlns="http://schema.mynamespace.net"> <container> <item> <name>book</name> <value>1.23</value> </item> <item> <name>phone</name> <value>45.6</value> </item> </container> </warehouse> warehouse.xsl <xsl:stylesheet xmlns="http://schema

XMLReader - How to handle undeclared namespace

吃可爱长大的小学妹 提交于 2019-12-02 20:45:31
问题 Merged with How to read an XML file with an undefined namespace with XMLReader?. 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