xml-namespaces

Parsing XML in R: Incorrect namespaces

我的梦境 提交于 2019-12-07 02:19:53
问题 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=

Querying XML data types which have xmlns node attributes

旧巷老猫 提交于 2019-12-07 00:51:55
问题 I have the following SQL query: DECLARE @XMLDOC XML SET @XMLDOC = '<Feed><Product><Name>Foo</Name></Product></Feed>' SELECT x.u.value('Name[1]', 'varchar(100)') as Name from @XMLDOC.nodes('/Feed/Product') x(u) This returns: Name ---- Foo However, if my <Feed> node has an xmlns attribute, then this doesn't return any results: DECLARE @XMLDOC XML SET @XMLDOC = '<Feed xmlns="bar"><Product><Name>Foo</Name></Product></Feed>' SELECT x.u.value('Name[1]', 'varchar(100)') as Name from @XMLDOC.nodes('

How do I access an element with xpath with a namespace in powershell?

久未见 提交于 2019-12-06 22:38:30
问题 Powershell: $doc = new-object System.Xml.XmlDocument $doc.Load($filename) $items = Select-Xml -Xml $doc -XPath '//item' $items | foreach { $item = $_ write-host $item.name } I get no output XML: <?xml version="1.0" encoding="UTF-8"?> <submission version="2.0" type="TREE" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:noNamespaceSchemaLocation="TREE.xsd" xmlns="some/kind/of/tree/v1"> <group> <item></item> <item></item> <item></item> </group> <submission> 回答1: You've got a few

Java XPath: Get all the elements that match a query

怎甘沉沦 提交于 2019-12-06 19:31:57
问题 I want to make an XPath query on this XML file (excerpt shown): <?xml version="1.0" encoding="UTF-8"?> <!-- MetaDataAPI generated on: Friday, May 25, 2007 3:26:31 PM CEST --> <Component xmlns="http://xml.sap.com/2002/10/metamodel/webdynpro" xmlns:IDX="urn:sap.com:WebDynpro.Component:2.0" mmRelease="6.30" mmVersion="2.0" mmTimestamp="1180099591892" name="MassimaleContr" package="com.bi.massimalecontr" masterLanguage="it"> ... <Component.UsedModels> <Core.Reference package="com.test.test" name=

Does HTML5 support namespaces?

大城市里の小女人 提交于 2019-12-06 18:29:41
问题 Are we allowed to extend HTML5 with new tags like <foo:bar> in HTML5? I ask because the Facebook API includes just this kind of thing ** , and our pages are defined as HTML5. More specifically, is it possible to make a HTML5-conformant page that uses fb:fbml? 回答1: Strictly speaking, no. You can have JavaScript code write the FBML which gets around any potential validation issues, but it's bad form. That aside, even if you could, you don't want to make a page that uses FBML. FBML will be

XElement is automatically adding xmlns=“” to itself

冷暖自知 提交于 2019-12-06 18:29:39
问题 I am creating a new XDocument from a table. I have to validate the document from an XSD document and it keeps failing because it add the xmlns="" to one of the Elements when it shouldn't. Here's parts of the code that are pertinent. XNamespace xsi = "http://www.w3.org/2001/XMLSchema-instance"; XNamespace xmlns = "https://uidataexchange.org/schemas"; XElement EmployerTPASeparationResponse = null; XElement EmployerTPASeparationResponseCollection = new XElement(xmlns +

XElement adds an xmlns

人走茶凉 提交于 2019-12-06 18:23:12
问题 I'm using Linq to XML to create a new XML file. Some part of the file do I get from an existing XML file. I use the following code for this. var v2 = new XDocument( new XDeclaration("1.0", "utf-16", ""), new XComment(string.Format("Converted from version 1. Date: {0}", DateTime.Now)), new XElement(ns + "keyem", new XAttribute(XNamespace.Xmlns + "xsd", xsd.NamespaceName), new XAttribute(XNamespace.Xmlns + "xsi", xsi.NamespaceName), new XAttribute(xsi + "schemaLocation", schemaLocation

How to ingore namespace prefixes on VTD Xpath lookup

泄露秘密 提交于 2019-12-06 15:59:37
I'm building a VTD based XML Parsing engine in order to process files from several input systems. I'm currently trying to get values from tags with namespace prefix: <?xml version="1.0" encoding="UTF-8"?> <cli:clients xmlns declarations > <cli:client> <dat:name>CLIENT NAME</dat:name> <dat:age>1</dat:age> </cli:client> and querying the following Xpaths: //client/age/text() //client/name/text() How can I set VTD AutoPilot to ignore the namespace prefix? NOTE : I cannot change the xpaths as I already have this engine in production implemented with JDK's default xpath engine. UPDATE : See below

Intellisense not working when trying to define an xmlns in VS2012

二次信任 提交于 2019-12-06 15:33:05
I am trying to add a namespace to one of my usercontrols in xaml. In visual studio 2010 I could just type xmlns:blahblah= and it would add the quotations and offer me a whole list of suggestions of assemblies to add as namespace definitions. In visual studio 2012 I start typing it out and I'm immediately getting xaml errors as I'm typing and no suggestions. The problem is, I don't know what the exact ones I need to add, so I'm a little dependent on the intellisense. Regular intellisense works just fine. Why is this? The problem seems to have been the fact that I was using .NET 4.0 Client

Android XML DOM Parsing when you have namespaces?

[亡魂溺海] 提交于 2019-12-06 14:36:24
问题 When you have xml nodes with namespaces like: <ns:abc> then getElementsByTagName("abc"); fails, but getElementsByTagName("ns:abc"); works. But the issue is I don't know what is the namespace prefix chosen. Also for me, getElementsByTagNameNS("*", "abc"); and getElementsByTagNameNS("http://abcnamespace.com", "abc"); both return null. If device is of interest, I am using CM7 on Nook. I don't want to use SAX, any other clean way to read the node lists. 回答1: DocumentBuilderFactory