xml-namespaces

Why backgroundTint requires android: prefix after API 21 but not before?

倖福魔咒の 提交于 2021-02-08 14:59:25
问题 Declaring a style, when I define an item android:backgroundTint , I get a warning that this is available as of API 21 onward, while my minimum API specified is lower (API 17). On the other hand, when I replace that with simply backgroundTint , the warning is gone. Does anyone know why is that? <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name=

Why backgroundTint requires android: prefix after API 21 but not before?

孤街醉人 提交于 2021-02-08 14:59:01
问题 Declaring a style, when I define an item android:backgroundTint , I get a warning that this is available as of API 21 onward, while my minimum API specified is lower (API 17). On the other hand, when I replace that with simply backgroundTint , the warning is gone. Does anyone know why is that? <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name=

XML attribute names and elements in default namespace?

*爱你&永不变心* 提交于 2021-02-08 05:23:26
问题 How should the following in XML namespace specification be interpreted? A default namespace declaration applies to all unprefixed element names within its scope. Default namespace declarations do not apply directly to attribute names; the interpretation of unprefixed attributes is determined by the element on which they appear. My intuitive understanding is that unprefixed attributes should be interpreted as belonging to the namespace of the element they belong to. However, the following

How to preserve namespace information when parsing HTML with lxml?

此生再无相见时 提交于 2021-02-07 12:18:55
问题 >>> from lxml.etree import HTML, tostring >>> tostring(HTML('<fb:like>')) '<html><body><like/></body></html>' Note how the tag turns from <fb:like> to simply <like> . This makes processing pages that incorporate XFBML with lxml much harder. (Same thing happens to <g:plusone></g:plusone> ) Any help is appreciated. 回答1: Try adding the namespace prefix definitions that are missing. lxml will avoid the namespaces otherwise, supposedly to make it easier for you. Most likely the sites you try to

How to preserve namespace information when parsing HTML with lxml?

牧云@^-^@ 提交于 2021-02-07 12:18:00
问题 >>> from lxml.etree import HTML, tostring >>> tostring(HTML('<fb:like>')) '<html><body><like/></body></html>' Note how the tag turns from <fb:like> to simply <like> . This makes processing pages that incorporate XFBML with lxml much harder. (Same thing happens to <g:plusone></g:plusone> ) Any help is appreciated. 回答1: Try adding the namespace prefix definitions that are missing. lxml will avoid the namespaces otherwise, supposedly to make it easier for you. Most likely the sites you try to

Find elements in a Node without the proper namespace, in Java

≡放荡痞女 提交于 2021-02-04 16:50:27
问题 So I have a xml doc that I've declared here: DocumentBuilder dBuilder = dbFactory_.newDocumentBuilder(); StringReader reader = new StringReader(s); InputSource inputSource = new InputSource(reader); doc_ = dBuilder.parse(inputSource); Then I have a function where I pass in a string and I want to match that to an element in my xml: void foo(String str) { NodeList nodelist = doc_.getDocumentElement().getElementsByTagName(str); } The problem is when the str comes in it doesn't have any sort of

Does having a different name for the XML namespace prefix matter?

北慕城南 提交于 2021-02-04 07:17:25
问题 Long story short, I'm changing the web-server container for an application. The old container would send back SOAP responses as follows: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> ... other elements ... </SOAP-ENV:Body> </SOAP-ENV:Envelope> In the new server, I'm able to send back the following responses: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> ... other elements ... </soap:Body> </soap:Envelope> As

Does having a different name for the XML namespace prefix matter?

蹲街弑〆低调 提交于 2021-02-04 07:17:16
问题 Long story short, I'm changing the web-server container for an application. The old container would send back SOAP responses as follows: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> ... other elements ... </SOAP-ENV:Body> </SOAP-ENV:Envelope> In the new server, I'm able to send back the following responses: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> ... other elements ... </soap:Body> </soap:Envelope> As

Which XPath expression should I use for XmlDocument.SelectSingleNode when the document has no namespace?

社会主义新天地 提交于 2021-01-29 18:12:11
问题 I have some XML that has been generated by default conversion of a JSON response stream, and so doesn't have a namespace declared. I now want to retrieve a specific node from that XML by using the SelectSingleNode method, but cannot specify the namespace because there isn't one specified. What should I use to register a namespace? My XML looks like this: <root type="object"> <customer type="object"> <firstName type="string">Kirsten</firstName> <lastName type="string">Stormhammer</lastName> <

In Powershell how do I get Select-Xml to search multiple Nodes

非 Y 不嫁゛ 提交于 2021-01-28 07:47:58
问题 So I got to say that I m new to using PowerShell for parsing out XML. With that said, how to do I combine multiple -XPath So that I can finishing building out my expression report. Please let me know, I have tried several combinations and none of them seem to work with namespace XML. <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" niaVersion="12.0.0.756" xmlns="http://something.com/something