473,503 Members | 1,188 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A question on joining more than one xml document to xsl file??

How do it bind the articlelink nodes in the layout.xsl??

I have several xml pages(art1.xml, art2.xml, so on) that I know how link
them up via articles.xml,
<?xml version="1.0" encoding="utf-8"?>
<articles>
<articlelink href="art1.xml"/>
<articlelink href="art2.xml"/>
......
</articles>

But the layout.xsl page is this:
<?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" version="1.0" encoding="iso-8859-1" indent="yes"/>
<xsl:template match="/">
<xsl:for-each select="Article">
<table align="center" width="95%" bordercolor="000000"
bordercolordark="000000" bordercolorlight="000000">
<tr>
<td>
<font size="5">
<b>
<xsl:value-of select="Title"/>
</b>
</font>
</td>
<td>
<xsl:value=of select="Author"/>
</td>
</tr>
<tr>
<td colspan=2>
<xsl:value-of select="substring(Body,1,350)" disable-output-escaping="yes"
/>
</td>
</tr>
<tr>
<td align="left">
<b><xsl:value-of select="Date"/></b>
</td>
<td>
<a href="http://{name}">
<xsl:value-of select="thelink" />
</a>
<br/>
<hr size=2>
</td>
</tr>
</table>
<hr size=2 color=blue />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

TIA
Jan 21 '06 #1
7 1133
Read about the document() function in XSLT, then use it.

Cheers,
Dimitre Novatchev
"Aaron" <fr********@aaronminoo.com> wrote in message
news:Oh**************@TK2MSFTNGP09.phx.gbl...
How do it bind the articlelink nodes in the layout.xsl??

I have several xml pages(art1.xml, art2.xml, so on) that I know how link
them up via articles.xml,
<?xml version="1.0" encoding="utf-8"?>
<articles>
<articlelink href="art1.xml"/>
<articlelink href="art2.xml"/>
.....
</articles>

But the layout.xsl page is this:
<?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" version="1.0" encoding="iso-8859-1"
indent="yes"/>
<xsl:template match="/">
<xsl:for-each select="Article">
<table align="center" width="95%" bordercolor="000000"
bordercolordark="000000" bordercolorlight="000000">
<tr>
<td>
<font size="5">
<b>
<xsl:value-of select="Title"/>
</b>
</font>
</td>
<td>
<xsl:value=of select="Author"/>
</td>
</tr>
<tr>
<td colspan=2>
<xsl:value-of select="substring(Body,1,350)" disable-output-escaping="yes"
/>
</td>
</tr>
<tr>
<td align="left">
<b><xsl:value-of select="Date"/></b>
</td>
<td>
<a href="http://{name}">
<xsl:value-of select="thelink" />
</a>
<br/>
<hr size=2>
</td>
</tr>
</table>
<hr size=2 color=blue />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

TIA

Jan 21 '06 #2
Dimitre,

So what part of XSLT, for-each--apply-templates--variable?

TIA
"Dimitre Novatchev" <di******@tpg.com.au> wrote in message
news:43***********************@authen.yellow.readf reenews.net...
Read about the document() function in XSLT, then use it.

Cheers,
Dimitre Novatchev
"Aaron" <fr********@aaronminoo.com> wrote in message
news:Oh**************@TK2MSFTNGP09.phx.gbl...
How do it bind the articlelink nodes in the layout.xsl??

I have several xml pages(art1.xml, art2.xml, so on) that I know how link
them up via articles.xml,
<?xml version="1.0" encoding="utf-8"?>
<articles>
<articlelink href="art1.xml"/>
<articlelink href="art2.xml"/>
.....
</articles>

But the layout.xsl page is this:
<?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" version="1.0" encoding="iso-8859-1"
indent="yes"/>
<xsl:template match="/">
<xsl:for-each select="Article">
<table align="center" width="95%" bordercolor="000000"
bordercolordark="000000" bordercolorlight="000000">
<tr>
<td>
<font size="5">
<b>
<xsl:value-of select="Title"/>
</b>
</font>
</td>
<td>
<xsl:value=of select="Author"/>
</td>
</tr>
<tr>
<td colspan=2>
<xsl:value-of select="substring(Body,1,350)" disable-output-escaping="yes" />
</td>
</tr>
<tr>
<td align="left">
<b><xsl:value-of select="Date"/></b>
</td>
<td>
<a href="http://{name}">
<xsl:value-of select="thelink" />
</a>
<br/>
<hr size=2>
</td>
</tr>
</table>
<hr size=2 color=blue />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

TIA


Jan 22 '06 #3
http://www.w3.org/TR/xslt#document
"Aaron" <fr********@aaronminoo.com> wrote in message
news:en*************@TK2MSFTNGP12.phx.gbl...
Dimitre,

So what part of XSLT, for-each--apply-templates--variable?

TIA
"Dimitre Novatchev" <di******@tpg.com.au> wrote in message
news:43***********************@authen.yellow.readf reenews.net...
Read about the document() function in XSLT, then use it.

Cheers,
Dimitre Novatchev
"Aaron" <fr********@aaronminoo.com> wrote in message
news:Oh**************@TK2MSFTNGP09.phx.gbl...
> How do it bind the articlelink nodes in the layout.xsl??
>
> I have several xml pages(art1.xml, art2.xml, so on) that I know how
> link
> them up via articles.xml,
> <?xml version="1.0" encoding="utf-8"?>
> <articles>
> <articlelink href="art1.xml"/>
> <articlelink href="art2.xml"/>
> .....
> </articles>
>
> But the layout.xsl page is this:
> <?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" version="1.0" encoding="iso-8859-1"
> indent="yes"/>
> <xsl:template match="/">
> <xsl:for-each select="Article">
> <table align="center" width="95%" bordercolor="000000"
> bordercolordark="000000" bordercolorlight="000000">
> <tr>
> <td>
> <font size="5">
> <b>
> <xsl:value-of select="Title"/>
> </b>
> </font>
> </td>
> <td>
> <xsl:value=of select="Author"/>
> </td>
> </tr>
> <tr>
> <td colspan=2>
> <xsl:value-of select="substring(Body,1,350)" disable-output-escaping="yes" > />
> </td>
> </tr>
> <tr>
> <td align="left">
> <b><xsl:value-of select="Date"/></b>
> </td>
> <td>
> <a href="http://{name}">
> <xsl:value-of select="thelink" />
> </a>
> <br/>
> <hr size=2>
> </td>
> </tr>
> </table>
> <hr size=2 color=blue />
> </xsl:for-each>
> </xsl:template>
> </xsl:stylesheet>
>
> TIA
>
>



Jan 22 '06 #4
I have tried document-for every type tag from XSLT and nothing. I know that
it can be done--thanks for you help Dimitre.

"Dimitre Novatchev" <di******@tpg.com.au> wrote in message
news:43***********************@authen.yellow.readf reenews.net...
http://www.w3.org/TR/xslt#document
"Aaron" <fr********@aaronminoo.com> wrote in message
news:en*************@TK2MSFTNGP12.phx.gbl...
Dimitre,

So what part of XSLT, for-each--apply-templates--variable?

TIA
"Dimitre Novatchev" <di******@tpg.com.au> wrote in message
news:43***********************@authen.yellow.readf reenews.net...
Read about the document() function in XSLT, then use it.

Cheers,
Dimitre Novatchev
"Aaron" <fr********@aaronminoo.com> wrote in message
news:Oh**************@TK2MSFTNGP09.phx.gbl...
> How do it bind the articlelink nodes in the layout.xsl??
>
> I have several xml pages(art1.xml, art2.xml, so on) that I know how
> link
> them up via articles.xml,
> <?xml version="1.0" encoding="utf-8"?>
> <articles>
> <articlelink href="art1.xml"/>
> <articlelink href="art2.xml"/>
> .....
> </articles>
>
> But the layout.xsl page is this:
> <?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" version="1.0" encoding="iso-8859-1"
> indent="yes"/>
> <xsl:template match="/">
> <xsl:for-each select="Article">
> <table align="center" width="95%" bordercolor="000000"
> bordercolordark="000000" bordercolorlight="000000">
> <tr>
> <td>
> <font size="5">
> <b>
> <xsl:value-of select="Title"/>
> </b>
> </font>
> </td>
> <td>
> <xsl:value=of select="Author"/>
> </td>
> </tr>
> <tr>
> <td colspan=2>
> <xsl:value-of select="substring(Body,1,350)"

disable-output-escaping="yes"
> />
> </td>
> </tr>
> <tr>
> <td align="left">
> <b><xsl:value-of select="Date"/></b>
> </td>
> <td>
> <a href="http://{name}">
> <xsl:value-of select="thelink" />
> </a>
> <br/>
> <hr size=2>
> </td>
> </tr>
> </table>
> <hr size=2 color=blue />
> </xsl:for-each>
> </xsl:template>
> </xsl:stylesheet>
>
> TIA
>
>



Jan 22 '06 #5
For more information and examples, see the relevant section of the XSL FAQ:

http://www.dpawson.co.uk/xsl/sect2/N2602.html
Cheers,
Dimitre Novatchev
"Aaron" <fr********@aaronminoo.com> wrote in message
news:eO**************@TK2MSFTNGP11.phx.gbl...
I have tried document-for every type tag from XSLT and nothing. I know that
it can be done--thanks for you help Dimitre.

"Dimitre Novatchev" <di******@tpg.com.au> wrote in message
news:43***********************@authen.yellow.readf reenews.net...
http://www.w3.org/TR/xslt#document
"Aaron" <fr********@aaronminoo.com> wrote in message
news:en*************@TK2MSFTNGP12.phx.gbl...
> Dimitre,
>
> So what part of XSLT, for-each--apply-templates--variable?
>
> TIA
>
>
> "Dimitre Novatchev" <di******@tpg.com.au> wrote in message
> news:43***********************@authen.yellow.readf reenews.net...
>> Read about the document() function in XSLT, then use it.
>>
>> Cheers,
>> Dimitre Novatchev
>>
>>
>> "Aaron" <fr********@aaronminoo.com> wrote in message
>> news:Oh**************@TK2MSFTNGP09.phx.gbl...
>> > How do it bind the articlelink nodes in the layout.xsl??
>> >
>> > I have several xml pages(art1.xml, art2.xml, so on) that I know how
>> > link
>> > them up via articles.xml,
>> > <?xml version="1.0" encoding="utf-8"?>
>> > <articles>
>> > <articlelink href="art1.xml"/>
>> > <articlelink href="art2.xml"/>
>> > .....
>> > </articles>
>> >
>> > But the layout.xsl page is this:
>> > <?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" version="1.0" encoding="iso-8859-1"
>> > indent="yes"/>
>> > <xsl:template match="/">
>> > <xsl:for-each select="Article">
>> > <table align="center" width="95%" bordercolor="000000"
>> > bordercolordark="000000" bordercolorlight="000000">
>> > <tr>
>> > <td>
>> > <font size="5">
>> > <b>
>> > <xsl:value-of select="Title"/>
>> > </b>
>> > </font>
>> > </td>
>> > <td>
>> > <xsl:value=of select="Author"/>
>> > </td>
>> > </tr>
>> > <tr>
>> > <td colspan=2>
>> > <xsl:value-of select="substring(Body,1,350)"
> disable-output-escaping="yes"
>> > />
>> > </td>
>> > </tr>
>> > <tr>
>> > <td align="left">
>> > <b><xsl:value-of select="Date"/></b>
>> > </td>
>> > <td>
>> > <a href="http://{name}">
>> > <xsl:value-of select="thelink" />
>> > </a>
>> > <br/>
>> > <hr size=2>
>> > </td>
>> > </tr>
>> > </table>
>> > <hr size=2 color=blue />
>> > </xsl:for-each>
>> > </xsl:template>
>> > </xsl:stylesheet>
>> >
>> > TIA
>> >
>> >
>>
>>
>
>



Jan 22 '06 #6
Aaron,

If you could post an example of what is inside art(n).xml files it would
helpful.

In particular do each file contain exactly one article node (as the root
node) or can they hold multiple articles.

I'll assume one article and that the root node is the Article node.

Your for-each in the XSL should look like this:-

<xsl:for-each select="document(//articlelink/@href)/article">
But as I said an example of the art xml would allow for a more accurate
answer.

Anthony.

"Aaron" wrote:
How do it bind the articlelink nodes in the layout.xsl??

I have several xml pages(art1.xml, art2.xml, so on) that I know how link
them up via articles.xml,
<?xml version="1.0" encoding="utf-8"?>
<articles>
<articlelink href="art1.xml"/>
<articlelink href="art2.xml"/>
......
</articles>

But the layout.xsl page is this:
<?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" version="1.0" encoding="iso-8859-1" indent="yes"/>
<xsl:template match="/">
<xsl:for-each select="Article">
<table align="center" width="95%" bordercolor="000000"
bordercolordark="000000" bordercolorlight="000000">
<tr>
<td>
<font size="5">
<b>
<xsl:value-of select="Title"/>
</b>
</font>
</td>
<td>
<xsl:value=of select="Author"/>
</td>
</tr>
<tr>
<td colspan=2>
<xsl:value-of select="substring(Body,1,350)" disable-output-escaping="yes"
/>
</td>
</tr>
<tr>
<td align="left">
<b><xsl:value-of select="Date"/></b>
</td>
<td>
<a href="http://{name}">
<xsl:value-of select="thelink" />
</a>
<br/>
<hr size=2>
</td>
</tr>
</table>
<hr size=2 color=blue />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

TIA

Jan 22 '06 #7
Anthony,

Thanks for the help--I solved the problem.

Aaron
"AnthonyWJones" <An***********@discussions.microsoft.com> wrote in message
news:CA**********************************@microsof t.com...
Aaron,

If you could post an example of what is inside art(n).xml files it would
helpful.

In particular do each file contain exactly one article node (as the root
node) or can they hold multiple articles.

I'll assume one article and that the root node is the Article node.

Your for-each in the XSL should look like this:-

<xsl:for-each select="document(//articlelink/@href)/article">
But as I said an example of the art xml would allow for a more accurate
answer.

Anthony.

"Aaron" wrote:
How do it bind the articlelink nodes in the layout.xsl??

I have several xml pages(art1.xml, art2.xml, so on) that I know how link
them up via articles.xml,
<?xml version="1.0" encoding="utf-8"?>
<articles>
<articlelink href="art1.xml"/>
<articlelink href="art2.xml"/>
......
</articles>

But the layout.xsl page is this:
<?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" version="1.0" encoding="iso-8859-1" indent="yes"/> <xsl:template match="/">
<xsl:for-each select="Article">
<table align="center" width="95%" bordercolor="000000"
bordercolordark="000000" bordercolorlight="000000">
<tr>
<td>
<font size="5">
<b>
<xsl:value-of select="Title"/>
</b>
</font>
</td>
<td>
<xsl:value=of select="Author"/>
</td>
</tr>
<tr>
<td colspan=2>
<xsl:value-of select="substring(Body,1,350)" disable-output-escaping="yes" />
</td>
</tr>
<tr>
<td align="left">
<b><xsl:value-of select="Date"/></b>
</td>
<td>
<a href="http://{name}">
<xsl:value-of select="thelink" />
</a>
<br/>
<hr size=2>
</td>
</tr>
</table>
<hr size=2 color=blue />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

TIA

Jan 22 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
1862
by: Eric Sabine | last post by:
Can someone give me a practical example of why I would join threads? I am assuming that you would typically join a background thread with the UI thread and not a background to a background, but...
7
1839
by: Novice Computer User | last post by:
Hi. Can somebody PLEASE help. I have spent hours on this.. but I am a total novice and can't seem to figure it out. Here is a .php script. Right now, the minimum amount of time (i.e. duration)...
2
2317
by: Neil | last post by:
I have an Access 2000 mdb file which opens MS Word docs using automation. Our WAN is somewhat slow, and it takes about six seconds to open Word and the specified document (20 KB) from within Access...
3
2940
by: Water Cooler v2 | last post by:
Questions: 1. Can there be more than a single script block in a given HEAD tag? 2. Can there be more than a single script block in a given BODY tag? To test, I tried the following code. None...
3
6315
by: aratimane | last post by:
Hi, I have received the video file in chunk and want to join/merge these chunks into one video file. I have used cat command in unix for joining video, but while played that video file it...
7
1502
by: mosscliffe | last post by:
I have 4 text files each approx 50mb. I need to join these into one large text file. I only need to do this very occasionally, as the problem has occurred because of upload limitations. ...
3
3644
by: Water Cooler v2 | last post by:
Sorry for asking this beginner question. I've written DTDs so far and read about XML Schemas. I understand that they are a replacement of the DTD fundamentally, and therefore allow for the...
4
1967
by: rhino | last post by:
I'm very new to XML and maybe just a touch impatient because I'm going to ask a moderately advanced question even though I'm just learning the basics. I've spent many years working with...
1
2032
by: buzzw | last post by:
Hi I need to join tables to get employee data records. document.xml is ------------------------------------------ <document name="company"> <table name="A"> <r>
0
7203
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
7089
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
7339
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...
1
6995
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
7463
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1515
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
389
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.