473,406 Members | 2,713 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,406 software developers and data experts.

XML Loop Statement

Hello,

Is it possible to loop through an element and have it skip over certain characters so that it spits out only what you want? For example, inside the Picture tag I need to either strip out or skip over everthing before the http://protocol.
I have tried searching for examples of this and fear that there may be no solution. I have also used basic find and replace in any given editor but this is tedious and only satisfies limited results.

Thank-you all in advance,

Andrea


Here is a block of xml code:
<Product Id="12x10czpendent">
<Code>P033OV</Code>
<Description>12X10 CZ PENDENT</Description>
<Url>http://store.silverandcz.com/12x10czpendent.html</Url>
<Thumb>&lt;img border=0 width=62 height=70 src=http://us.st11.yimg.com/us.st.yimg.com/I/yhst-77161201758896_1920_678&gt;</Thumb>
<Picture>&lt;img border=0 width=269 height=305 src=http://us.st11.yimg.com/us.st.yimg.com/I/yhst-77161201758896_1920_3417&gt;</Picture>

<Orderable>YES</Orderable>
<Taxable>YES</Taxable>
<Pricing>
<BasePrice>2.50</BasePrice>
<LocalizedBasePrice>2.50</LocalizedBasePrice>
</Pricing>
<Path>

<ProductRef Id="pendants" Url="http://store.silverandcz.com/pendants.html">Pendants</ProductRef>
</Path>
<Caption>MOD 4 PRNG PENDENT 12X10</Caption>
<OptionLists>
<OptionList name="Color">
<OptionValue>Amethyst</OptionValue>
<OptionValue>Black</OptionValue>

<OptionValue>Champagne</OptionValue>
<OptionValue>Peridot</OptionValue>
<OptionValue>Pink</OptionValue>
<OptionValue>Aqua Glass</OptionValue>
<OptionValue>White</OptionValue>
</OptionList>

</OptionLists>
</Product>
Here is my xsl stylesheet
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
<body>
<table border="1">
<xsl:for-each select="StoreExport/Products/Product">
<tr>
<td><xsl:value-of select="Url"/></td>
<td><xsl:value-of select="Description"/></td>
<td><xsl:value-of select="Description"/></td>
<td><xsl:value-of select="Picture"/></td>
<td><xsl:value-of select="Path"/></td>
<td><xsl:value-of select="BasePrice"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Nov 20 '06 #1
0 1474

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

Similar topics

47
by: Mountain Bikn' Guy | last post by:
Take some standard code such as shown below. It simply loops to add up a series of terms and it produces the correct result. // sum numbers with a loop public int DoSumLooping(int iterations) {...
34
by: sushant | last post by:
hi all, suppose i have 2 loops one inside the other, like this 1) for(i=0;i<=100;i++) { for(j=0;j<=10;j++) { some code; }
9
by: JS | last post by:
#include <stdio.h> main(){ int c, i, nwhite, nother; int ndigit; nwhite = nother = 0; for (i = 0; i < 10; ++i)
15
by: PagCal | last post by:
Is this language missing the functionality of a C/C++ 'continue' statement? For example: While NOT isEof() If condition ' a C or C++ continue would work here ' but we are forced to use a...
3
by: Ben R. | last post by:
In an article I was reading (http://www.ftponline.com/vsm/2005_06/magazine/columns/desktopdeveloper/), I read the following: "The ending condition of a VB.NET for loop is evaluated only once,...
34
by: Frederick Gotham | last post by:
Is the domestic usage of the C "for" loop inefficient when it comes to simple incrementation? Here's a very simple program that prints out the bit-numbers in a byte. #include <stdio.h> #include...
14
by: dba_222 | last post by:
Dear experts, Again, sorry to bother you again with such a seemingly dumb question, but I'm having some really mysterious results here. ie. Create procedure the_test As
3
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Here is my loop and it runs fine: ---------------------------------------------------- sSQL = "SELECT * FROM STORE_ITEMS" Set DataRec = DB.execute(sSQL) if not DataRec.EOF then do while not...
26
by: a.mil | last post by:
I am programming for code-speed, not for ansi or other nice-guy stuff and I encountered the following problem: When I have a for loop like this: b=b0; for (a=0,i=0;i<100;i++,b--) { if (b%i)...
16
by: Andy B | last post by:
I have the following code inside of a WebBrowser.DocumentCompleted event: For index As Integer = 0 To Me.Browser.Document.GetElementsByTagName("ul").Item(0).GetElementsByTagName("li").Count ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.