[xsl] Still not getting document() function

Subject: [xsl] Still not getting document() function
From: "Gosselin, Michael" <Michael.Gosselin@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 13 Apr 2006 11:18:11 -0400
Okay, I know I asked before, but I'm still not getting this.

I know you can read in a document using the document() function.  I need to
know how to access the elements in the document.

I will be generating a file with one or two addresses for mailing.  For each
address in the document, I would like to loop to transform into a new
document for printing.  I have two ways of doing this:

1) Create the XML file with all addresses, then modify the XSLT file to do a
for-each;
2) Create the XML file with one address, transform, create another XML file,
transform.

Now, I will be the one writing the code to create the XML file with the
address. Below is one way of outputting the file:

<?xml version="1.0" encoding="UTF-8"?>
<!-- ClientInfo.xml  -->
<lab:ClInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:lab="urn:Athena.Antrim">
	<lab:mailing>
		<lab:docname contentType="Text">Dr. Zachary
Smith</lab:docname>
		<lab:addrName contentType="Text">Athena
Diagnostics</lab:addrName>
		<lab:addrStreet contentType="Text">Four Biotech
Park</lab:addrStreet>
		<lab:addrZIP contentType="Text">377 Plantation
St.</lab:addrZIP>
		<lab:addrZIP2 contentType="Text">Worcester, MA
01605</lab:addrZIP2>
		<lab:addReportTo contentType="Text">Will
Robinson</lab:addReportTo>
	</lab:mailing>
</lab:ClInfo>

The lab tag is to differentiate it from the other tag in the other XML file
and the XSLT file.

So, basic question #1: I want to print the (up to) six lines on the first
page, so I can put them in a window envelope.  Any one of the lines might
not be there.  Given this input file, I'd like the following output (which
will be in a table):

Dr Zachary Smith
Athena Diagnostics
Four Biotech Park
377 Plantation St.
Worcester, MA  01605

Additional report to: Will Robinson

How do I get this?

Basic question #2: is there any improvement I can make to the output file so
that it's easier to select the data?  The only thing I want to keep are the
names of the data nodes (docname, addrName, addrStreet, addrZIP, addrZIP2,
addReportTo) because these are object names.

Any and all help is appreciated here.  Thanks!!


Michael Gosselin
Athena Diagnostics, Inc.
(508) 756-2886 x3708
(800) 394-4493 x3708

Current Thread