Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lists in XML 1

Status
Not open for further replies.

kennyaidan

Programmer
Apr 9, 2003
54
IE
Hi, I am just beginning to learn how to use xml and i have the following problem. I have a list of web links similar to the following
<a href=&quot; Search Engine</a><br></br>
<a href=&quot;<a href=&quot; Forum</a>

I have entered this list into a xml file similar to the following
<link>
<helpful>

<a href=&quot; Search Engine</a><br></br>
<a href=&quot; Engine</a><br></br>
<a href=&quot; Forum</a>

</helpful>
</link>

The part of my stylesheet concerned with the helpful tag is

<font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;><xsl:value-of select=&quot;helpful&quot;/>
</font>

when i run this file using my stylesheet, all that is outputted is the following

Good Search EngineYahoo EngineXml Forum

Is it possible to send a list minus the html tags and then in the stylesheet move through the list and place html tags to each member of the list. the output i would like would be each memebr of the list in a <a href> teg followed by the next member in another <a href> tag
Any help greatly appreciated
Thanks
Aidan
 
So you mean have something along the lines of:
Code:
<link>
	<helpful>
		<alink>
			<address>
				[URL unfurl="true"]http://www.google.com[/URL]
			</address>
			<text>
				Good Search Engine
			</text>
		</alink>
		<alink>
			<address>
				[URL unfurl="true"]http://www.yahoo.com[/URL]
			</address>
			<text>
				Yahoo Engine
			</text>
		</alink>
		<alink>
			<address>
				[URL unfurl="true"]http://www.tek-tips.com[/URL]
			</address>
			<text>
				XML Forum
			</text>
		</alink>
	</helpful>
</link>

And then outputting those entries as links using an XSL?

Altering the xsl could do this like so:
Code:
<font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;>
<xsl:for-each select=&quot;helpful/alink&quot;>
   <xsl:element name=&quot;a&quot;>
      <xsl:attribute name=&quot;href&quot;><xsl:value-of select=&quot;address&quot; /></xsl:attribute>
      <xsl:value-of select=&quot;text&quot; /></xsl:element>
   </xsl:for-each>
</font>

My XSL is rusty, but that should create the links your looking for based on the XML tidbit I created above.

-Tarwn

01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101
29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top