473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Fetch attribute value from xml

Hi

I require to fetch a value from xml with asp.

my xml data is as

<R N="1">
<U>http://www.solgar.co.uk/</U>
<UE>http://www.solgar.co.uk/</UE>
<T>Vitamins from Solgar Vitamin Supplements and Mineral Supplements <b>...</b></T>
<RK>0</RK>
<S>Vitamins from Solgar : Discount vitamin supplements from our online vitamin <br> store, including <b>amino</b> acids, vitamin b, vitamin c, vitamin e, <b>...</b></S>
<LANG>en</LANG>
<Label>_cse_x0qmgd4mgeu</Label>
<HAS>
<L />
<C SZ="46k" CID="-eDyAtQ5j8EJ" />
<RT />
</HAS>
</R>
<RG START="2" SIZE="1" />
<R N="2">
<U>https://www.solgar.co.uk/product/l-ornithine-500mg-50-capsules-E2060.html</U>
<UE>https://www.solgar.co.uk/product/l-ornithine-500mg-50-capsules-E2060.html</UE>
<T>L-Ornithine 500mg: 50 Capsules - <b>Amino</b> Acids - Solgar <b>Amino</b> Acids <b>...</b></T>
<RK>0</RK>
<S>L-Ornithine 500mg: 50 Capsules - LOrnithine 500 mg Vegicaps (Free Form) SUGAR, <br> SALT AND STARCH FREE · SUITABLE FOR VEGANSSolgar LOrnithine 500mg.</S>
<LANG>en</LANG>
<PageMap>
<DataObject type="image">
<Attribute name="image_src" value="http://www.solgar.co.uk/modules/shop/images/LORNITHI.jpg" />
</DataObject>
<DataObject type="publication">
<Attribute name="price" value="£12.86" />
</DataObject>
</PageMap>
<HAS>
<L />
<C SZ="28k" CID="kczLO08HM1AJ" />
<RT />
</HAS>
</R>


ASP Script:

xPath = "//RES/R"
set result = xmlDocument.selectNodes(xPath)
for each record in result
link = record.selectSingleNode("U").text
desc = record.selectSingleNode("S").text
set image = record.selectSingleNode("PageMap").childNodes(0).a ttributes.getNamedItem("image_src").nodeValue

Here with this script i am able to fetch value of <U> and <S>. But also i need to fetch value of image_src and price which is in <DataObject> of <PageMap>

Help is really required
Jun 14 '10 #1
1 2061
jhardman
3,406 Expert 2GB
I was just thinking about this, and I don't know of a way to do that using standard XML controls. If you could get to the text of the xml you could access the properties using regular expressions.

Jared
Jun 18 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Andrew Lord | last post by:
XML-Schema: Attribute Value dependent rules? As far as I can tell XML-Schema does not permit the sepcification of rules that only apply if an attribute has a certain value. For example, in the...
4
by: elora_c | last post by:
I'm trying to write XSLT that will filter out an XML based on an attribute's value. XML looks like: <postings> <channel name="A"> <posting Connected="True" name="Posting1" /> <posting...
5
by: Mateusz Loskot | last post by:
Hi, I'd like to ask how XML parsers should handle attributes which consists of &quot; entity as value. I know XML allows to use both: single and double quotes as attribute value terminator. That's...
2
by: Dirk Declercq | last post by:
Hi, Is it possible in Xml to enfore the uniqueness of an element based on his attribute value. Say I have this schema : <?xml version="1.0" encoding="UTF-8"?> <xs:schema...
2
by: Greg | last post by:
Hi. I have a rather large xml document (object) that can have one or more nodes with a certain attribute throughout (at ANY depth, not at the same level necessarily). I need to find this...
10
by: Jon Noring | last post by:
Out of curiosity, may a CDATA section appear within an attribute value with datatype CDATA? And if so, how about other attribute value datatypes which accept the XML markup characters? To me,...
1
by: lophiomys | last post by:
Hi, I have an extra long attribute value, and can't find a way to wrap it over several short lines in my text editor, so that it stays nicely human readable. Is there a line-continuation...
14
by: gooooglegroups | last post by:
I want to transform the following xml file ------------------------------------------------------------------------ <?xml version="1.0" encoding="ISO-8859-1"?> <a> <b attrib="if 3 2"> </b> ...
2
by: mirlisa | last post by:
I'm using an HtmlSelect (runat=sever). I add the items programmatically and I also add a custom attribute to each listitem because I need to track an additional field value. I'm having a...
5
by: Oleg.Ogurok | last post by:
Hi there, I need to encode the value of an XML attribute, e.g. string myXml = "<element myAttr=\"" + encodeURIComponent("my \"value") + "\"" ...."; Is there an equivalent of...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.