I have an xml file
<?xml version="1.0"?>
<category>
<name>SWEATERS</name>
<name>WATCHES</name>
<name>PANTS</name>
<name>test</name>
<name>1</name>
</category>
How i can remove the node <name>test</name> using xpath ,xquery and php. I used this code
$name='test;
$xmlfile="config/shop_categories.xml";
$xml = simple...
I'm trying to fetch the content of a div in a html page using xpath and domdocument. This is the structure of the page:
<div id="content">
<div class="div1"></div>
<span class="span1></span>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<div class="div2"></div>
</div>
I want to get only the content of p, not spans and divs. I came thru this...
Hi,
We have in input an XML like following:
<R>
<MT N="folder" V="Folder1\Subfolder1" />
<MT N="folder" V="Folder2xx\Subfolder1" />
<MT N="folder" V="Folder3yyyy\Subfolder1" />
<MT N="folder" V="Folder4zzzz\Subfolder1" />
</R>
In our XSLT that performs the display, the entry:
<xsl:value-of select="MT[@N='folder']/@V"/>
...
Let's say I have the following XML :
<links>
<item>
<title>Title 1</title>
<url>http://www.example.com/url-1</url>
</item>
<item>
<title>Title 2</title>
<url>http://www.example.com/url-2</url>
</item>
<item>
<title>Title 3</title>
<url>http://www.example.com/url-3</url>
</item>
</l...
I want to manipulate xml doc having default namespace but no prefix. Is there a way to use xpath without namespace uri just as if there is no namespace?
I believe it should be possible if we set namespaceAware property of documentBuilderFactory to false. But in my case it is not working.
Is my understanding is incorrect or I am doing som...
hi all!
i'm trying to parse an html page with XPathDocument, but gives error 'cause the html is not an xml...
is there a way to do this or not?
...
I'm using libxml2 in my c project.
I was wondering how could I grab all tables in a html file using xpath.
Sample code will do the trick.
I need to parse the data in html table.
Thanks
EDIT:
This is a row of the table:
<tr class="report-data-row-even">
<td class="NormalTxt report-data-cell report-data-column-even"><nobr>0.0285</nob...
Let's say I need to extract all solid-brushes and linear-gradient brushes in a dictionary resource file using C#. How can I do it? Please help!
This question can be extended to be more general like "How to find the multiple-lines match(es) when searching a file using C#?"
...
I have html content that I am storing as an XML document (using HTML Agility Pack). I know some XPath, but I am not able to zero into the exact content I need.
In my example below, I am trying to extract the "src" and "alt" text from the large image. This is my example:
<html>
<body>
....
<div id="large_image_display">
<img...
I have an loaded some XML in an XMLDocument object. I am iterating through the document by using an
For Each node As XmlNode In doc.GetElementsByTagName("Item", [NAMESPACE])
'Do Stuff
Next
I would like to use xpath within this loop to pull out all nodes with the name of "MyNode"
I would have thought i would simply have to do node....
I'm trying to pull the text between the nobr tags.
This is part of the table:
<table class="report-main-table dirLTR NormalTxt" width="100%" border="0" cellspacing="0" cellpadding="0">
<thead>
<tr>
<td class="report-data-title-cell report-data-column-odd"><nobr><b>סה"כ עלות ב...
I have two anchor tags that differ only because the second one does not contain the word "Report" in the anchor text or in the address link.
<a href="http://www.example.com/data/invoices/2010/10/invoices-report---tuesday-october-12.html">Invoices Report - Tuesday, October 12</a>
<a href="http://www.example.com/data/invoices/2010/10/...
I have the following XML:
<iq xmlns="jabber:client" to="[email protected]/agsXMPP" xml:lang="en" id="sub23" from="search.google.com" type="result">
<pubsub xmlns="http://jabber.org/protocol/pubsub">
<subscription subscription="subscribed" subid="5077774B57777BD77770" node="search" jid="3985077777...
Hello,
i have this xml/soap from a sharepoint webservice call:
<GetAllUserCollectionFromWeb xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/">
<Users>
<User ID="ID" Sid="ID" Name="XXX" LoginName="XXX" Email="XXX" Notes="" IsSiteAdmin="False" IsDomainGroup="False" Flags="0" />
<User ID="ID" Sid="ID" Name="XXX" ...
I have this:
<pss>
<ps n="А parent node" m="654564654" t="435,8551" a="2857,2716">
<sc s="a1" a="25,4220"/>
<sc s="a2" a="0"/>
<sc s="a3" a="2395,9945"/>
</ps>
...
</pss>
I need to select "А parent node m attribute and a1-a2 a values in one query.
i tried this but it doesnt work:
SELECT ps.value('@m', 'nvarchar(50)...
The HTML you see below is text I have scraped from a remote site, as-is, into a local variable.
Now I need to parse the authorName and bookTitle from the HTML tags into their own variables, given the following consistent format of the scraped text:
<p>
William Faulkner - 'Light In August'
<br/>
William Faulkner - 'Sanctuary'
<...
I'm having trouble figuring out how to select data using a compound XPath query so that I can essentially find the 5th column of row in my data. Here is my example XML:
<sample>
<OBX>
<field position="1">1</field>
<field position="2">My Value</field>
</OBX>
<OBX>
<field position="1">2</field>
<field position="2">My other...
What is the difference between <xsl:apply-templates /> and <xsl:apply-templates select="." />. I thought that the select="." was not necessary, but I am getting different results depending on which I use.
Sorry if this is a repeat. I have tried searching this issue but could not find anything.
...
Hello,
In my SQL 2008 database table, I have one column name AUTHOR that contains XML data. The XML is not well formed and has data like below
<Author>
<ID>172-32-1176</ID>
<LastName>White</LastName>
<FirstName>Johnson</FirstName>
<Address>
<Street>10932 Bigge Rd.</Street>
<City>Menlo Park</City>
<State>CA</State>
</Address>
</Author>
...
I trying to parse a string in an XML node by using an XPath query which requires that I strip out a substring and read the remaining value. The substring may have a dynamic amount of whitespace before and after it before I can get to the value, so it would be helpful to have some sort of a indexOf function to use in the XPath. I'm tryi...