473,657 Members | 2,435 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:styleshe et 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="00 0000"
bordercolordark ="000000" bordercolorligh t="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="substri ng(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 1142
Read about the document() function in XSLT, then use it.

Cheers,
Dimitre Novatchev
"Aaron" <fr********@aar onminoo.com> wrote in message
news:Oh******** ******@TK2MSFTN GP09.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:styleshe et 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="00 0000"
bordercolordark ="000000" bordercolorligh t="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="substri ng(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.c om.au> wrote in message
news:43******** *************** @authen.yellow. readfreenews.ne t...
Read about the document() function in XSLT, then use it.

Cheers,
Dimitre Novatchev
"Aaron" <fr********@aar onminoo.com> wrote in message
news:Oh******** ******@TK2MSFTN GP09.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:styleshe et 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="00 0000"
bordercolordark ="000000" bordercolorligh t="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="substri ng(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********@aar onminoo.com> wrote in message
news:en******** *****@TK2MSFTNG P12.phx.gbl...
Dimitre,

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

TIA
"Dimitre Novatchev" <di******@tpg.c om.au> wrote in message
news:43******** *************** @authen.yellow. readfreenews.ne t...
Read about the document() function in XSLT, then use it.

Cheers,
Dimitre Novatchev
"Aaron" <fr********@aar onminoo.com> wrote in message
news:Oh******** ******@TK2MSFTN GP09.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:styleshe et 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="00 0000"
> bordercolordark ="000000" bordercolorligh t="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="substri ng(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.c om.au> wrote in message
news:43******** *************** @authen.yellow. readfreenews.ne t...
http://www.w3.org/TR/xslt#document
"Aaron" <fr********@aar onminoo.com> wrote in message
news:en******** *****@TK2MSFTNG P12.phx.gbl...
Dimitre,

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

TIA
"Dimitre Novatchev" <di******@tpg.c om.au> wrote in message
news:43******** *************** @authen.yellow. readfreenews.ne t...
Read about the document() function in XSLT, then use it.

Cheers,
Dimitre Novatchev
"Aaron" <fr********@aar onminoo.com> wrote in message
news:Oh******** ******@TK2MSFTN GP09.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:styleshe et 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="00 0000"
> bordercolordark ="000000" bordercolorligh t="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="substri ng(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********@aar onminoo.com> wrote in message
news:eO******** ******@TK2MSFTN GP11.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.c om.au> wrote in message
news:43******** *************** @authen.yellow. readfreenews.ne t...
http://www.w3.org/TR/xslt#document
"Aaron" <fr********@aar onminoo.com> wrote in message
news:en******** *****@TK2MSFTNG P12.phx.gbl...
> Dimitre,
>
> So what part of XSLT, for-each--apply-templates--variable?
>
> TIA
>
>
> "Dimitre Novatchev" <di******@tpg.c om.au> wrote in message
> news:43******** *************** @authen.yellow. readfreenews.ne t...
>> Read about the document() function in XSLT, then use it.
>>
>> Cheers,
>> Dimitre Novatchev
>>
>>
>> "Aaron" <fr********@aar onminoo.com> wrote in message
>> news:Oh******** ******@TK2MSFTN GP09.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:styleshe et 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="00 0000"
>> > bordercolordark ="000000" bordercolorligh t="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="substri ng(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="documen t(//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:styleshe et 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="00 0000"
bordercolordark ="000000" bordercolorligh t="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="substri ng(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
"AnthonyWJo nes" <An***********@ discussions.mic rosoft.com> wrote in message
news:CA******** *************** ***********@mic rosoft.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="documen t(//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:styleshe et 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="00 0000"
bordercolordark ="000000" bordercolorligh t="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="substri ng(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
1871
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 since I'm asking in the first place, assume that assumption to be very assuming. thanks, Eric
7
1848
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) allowed is 1 month. However, I want to be able to reduce the minimum amount of time to 1 day (i.e. 24 hours) -- basically a 24 hour trial period. Can somebody PLEASE PLEASE tell me what I need to change in this file to do this? Here is a...
2
2325
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 using automation. I also noticed that if I use Shell to open Winword and the document, or if I just enter the document name from a Command window, it also takes 6 seconds. However, if I double-click on the file from Windows Explorer to open Word...
3
2957
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 of the script gets executed. Can someone please give me a direction as to what I may be missing? Thanks.
3
6343
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 will display one file only not joined second file. Is there any otherway to merge video chunks ? Plz help me out for the same
7
1508
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. Bearing in mind filesize and memory useage, would I be better reading every line in every file and writing each line to the output file or is there someway I could execute some shell command.
3
3658
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 validation of an XML document. My question really is: Why do we need XML Schemas other than for validation of an XML document? I am more interested in knowing if already available
4
1979
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 databases, both hierarchical and relational. So far, XML is obviously hierarchical in nature. I'm wondering if there is anything analogous to a relational "join" in XML? For example, let's say I have an XML file that has a root element of departments....
1
2040
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
8395
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8310
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8826
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8503
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7330
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6166
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4155
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1615
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.