Background: Having given up on the practical daily use of XSLT as a part of my programming toolkit, I was wondering if there were any implementations in other languages of the (only) two things I miss about that tool:
the ability to traverse data structures using "path" style statments via xpath
the ability to traverse template transfo...
I suspect I am missing something basic but vital but because of it my XPath navigator is always returning the root.
I have some XML data like so:
<?xml version="1.0" encoding="utf-8" ?>
<language>
<header>
<about>about</about>
<faqs>faqs</faqs>
<feedback>feedback</feedback>
<submitblog>submit a blog</submitblog>
<...
Hey everybody,
I have a question about xpath and arrays. What I was wondering was if it is possible to use xpath on some simpleXML and have it return an associative array of node names and their values. For example, say I have the following XML:
<element1 page="1">blah</element1>
<element2 page="1">blah blah</element2>
<element3 page=...
I have an XHTML document being passed to a PHP app via Greasemonkey AJAX. The PHP app uses UTF8. If I output the POST content straight back to a textarea in the AJAX receiving div, everything is still properly encoded in UTF8.
When I try to parse using XPath
$dom = new DOMDocument();
$dom->loadHTML($raw2);
$xpath = new DOMXPath($dom);
...
I'd like to get some rows (z:row rows) from XML using:
<rs:data>
<z:row Attribute1="1" Attribute2="1" />
<z:row Attribute1="2" Attribute2="2" />
<z:row Attribute1="3" Attribute2="3" />
<z:row Attribute1="4" Attribute2="4" />
<z:row Attribute1="5" Attribute2="5" />
<z:row Attribute1="6" Attribute2="6" />
</rs:data...
I have the following xml file
<DriveLayout>
<Drive driveVolume="/u" Group="sa" Owner="sa" totalSpace="4" />
<Drive driveVolume="/u" Group="sa" Owner="sa" totalSpace="16" />
<Drive driveVolume="/u" Group="sa" Owner="sa" totalSpace="510" />
<Drive driveVolume="/u" Group="sa" Owner="sa" />
<Drive driveVolume="/u" Group="sa" Owner="sa" tota...
A sample of some oddness:
#!/usr/bin/ruby
require 'rubygems'
require 'open-uri'
require 'nokogiri'
print "without read: ", Nokogiri(open('http://weblog.rubyonrails.org/')).class, "\n"
print "with read: ", Nokogiri(open('http://weblog.rubyonrails.org/').read).class, "\n"
Running this returns:
without read: Nokogiri::XML::Document...
I have to write a generic template for finding an operation name and the namespace for that from a soap response. Generic i mean, that is applicable to any operation. So I don't know the operation name and the name space name but want to get them and modify back when I am sending the response.
Here is the structure of the response:
Typ...
Hi,
I'm trying to retrieve data that's put outside element blocks.
Sample;
<td>
<b>abc</b> 123 <b>def</b> 456 <b>ghi</b>
</td>
So from this sample I would like to get the 123 and 456.
On this site I found some samples with a not() and that seems to work a bit in the right direction but then 123 & 456 are removed because he only sh...
I'm having trouble writing an XPath expression to select nodes that contain certain elements, while excluding siblings of this element that I'm not interested in. I suspect this can't be done with XPath alone and that I will need to use XSLT.
Using this source document
<items>
<item id="foo1">
<attr1>val1</attr1>
<attr...
Hi,
I need to generate some kind of a nested Xpath on runtime.
Do you know of any Java lib or helper, which can assist with the creation of a complex Xpath expression ?
It need it to support nesting, AND, OR and simple operators like equal and contains.
Here is an example of an expression I need to build at runtime (The number of 'Poli...
I have the following XML from a .NET web service:
<?xml version="1.0" encoding="utf-8"?>
<DataSet>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice max...
Head hurts on this one so can someone throw me a line?
XML is like so (not the real stuff but this is an example for clarity):
<root>
<groups name="A">
<entry from="1" to="10" />
</groups>
<groups name="A">
<entry from="11" to="20" />
<entry from="21" to="30" />
</groups>
<groups name="A">
<entry...
Hello everyone,
I have the following XML file and I want to print out the baseAddress value, then change the value and write update to the same XML file.
My problem is I am using the following scripts in PowerShell to manipulate, and seems the related value could not be retrieved. I think the reason may be there is a sign '.' in the el...
Hello everyone,
Suppose I have the following XML file, and I want to use PowerShell (version 1.0) to manipulate the XML file to get the value for Foo (in this sample, value I want to get is "Foo Value") and Goo (in this sample, value I want to get is "Goo Value"), any ideas how to implement?
$FooConfig = [xml](get-content .\Foo.exe.con...
So we have an XML file with a very simple implementation of XLink:
<root xmlns:xlink="http://www.w3.org/1999/xlink">
<firstChild id="ID1" />
...
<ref xlink:href="#ID1" />
</root>
Let's assume the XLink implementation won't get any more complicated than that. However the important point is that the element referred to (in this...
I have been reading on the different question talking about selecting unique nodes in a document (using the Muenchian method) but in my case I cannot use keys (or I do not know how) because I am working on a node set and not on the document.
And keys cannot be set on a node-set. Basically I have a variable:
<xsl:variable name="limitedS...
I'm trying to get the list of EntityTypes in an EDMX file, and the following query returns no results:
XmlDocument edmxFile = new XmlDocument();
edmxFile.Load(args[0]);
XmlNamespaceManager nsMan = new XmlNamespaceManager(edmxFile.NameTable);
nsMan.AddNamespace("edmx", "http://schemas.microsoft.com/ado/2007/06/edmx");
nsMan.AddNamespace...
<ClinicalDocument>
<entry>
<substaceAdministration>
<effectiveTime></effectiveTime>
</substaceAdministration>
</entry>
<entry>
<substaceAdministration>
<effectiveTime></effectiveTime>
</substaceAdministration>
</entry>
<entry>
<substaceAdministration>
</substaceAdministration>
</e...
Right now I successfully grabbed the full element from an HTML page with this:
//img[@class='photo-large']
for example it would return this:
<img src="http://example.com/img.jpg" class='photo-large' />
But I only need the SRC url (http://example.com/img.jpg). Any help?
...