How to use XPATH in MySQL select?
Say I have a table called "xml" that stores XML files in a single column "data". How would I write a MySQL query that run an XPath and return only rows matching that XPath? ...
Say I have a table called "xml" that stores XML files in a single column "data". How would I write a MySQL query that run an XPath and return only rows matching that XPath? ...
Greetings! I have an XML value that I'd like to use as a boolean value to toggle the visibility of a Panel. I have something like this: <asp:FormView id="MyFormView" runat="server" DataSourceID="MyXmlDataSource"> <ItemTemplate> <!-- some stuff --> <asp:Panel id="MyPanel" runat="server" Visible='<%# (bool)XPath("Men...
A strange thing happened after a supplier changed the XML header a bit. I used to be able to read stuff using xpath, but now I can't even get a reply with $xml->xpath('/'); They changed it from this... <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE NewsML SYSTEM "http://www.newsml.org/dl.php?fn=NewsML/1.2/specification/NewsML_...
<xsl:template match="foo"> matches the foo element in the null namespace. <xsl:template match="*"> matches any element in any namespace. I tried: xmlns:null="" ... <xsl:template match="null:*"> but it's illegal to declare a prefix for the null namespace. So how can I match an element with any name in the null namespace? ...
I'm using XPath to locate a node (or something close to it) in a template that has non-well-formed HTML about 10 levels deep. (No I didn't write this HTML...but I've been tasked to dig through it.) I seem to be able to retrieve an XPath to the element in question using the XPartner add-on for Firefox; however it only gives me the loc...
I want to select nodes for which a specific attribute does not exist. I've tried the Not() function, but it doesn't work. Is there a way for this? Example: The following Xpath query: group/msg[not(@owner)] Should retrieve the first node but not the 2nd one. However, both SketchPath (tool to test Xpath queries) and my C# code consider...
I'm using VB.net (2003), and calling the SelectNodes method on an xml document. If I have a document: <InqRs> <DetRs> <RefInfo> <RefType>StopNum</RefType> <RefId>0</RefId> </RefInfo> <RefInfo> <RefType>Id</RefType> <RefId>0</RefId> </RefInfo> </DetRs> <DetRs> <RefInfo> <RefType>Sto...
Hi, I'm trying to write some code to find a specific XmlNode object based on the URL in the XML sitemap but can't get it to find anything. The sitemap is the standard ASP.net sitemap and contains: <siteMapNode url="~/lev/index.aspx" title="Live-Eye-Views"> --- Child Items --- </siteMapNode> The code I'm using to search for the eleme...
Hi all, I'm interested in assigning the tag name of the root element in an xml document to an xslt variable. For instance, if the document looked like (minus the DTD): <foo xmlns="http://....."> <bar>1</bar> </foo> and I wanted to assign the string 'foo' to an xslt variable. Is there a way to reference that? Thanks, Matt ...
I have been tasked with finding an open source DOM XML parser. The parser must minimally support XPath 1.0. Schema support is desired, but not a deal breaker The files we are parsing will be small so speed and memory consumption are not a large concern. Any OO language (C++, C#, Java, etc.). To clarify, the plan is to integrate ...
I've been looking for a component that would allow me to pass an arbitrary C# object to an XSL transform. The naive way of doing this is to serialise the object graph using an XmlSerializer; however, if you have a large object graph, this could cause problems as far as performance is concerned. Issues such as circular references, lazy l...
I'm calling a WebService exposed by Oracle that accepts an input of an ItemID and returns to me the corresponding Item Number. I want to grab the Item Number that has been returned out of the XML contained in the response. The XML looks like this: <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http:/...
Hi! I'm parsing big XML file with XPathExpression selection for some nodes existing at various depth levels. What is the easiest way to export selected nodes to separate XML file, preserving all direct-ancestors nodes (and their attributes)? C# is preferred. Example source XML : <a> <x> <b> <c/> <z/> </b> <c/> </a> <c/...
I am looking for a C# example implementation of a class derived from Microsoft's XPathNavigator class. Can any one point me at such an article? As you may (or may not) know, the XmlNavigator is designed to allow one to superimpose XPath navigation on most any data model. I have implemented my derived XPathNavigator class and it work...
Hi there, I need to locate the node within an xml file by its value using XPath. The problem araises when the node to find contains value with whitespaces inside. F.e.: value value with spaces I can not construct the XPath locating the second Child node. Simple XPath /Root/Child perfectly works for both children, but /Root[Chil...
Given the following xml fragment: <Problems> <Problem> <File>file1</File> <Description>desc1</Description> </Problem> <Problem> <File>file1</File> <Description>desc2</Description> </Problem> <Problem> <File>file2</File> <Description>desc1</Description> </Problem> </Problems> I need to produce someth...
I'm trying to capture the id of an element that will be randomly generated. I can successfully capture the value of my element id like this... | storeAttribute | //div[1]@id | variableName | Now my variable will be something like... divElement-12345 I want to remove 'divElement-' so that the variable I am left with is '12345' so th...
My current program need to use programatically create a XPathExpression instance to apply to XmlDocument. The xpath needs to use some XPath functions like "ends-with". However, I cannot find a way to use "ends-with" in XPath. I It throw exception like below Unhandled Exception: System.Xml.XPath.XPathException: Namespace Manager ...
Something like ".//div[@id='foo\d+]" to capture div tags with id='foo123'. I'm using .NET, if that matters. ...
I need to do some processing on fairly large XML files ( large here being potentially upwards of a gigabyte ) in C# including performing some complex xpath queries. The problem I have is that the standard way I would normally do this through the System.XML libraries likes to load the whole file into memory before it does anything with it...