Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Using frames with XML/XSL

From: "ignignokt" <davis929@-----.--->
To: NULL
Date: 2/2/2007 5:04:00 AM

On Feb 1, 12:44 pm, "swami" <sivaswamim...@gmail.com> wrote:
> Hi,
>
> First of all,XMLis mainly used for Data handling not for
> Presentation side.
> The concept explained by you can be achieved by XSL by having
> different stylesheets.
>
> swami
>
> On Feb 1, 7:46 pm, "ignignokt" <davis...@gmail.com> wrote:
>
>
>
> > I would like some help on the best way of acheiving the following: I
> > am trying to create a html document with 2framesthat call a seperate
> >XMLfile for each frame. I would like the top frame to have hyperlinks
> > and when you click on the specific hyperlink, it will display the
> > information in the main frame.
>
> > Example: I have many different CDs. The links on the top frame are "CD
> > 1", "CD 2", "CD 3", etc. When you click on "CD 1" all the information
> > for CD 1 is listed in the main frame.
>
> > My question is how do you sort the information when you click on the
> > hyperlink in oneXMLto the data in the otherXMLfile.
>
> > Here is my mainXMLfile:
>
> > <?xmlversion="1.0" encoding="UTF-8"?>
> > <?xml-stylesheet type="text/xsl" href="vid.xsl"?>
> > <catalog>
> > <disc>
> > <file>
> > <label>AVI 1</label>
> > <name>lagulap2.mpg</name><size>6.11 MB</size>
> > <created>1/25/2007 9:10:39 AM</created>
> > <image01>c:\videocatalog\images\AVI 1\lagulap201.jpg</image01>
> > <image02>c:\videocatalog\images\AVI 1\lagulap202.jpg</image02>
> > <image03>c:\videocatalog\images\AVI 1\lagulap203.jpg</image03>
> > <image04>c:\videocatalog\images\AVI 1\lagulap204.jpg</image04>
> > <image05>c:\videocatalog\images\AVI 1\lagulap205.jpg</image05>
> > <image06>c:\videocatalog\images\AVI 1\lagulap206.jpg</image06>
> > </file>
> > <file>
> > <label>AVI 1</label>
> > <name>ronyoung.avi</name>
> > <size>5.45 MB</size>
> > <created>1/25/2007 9:15:40 AM</created>
> > <image01>c:\videocatalog\images\AVI 1\ronyoung01.jpg</image01>
> > <image02>c:\videocatalog\images\AVI 1\ronyoung02.jpg</image02>
> > <image03>c:\videocatalog\images\AVI 1\ronyoung03.jpg</image03>
> > <image04>c:\videocatalog\images\AVI 1\ronyoung04.jpg</image04>
> > <image05>c:\videocatalog\images\AVI 1\ronyoung05.jpg</image05>
> > <image06>c:\videocatalog\images\AVI 1\ronyoung06.jpg</image06>
> > </file>
> > <file>
> > </disc>
> > <disc>
> > <label>AVI 2</label>
> > <name>sc-comm.mpeg</name>
> > <size>4.56 MB</size>
> > <created>1/25/2007 9:12:39 AM</created>
> > <image01>c:\videocatalog\images\AVI 1\sc-comm01.jpg</image01>
> > <image02>c:\videocatalog\images\AVI 1\sc-comm02.jpg</image02>
> > <image03>c:\videocatalog\images\AVI 1\sc-comm03.jpg</image03>
> > <image04>c:\videocatalog\images\AVI 1\sc-comm04.jpg</image04>
> > <image05>c:\videocatalog\images\AVI 1\sc-comm05.jpg</image05>
> > <image06>c:\videocatalog\images\AVI 1\sc-comm06.jpg</image06>
> > </file>
> > </disc>
> > </catalog>- Hide quoted text -
>
> - Show quoted text -

swami,

thanks for the reply.  I actually meant to come back and update my
post.  I have 2 different xsl files and I can pull a variable from one
xml file to another with the xsl but I cant seem to get it to work:

vid.xsl:

<?xml version='1.0' encoding='ISO-8859-1'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/
Transform">
<xsl:output method="html"/><xsl:template match="/">
<html>
	<body>
		<h2>
			<font face="Arial" size="6">Video Catalog v1.0</font>
		</h2>
	<xsl:variable name="discXML" select="document('file://c:\videocatalog
\disc.xml')"/>
	<xsl:variable name="selection">
	<xsl:value-of select="$discXML['title']"/>
	</xsl:variable>

	<xsl:for-each select="catalog/disc">
		<table width="100%" border="1">
			<tbody>
				<tr bgColor="#0033ff">
					<td width="100%">
						<font face="Arial" size="5">
						<font color="#ffffff"><strong>Disc - </strong>
						<strong><xsl:value-of select="file/label"/></strong>
						</font>
						</font>
					</td>
				</tr>
			</tbody>
		</table>


	<xsl:for-each select="file">
	<xsl:if test="$selection=label">

		<table width="100%" border="1"><tbody>
			<tr bgColor="#00ccff">
				<td><p align="center">
					<font face="Arial" size="4">
					<strong>Filename</strong>
					</font>
					</p>
				</td>
				<td>
					<p align="center">
					<font face="Arial" size="4">
					<strong>Size</strong>
					</font>
					</p>
				</td>

				<td>
					<p align="center">
					<font face="Arial" size="4">
					<strong>Date Created</strong>
					</font>
					</p>
				</td>
			</tr>

			<tr>
				<td>
					<p align="center">
					<font face="Arial">
					<xsl:value-of select="name"/>
					</font>
					</p>
				</td>
				<td>
					<p align="center">
					<font face="Arial">
					<xsl:value-of select="size"/>
					</font>
					</p>
				</td>
				<td>
					<p align="center">
					<font face="Arial">
					<xsl:value-of select="created"/>
					</font>
					</p>
				</td>
			</tr>

			<tr>
				<td><img src="{image01}"/></td>
				<td><img src="{image02}"/></td>
				<td><img src="{image03}"/></td>
				<td><img src="{image04}"/></td>
				<td><img src="{image05}"/></td>
				<td><img src="{image06}"/></td>
			</tr>
		</tbody>
	</table>

	</xsl:if>
	</xsl:for-each>
	</xsl:for-each>


</body>
</html>
</xsl:template>
</xsl:stylesheet>

disc.xsl:

<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/
Transform">
<xsl:output method="html"/>

<xsl:template match="/">
	<html><head></head>
		<body>
			<xsl:for-each select="catalog/disc">
			<tr>
			<a href="file://c:\videocatalog\vid.xml"
target="mainFrame"><xsl:value-of select="title"/></a>
			</tr>
			</xsl:for-each>
		</body>
	</html>
</xsl:template>

</xsl:stylesheet>



transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent