RE: [xsl] Still not getting document() function

Subject: RE: [xsl] Still not getting document() function
From: "Gosselin, Michael" <Michael.Gosselin@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 13 Apr 2006 16:09:41 -0400
Jon,

Thanks for the response.  I'll try to be even clearer this time. 

> -----Original Message-----
> From: Jon Gorman [mailto:jonathan.gorman@xxxxxxxxx] 
> Sent: Thursday, April 13, 2006 2:39 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: [xsl] Still not getting document() function
> 
> Addressing your email slightly out of order:
>
> Do you really just want to print "six lines" or do you want 
> to print the text value of those attributes? 

I do believe that the text value of those attributes is what I want to
print.

> What do you mean it'll be in a table?  Text ouput, xsl-fo output, more 
> xml output, html output, or something competely different?

I receive an XML file, and we have an XSL file.  I need to transform into
both a PDF and PCL file.  When I print one of these documents, I need the
lines on a particular position on the page so that I can put this page on
the front and send the report; the address will show out an envelope window.

> I'm going to just show you how you might approach the problem:

Thanks for the example.
 
> Modify these as appropriate.  You'll probably want to make 
> addReport change the text and not docname.

What is addReport?

> > 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:
> 
> It's not clear why you need to call document from your 
> problem statement.  If you've given a fair description of 
> your problem there should be no need to call document.  I'm 
> going to assume that there is a condition that you're going 
> to use the XML file that the xslt is processing in order to 
> choose addresses.  If you're trying to get to something else 
> you need to describe your problem at a broader level.

Okay, bigger picture.  We send data to a company, where they analyse it and
return a set of files.  We get a PCL, PDF and XML file back from them.  What
we want to do next is generate the mailing address on the front page.  Now,
we don't send the client information because it is confidential (otherwise,
the other company would be doing this).  Also, we could send this out to
more than one client, depending on how the client is set up, as some clients
have "master" clients as well.  This is why I need to generate client info
on the fly.  Another reason to do this is we can store one copy of a report
(with no client info) for internal display, but we can then create a report
as a .pcl file to send to a client as a fax.  Finally, we'll always be
sending from the most up-to-date client information.

> > 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.
> 
> This seems like a red herring.  What does this have to do with the
> document() questions?

It's a matter of how to set up the logic; it could be easier one way or
another, but I'm not sure which, and some of you XSL experts might know
which is better.

> > The lab tag is to differentiate it from the other tag in 
> > the other XML file and the XSLT file.
> 
> It's not a "tag" it's a namespace.  I occasionally stumble on 
> terminology (I think today I mentioned current node in one of 
> my emails when I should said context node) but tag has a very 
> specific meaning as the text between <> when dealing with 
> transformations.

Mea culpa; I'm a stumbler too.

> > 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.
> 
> How the heck are we supposed to know the answer to this when 
> we don't know why you're selecting certain elements?

Hopefully, the bigger picture I presented above answered that.

Michael

Current Thread