XML/XSL output to multiple HTML files

I've manually prototyped a mechanism that generates multiple HTML
files from a single XML file, using an XSL template. However, now I
need to automate this mechanism (simple .NET console app).
Being a newby at XML/XSL I'm facing one caveat, namely that each HTML
file is not just the result of a subset of the XML data.
The data is a list of computers, each with lots of details (see
simplified version below).
What I'm after is an HTML file for each computer, with a sort of Table
of Content that lists all the computers.
The TOC will be the same for each HTML file.
So in order to build the TOC, I need to look at the entire XML tree
(top nodes at computer level), whereas for the content of a computer I
need to look at one node at a time.

Example:
<?xml version="1.0" encoding="UTF-8" ?>
<station name="PC1">
  <naming>
    <computername>PC1</computername>
  </naming>
  <hardware>
    <platform>PC</platform>
    <rammb>1152</rammb>
  </hardware>
</station>
<station name="PC2">
  <naming>
    <computername>PC2</computername>
  </naming>
  <hardware>
    <platform>Mac</platform>
    <rammb>4245</rammb>
  </hardware>
</station>
<station name="PC3">
  <naming>
    <computername>PC3</computername>
  </naming>
  <hardware>
    <platform>PC</platform>
    <rammb>2048</rammb>
  </hardware>
</station>


This XML file should be transformed into 3 HTML files, which would
look as follows:
<div>
  <a href="PC1.html">PC1</a>
  <a href="PC2.html">PC1</a>
  <a href="PC3.html">PC1</a>
</div>
<div>
   ... computer details go here
</div>

The XSL can contain a <xsl:for-each select="a:station"> loop to build
the TOC. But how do I go about outputting one HTML file per station
node?

I have a fully functional prototype of XML+XSL = HTML where all
computers are within a single HTML. I could email the files if it
helps clarify the issue.
Any help would be greatly appreciated?

-- Hans
0
11/19/2007 11:13:01 AM
dotnet.xml 7266 articles. 0 followers. Follow

2 Replies
446 Views

Similar Articles

[PageSpeed] 16

Froefel <hansdeschryver@gmail.com> wrote in
<194f5d40-79e0-4e59-959c-ace3e05768ae@e4g2000hsg.googlegroups.com>:
> I've manually prototyped a mechanism that generates
> multiple HTML files from a single XML file, using an XSL
> template.
> 
> This XML file should be transformed into 3 HTML files...
> 
> The XSL can contain a <xsl:for-each select="a:station">
> loop to build the TOC. But how do I go about outputting
> one HTML file per station node?
> 
> I have a fully functional prototype of XML+XSL = HTML
> where all computers are within a single HTML.

Impossible with plain old XSLT1. Possible with XSLT2 (see
xsl:result-document) or EXSLT (exsl:document). See the
documentation for your processor to determine whether it
supports either of those.

-- 
....also, I submit that we all must honourably commit seppuku
right now rather than serve the Dark Side by producing the
HTML 5 spec.
0
p.lepin (3)
11/19/2007 11:23:48 AM
I would suggest you check this solution out:

http://www.perfectxml.com/articles/xml/XSLTInMSXML.asp?pg=2

That's probably the goal you want to achieve, with very little effort.

0
11/22/2007 7:53:55 PM
Reply:

Similar Artilces:

Catching check/uncheck event accross multiple checkboxes
Hello, in a sheet with a couple dozens of checkboxes I need to be able to catch the event when each checkbox gets check or unchecked; probably the worst scenario would be defining an event handler for each checkbox. I wonder if there is a way for me to catch 'a global' check / uncheck event and only after that decode which checkbox had sent that event....? Hi Mac, I think that best way to handle this is to have a command button called Continue or Next otherwise you will never know when the user has finished making the selections. The user might just make one or two s...

XML Header
Hi, I have some XML doc loaded in a C# Web Service. XmlDocument doc = new XmlDocument(); doc.LoadXml(myDoc); Code Missing to manipulate header (I would like to replace or manupulate all these XXXXX): <mso-XXXXXX productversion="XXXXXX"> <mso-application progid="XXXXX"?> doc.Save(myNewDoc); Any idea on how to access and manipulate data within the doc header? Thanks vbdev vb6dev2003 wrote: > I have some XML doc loaded in a C# Web Service. > XmlDocument doc = new XmlDocument(); > doc.LoadXml(myDoc); > > Code Missing to manipulate header ...

Read XHTML into XML
Hi all, I need to read/parse XHTML aspx pages and look for certain tokens and content. How can I use a XmlTextReader for this? If not, any other ideas? Thanks in advance, JA Reyes. Jose Antonio Reyes wrote: > I need to read/parse XHTML aspx pages and look for certain tokens and > content. How can I use a XmlTextReader for this? If not, any other ideas? If the pages are well-formed XHTML then it is possible to use XmlReader (in .NET 2.0/3.0) or XmlTextReader (in .NET 1.x) to parse the XHTML documents. You can also use the other XML APIs .NET provides so using XPathNavigator and/o...

Identify files on two diff spreadsheets
I need help... I have two spreadsheets, named 2008 and RS, both with file numbers in column A1 with different information in the other columns. I need to know if the files on the spreadsheet "RS" are on the spreadsheet "2008" and if so, then put a "1" in column "U" next to that file on the "2008" spreadsheet. I tried the vlookup function, but couldn't quite figure it out. Please help. Thanks in advance. Try this formula in column U of the 2008 sheet: =IF(COUNTIF(RS!A:A,'2008'!A1)>0,"U","") ...

Transaction keeps downloading even after accepted multiple times
I have a checking account which downloads automatically / updates automatically when I start Microsoft. There is one transaction from 11/12/2007 that downloads every time, even though I have accepted it or matched it with a transaction and it still keeps downloading. What do I do? I called the bank and they say it is a Microsoft problem. Please advise. In microsoft.public.money, Connie wrote: >I have a checking account which downloads automatically / updates >automatically when I start Microsoft. There is one transaction from >11/12/2007 that downloads every time, even tho...

How to invoke the xml editor?
I installed vs2005 on a new xp pro machine, and installed everything except C++. When I click on a file with a ".xml" extension it is opened with IE. When I click file/Edit with XML Editor, it opens it with Notepad. If I click File/Open With and select XML Editor, it opens it with IE. So, where is the xml editor? Can it be invoked from withing VS? Where? Bill * billsahiker@yahoo.com wrote in microsoft.public.dotnet.xml: >I installed vs2005 on a new xp pro machine, and installed everything >except C++. When I click on a file with a ".xml" extension it is >opened ...

Sync mail files
I have a small network of 3 computers. Can I syncronize the Outlook.pst file so that any of the 3 machines will have access to all of the mail folders? Any clues will be welcomed. Gill gaffer <gaffergill@bellsouth.net> wrote: > I have a small network of 3 computers. Can I syncronize the > Outlook.pst file so that any of the 3 machines will have access to > all of the mail folders? See if something here helps: http://www.slipstick.com/outlook/sync.htm -- Brian Tillman ...

Corrupted .pst file !!!?!?! Help
Hi, My outlook.pst is corrupted. Tha'ts why I cannot start me outlook 2003 (see my other post here) I used the inbox repair tool (SCANPST.EXE) but it doesn't work, I got the following message: "An unexpected error prevented access ti this file. Use scandisk to check the disk for errors and then try using the inbox repair tool again" Outlook is closed and I already scanned my hard disk using scandisk, and there are no error. The error really seems to come for the corrupted pst file. Related to the file corruption, When I tried to copy the outlook.pst file to an...

adding html link to a pdf download product
I am new to website design and have only taught myself publisher over the last few weeks, and have put together a nice website. I chose Publisher as I didn't want to get too invoved in a html intensive design program. However I am stuck on how I add a html link to the pdf of my e-book which I am selling. And all the associate processes. I've been searching the web for ages but to no avail... Can someone help me? ..in layman's language please :-) Cheers Mand x Reference: Including external files in a Publisher web http://msmvps.com/blogs/dbartosik/archive/2006/01/07/80...

Multiple appearances of a user
I am trying to get up to speed on CRM to administer it for my company. We have several users including users I added to CRM myself that have multiple appearances in CRM for the same user name, but with different role assignments and all for a single ADUC account. This also eats up extra licenses in CRM. I can't figure out why or how these multiple accounts are being created when I know that I only created a single user account with the Deployment Manager. ...

File sharing
Hi, I have a client with two machines running Mac OS X 10.3.6, and MS Office 2004 with SR1, and both machines have file sharing enabled. If machine1 has a file on its hard disk opened called file1.xls, and machine2 tries to open the same file I thought that machine2 would only be able to access the file read-only, and be told this. However what I am seeing is that machine2 can open the file, make changes, and save the changes but if machine1 makes changes and saves their version machine2's changes are lost. Shouldn't machine2 be told that they can only open the file read-only? Thank...

show XML schema and values
I have an XML document that looks like the following: <record> <Field1>value1</Field1> <Field2>value2</Field2> <Field3>value3</Field3> </record> What I'm aiming to do is to show the data in a report as in the following example: record: Field1 value1 Field2 value2 Field3 value3 The "Field1-3"-elements can have any name, so I'm trying to get a table that has in one result column the element name, and in the second colum...

edit multiple values
Hi, I have a price list sheet with item descriptions and pricing. The information is all over, not in straight colums or rows. Is there a way to have excel search out all the cells with $ values and reduce or increase by a specific %. example : Icrease or derease ever cell with a $ value by 20% Hi Eddie, It can be done with a VBA macro, Post Back if you want more. -- Hope this helps! Pat Garard Australia. apgarardATbigpondDOTnetDOTau "Eddie" <123@abc.com> wrote in message news:L0vbb.7310$I36.4654@pd7tw3no... > Hi, I have a price list sheet with item descriptions and p...

Email being comverted to HTML.
I've got this problem where emails, sent as plain text, get converted to HTML. All I want to do is have all mail sent as plain text recieved as such. This behavior occurs when sending plain text messages between users on the same Exchange Server on the same domain. Here is what happens: X-MimeOLE: Produced By Microsoft Exchange V6.5 Received: from 10.1.13.54 ([10.1.13.54]) by FQDN.of.my.exchange.server ([192.168.243.126]) with Microsoft Exchange Server HTTP-DAV ; Tue, 20 Jun 2006 14:07:25 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="iso-8859-1" Content-Trans...

Excel Workbook file increaseing in size
The file was created in XL 97 (I think) and is being opened in XL 2002. It has one sheet. Data in rows 1 - 24 & Columns A - AE. There are cell borders around these cells and some have shading. During the month (it's a roster) the file is updated with an 'X' in the cell which corresponds with the day the employee worked and then saved. The file at present is 5.4MB, in July it was 3.6MB. The amount/number of data has not changed - just the 'X's' have been placed into different cells. Why is it increasing in size this dramatically and why is it this size ...

Offline synch using XML web-services
This is a bit long-winded. Can somebody read thru these 2 use cases, and tell me if it is feasible ? :- Use Case : Replication before Offline Synch Scenario 1 : Oracle Server , MSDE client 1. User clicks on 'Go Offline'. System creates a MSDE SQL database in laptop (client), gets the schemas of the tables in Oracle, creates corresponding tables in client's MSDE SQL (mapping Oracle datatypes to SQL datatypes). 2. Offline replication program reads in the tables of the server into a typed datasets, converts the typed datasets into XML, and stores the XML in the client. (XML serial...

TMP files #3
Since getting a new pc, any attempt to save a file in Excel, instead saves to a TMP file. I get no errors, and I can open the file again fine, but my disks are slowly filling up with TMP file instead of spreadsheets. Any ideas? Jono Although you didn't get an error message this article describes problems with saving files and being left with tmp files. It may provide some insight: http://support.microsoft.com/default.aspx?scid=kb;en-us;103329&Product=xlw -- Jim Rech Excel MVP "jono" <anonymous@discussions.microsoft.com> wrote in message news:1d65401c423a1$29e...

XML Serialization ... how to truncate <?xml...
While xml serializing object how can I truncate <?xml ...?> this line alone? I need to send the serialized xml data to a web method ... since SOAP already have <?xml tag there was some confusion Any help would be greatly appreciated Thank you Regards Raj Raj wrote: > While xml serializing object how can I truncate <?xml ...?> this line alone? Serialize to an XmlWriter created with XmlWriterSettings where you set OmitXmlDeclaration to true. -- Martin Honnen --- MVP XML http://msmvps.com/blogs/martin_honnen/ ...

Multiple Personal Folders
For some reason, Outlook has decided to duplicate everything. I have multiple copies of the "Outlook Today Personal Folders". Everytime I close a reopen Outlook it adds another complete set of folders. How can I get rid of them? "Stephen" <stevs2@ameritech.net> wrote in message news:025d01c34e6a$dc9fdcb0$a401280a@phx.gbl... > For some reason, Outlook has decided to duplicate > everything. I have multiple copies of the "Outlook Today > Personal Folders". Everytime I close a reopen Outlook it > adds another complete set of folders. How can I g...

Import multiple sheet spreadsheet #2
I am importing a single comma delimited text file into Excel 2002 SP3. The final spreadsheet will encompass multiple sheets. What is the delimiter to tell Excel to move on to the next sheet? Thanks for any help. ...

String to xml document
Hi there, I was hoping someone can help me with a little problem I can't seem to find any answers to. I've got a form wich will be posted. On receiving the post I would like to parse a formvar to a xml document. The contents of this formvar (string) will be a valid xhtml document. Can someone give me a startertip (or more :-)) on how to achieve this? tnx in advance, James van der Veen Sjeems wrote: > I was hoping someone can help me with a little problem I can't seem to find > any answers to. > > I've got a form wich will be posted. On receiving the p...

Log files #5
Here's the situation 1. Hard disk died (Single IDE) 2. Have a sucessful ntbackup on a remote server 3. Rebuilt Win Server 2000 with new disk using previous server name 4. Restored System State from ntbackup 5. Reinstall Exchange 2000 SP3 6. Restored Mailbox Store and Public Folder Store. 7. The default Mailbox Store and Public Folder Store would not mount. It would let me create and mount a new one, though. 8. Searched endless articles to find out why Mailbox Store fail to mount but no avail, so created a new Mailbox Store. 9. Deleted all users' Mailboxes ...

Re: Noobish question about DBGrid and .mdb files
Sorry I forgot - DBGrid controls are for RDO - DataGrid controls are for ADO - in my experience DataGrid controls are better. "Clive Minnican" <clive@mail.com> wrote in message news:... > You need to create an ADO Data Control first... See the doc below taken from > Visual C++ 6 online help (Using ADO Databinding in Visual C++). I started > off using the DBGrid control but I now prefer to populate a CListCtrl > manually from a CRecordset because you get a lot more control. It's not as > hard as it sounds either - just read up on CDatabase and CRecordset and ...

store multiple timestamps in one row on table
Hello, I am trying to create a form that allows an employee to select their name and click a command button to store the time they leave for lunch and another button the time that they return. I have each button coded to be written to a table, but I would like to have the in and out times be stored on the same row so I can have a function subtract the two. Currently, it writes a new row for each click of the button. Any help would be appreciated. On Fri, 8 Feb 2008 12:19:56 -0800 (PST), roostorx@gmail.com wrote: >Hello, > >I am trying to create a form that allows an employee to ...

Excel does not display multiple workbooks on the windows taskbar
Excel does not display multiple workbooks on the windows taskbar even when the "Windows in Taskbar"option is checked Do you use shared workbooks? If so, there's a bug in xl2k that's been fixed in xl2002 that played with that setting. Or maybe... http://support.microsoft.com/default.aspx?scid=kb;en-us;Q215816 OFF2000: Only One Icon Visible in Taskbar When "Windows in Taskbar" Option Is Selected elg wrote: > > Excel does not display multiple workbooks on the windows taskbar even when > the "Windows in Taskbar"option is checked -- ...