xml-namespaces

Processing RSS Feeds with Namespaces in Android

浪子不回头ぞ 提交于 2019-12-22 12:54:33
问题 I'm trying to write an XML parser that takes an RSS feed & fetches the image urls shown in the url attribute of the <media:thumbnail> tag. This is all being done via android.Util.Xml , & is an adaptation of the code shown here. An example RSS feed that I'm trying to use is the BBC News RSS feed. However, media is an additional namespace & (probably) as a result my parser isn't working as it should. A version of my parse method is below. Is there any (no doubt simple) way to get my list of

Difference between using an XML namespace prefix and specifying an xmlns=“blah” as an attribute

核能气质少年 提交于 2019-12-22 11:22:42
问题 What (if any) is the difference between the below xml snippets, with regards to namespace? Form1 <prf:XmlElement1 xmlns:prf="namespacename"> ...snip... </prf:XmlElement1> Form2 <XmlElement1 xmlns="namespacename"> ...snip... </XmlElement1> I'm interacting with a web service that chokes on an element when its namespace is described as in Form2, but works fine if the namespace is described as in Form1. Unfortunately, I haven't been able to convince my web service framework to emit the element

JAXB bindings file: namespace-aware node selection

ε祈祈猫儿з 提交于 2019-12-22 10:27:07
问题 I tend to use external JAXB bindings files for my Schema-to-Java compilation. This works just fine, but I did notice one thing that I've started wondering about. It's not really JAXB-specific, more like an XPath question, but the context helps. Suppose we have this schema: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:test="www.acme.com" targetNamespace="www.acme.com" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs

XML and Python: Get the namespaces declared in root element

妖精的绣舞 提交于 2019-12-22 09:59:44
问题 How do I access the multiple xmlns declarations at the root element of an XML tree? For example: import xml.etree.cElementTree as ET data = """<root xmlns:one="http://www.first.uri/here/" xmlns:two="http://www.second.uri/here/"> ...all other child elements here... </root>""" tree = ET.fromstring(data) # I don't know what to do here afterwards I want to get a dictionary similar to this one, or at least some format to make it easier to get the URI and the matching tag {'one':"http://www.first

XPath JMeter Assertion : Error “prefix must resolve to a namespace”

[亡魂溺海] 提交于 2019-12-22 08:38:33
问题 I am trying to use JMeter XPath Assertion on a tag value as below with XPath assertion command: //m:CurrencyNameResul/text() = Pounds Webservice Response: <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <m:CurrencyNameResponse xmlns:m="http://www.oorsprong.org/websamples.countryinfo"> <m:CurrencyNameResult>Pounds</m:CurrencyNameResult> </m:CurrencyNameResponse> </soap:Body> </soap:Envelope> I am getting error prefix

Add an attribute to the <HTML> element in asp.net?

痴心易碎 提交于 2019-12-22 08:18:03
问题 I would like to add two additional xml namespaces to the <HTML> element in asp.net: take: <html xmlns="http://www.w3.org/1999/xhtml" > to make (adding facebook open graph namespaces): <html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml"> How would I access the <HTML> element in code behind and add a namespace? 回答1: You can do it just like any other element. In your aspx just mark the html tag to be runat server: <html xmlns="http

Remove a specific xmlns from root element of xml

南楼画角 提交于 2019-12-22 07:21:53
问题 I'm trying to make a transformation for an XML document but i cannot find a solution since i do not know XSLT. I have the XML document: <?xml version="1.0" encoding="UTF-8"?> <addresses xmlns="http://www.test.org/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation='http://whatever/test.xsd'> <address> <name>Joe Tester</name> <street>Baker street 5</street> </address> </addresses> and i want to produce: <?xml version="1.0" encoding="UTF-8"?> <addresses

Remove a specific xmlns from root element of xml

こ雲淡風輕ζ 提交于 2019-12-22 07:21:23
问题 I'm trying to make a transformation for an XML document but i cannot find a solution since i do not know XSLT. I have the XML document: <?xml version="1.0" encoding="UTF-8"?> <addresses xmlns="http://www.test.org/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation='http://whatever/test.xsd'> <address> <name>Joe Tester</name> <street>Baker street 5</street> </address> </addresses> and i want to produce: <?xml version="1.0" encoding="UTF-8"?> <addresses

XAML XMLNS:Local C#

爱⌒轻易说出口 提交于 2019-12-22 05:28:29
问题 I am working through an MVVM tutorial, and I have the following code, written in Xaml: <Window x:Class="WPFMVVM.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WPFMVVM; assembly=WPFMVVM" Title="MainWindow" Height="388" Width="545"> The xmlns:local line is complaining saying that WPFMVVM assembly is not referenced. Although it is the assembly that I am working in. Anybody know why?

keep user-generated content from breaking layout?

試著忘記壹切 提交于 2019-12-22 05:19:17
问题 I have a site that wraps some user-generated content, and I want to be able to separate the markup for the layout, and the markup from the user-generated content, so the u-g content can't break the site layout. The user-generated content is trusted, as it is coming from a known group of users on my network, but nonetheless only a small subset of html tags are allowed (p, ul/ol/li, em, strong, and a couple more). However, the user-generated content is not guaranteed to be well-formed, and we