xml-namespaces

DOM XPath query doesn't work when a xmlns is given

妖精的绣舞 提交于 2019-12-05 18:23:00
In Firefox JavaScript console: parser = new DOMParser(); foo = parser.parseFromString('<foo></foo>', "text/xml"); res = foo.evaluate("/foo", foo, null, 0, null); res.iterateNext(); > [object Element] foo = parser.parseFromString('<foo xmlns="http://foo.bar.baz/quux"></foo>', "text/xml"); res = foo.evaluate("/foo", foo, null, 0, null); res.iterateNext(); > null res = foo.evaluate("*[1]", foo, null, 0, null); res.iterateNext(); > [object Element] If an XML document doesn't contain an xmlns, it gets parsed and queried correctly. If it does, we are not able to query by tag and attribute names

Tags from http://xmlns.jcp.org namespace do not render, while http://java.sun.com/jsf work fine

妖精的绣舞 提交于 2019-12-05 18:16:15
I have this: <html xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:h="http://java.sun.com/jsf/html" > <h:selectOneRadio> <f:selectItem value="1" itemValue="1" itemLabel="123"/> <f:selectItem value="2" itemValue="2" itemLabel="321"/> </h:selectOneRadio> And I get this: <f:selectItem value="1" itemValue="1" itemLabel="123"></f:selectItem> <f:selectItem value="2" itemValue="2" itemLabel="321"></f:selectItem> <select name="j_idt5" size="1"></select> Why are xmlns:f="http://xmlns.jcp.org/jsf/core" tags not rendered? I'm using JBoss AS 7 on Netbeans 7.3. BalusC The new XML namespace domain http:/

Remove a specific xmlns from root element of xml

筅森魡賤 提交于 2019-12-05 13:11:03
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 xmlns="http://www.test.org/xml"> <address> <name>Joe Tester</name> <street>Baker street 5</street> <

How do I add a namespace attribute to an element in JAXB when marshalling?

流过昼夜 提交于 2019-12-05 12:13:00
I'm working with eBay's LMS (Large Merchant Services) and kept running into the error: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. After a lot of trial and error I traced the problem down. It turns out this works: <?xml version="1.0" encoding="UTF-8"?> <BulkDataExchangeRequests xmlns="urn:ebay:apis:eBLBaseComponents"> <Header> <Version>583</Version> <SiteID>0</SiteID> </Header> <AddFixedPriceItemRequest xmlns="urn:ebay:apis:eBLBaseComponents"> While this (what I've been sending) doesn't: <?xml

Automatically created C# classes for xml deserialization don't work

↘锁芯ラ 提交于 2019-12-05 12:08:25
问题 I am struggling to create deserialization classes for this xml: <?xml version="1.0" encoding="ISO-8859-1"?> <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:stn="urn:response"> <SOAP-ENV:Body> <Response> <Records xsi:type="SOAP-ENC:Array

keep user-generated content from breaking layout?

感情迁移 提交于 2019-12-05 07:47:36
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 have had some instances of malformed user-generated content breaking the layout of the site. We are

cross-browser 'getElementsByTagName' with namespace from responseXML

独自空忆成欢 提交于 2019-12-05 07:00:46
Am trying to read an XML response using getElementsByTagName : var rows = items.responseXML.getElementsByTagName("z:row"); for (var i=0; i<rows.length; i++) { //do something } Above code works fine in Firefox and IE but in chrome it throws null.. i mean it does not get any data.. when i alert the rows.length it gives me 0 always in chrome. Then i searched in google and understood the issue is with xsd:element , then i changed "z:row" to only "row" . Then it worked in Chrome but Firefox and IE returned 0 for rows.length . Is there any method which across all browsers? This is what I use:

XAML XMLNS:Local C#

社会主义新天地 提交于 2019-12-05 06:05:21
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? Thanks You must not have spaces in there & if it's the assembly you work in just do not specify assembly

Declaring an attribute for a different namespace in XML Schema

不问归期 提交于 2019-12-05 05:18:20
I've been using an XML format that is a mix of different existing formats and some custom elements and attributes, and I thought I should write a schema for those custom bits. One thing I do is use custom attributes on elements in existing formats, like this: <ns1:something attA="b" attB="a" ns2:extraAtt="c"/> I understand that doing this is allowed but I cannot think how to declare my "extraAtt" in XML Schema or, worse, in a DTD. I have tried reading the specification , but it could just as well be written in Chinese as far as I am concerned. Most tutorials talk only about "name", "type", and

Parsing XML in R: Incorrect namespaces

天涯浪子 提交于 2019-12-05 05:12:58
I have a bunch of XML files and an R script that reads their content into a data frame. However, I got now files which I wanted to parse as usual, but there is something in their namespace definition that doesn't allow me to pick their values normally with XPath expressions. XML files are like this: xml_nons.xml <?xml version="1.0" encoding="UTF-8"?> <XML> <Node> <Name>Name 1</Name> <Title>Title 1</Title> <Date>2015</Date> </Node> </XML> And the other: xml_ns.xml <?xml version="1.0" encoding="UTF-8"?> <XML xmlns="http://www.nonexistingsite.com"> <Node> <Name>Name 2</Name> <Title>Title 2</Title