Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

External Data from XSLT 1

Status
Not open for further replies.

Diancecht

Programmer
Jan 8, 2004
4,042
ES
Hi.

From the XSLT specification, it can't access any external resources as databases, links or something like that.

However, I was looking for a workaround for my situation: we use XSLT to generate some PDF forms. This PDF forms, some of which are legal contracts, have a lot of text.

My question is: is there any way to externalize that text from the XSL template to another source?

I was thinking on a database. I've searched the net for it and I found some products that claims to provide database access from xslt.

Did anoyne have any experience with this kind of software?

Cheers,
Dian
 
Why is the text in the XSLT in the first place? What XML to you use to generate the PDF's?

Store the text in XML file(s), or in a database if you prefer (then pull from database in XML). You can use the document() function to access data from a separate file.



Jon

"I don't regret this, but I both rue and lament it.
 
Thanks for the reply.

The documents are legal contracts with a lot of predefined text. Just imagine a sell contract, it has like 20 or 30 paragraphs that are equal in all contracts. At this time, that data is stored in the xsl file.

The xml file just contains the contractor data like name, address and other data as date, place and so on.

The approach I was thinking of is externalize the predefined data.

My first idea was a database accessed via Java, but still didn't manage to get the xsl:script to work, and it looks like it's strongly proccessor-dependent.

Now I'll explore that document funtion.

I have the feeling that I'm not accessing the right sources for documentation. Do you have any links to APIs or tutorials about this? Would be highly appreciated.

Cheers,
Dian
 
Thank you for the link.

Well, it's more a customer request than a idea on my own. The original structure (the text in the xsl) was ok for me: static data on xsl and dynamic data on xml.

The problem is that the text can be either wieved as dynamic or static data. We can face the situation of a change in the law that would reflect on a paragraph for job contracs. Well, our customer wants to have that situation controlled just in case.

My guess is that finally things will remain unchanged, as they use a zero-code visual editor to generate XSL and this kind of functionality will require a deep knowledge and better understanding of XSL.

Btw, I think I'm abusing but, do you have any reliable links on xsl:script used with Java? I've found a bunch, but no one of the seems to work.

Cheers,
Dian
 
I would look at extension functions or elements. Google for "xsl extension elements java"

Jon

"I don't regret this, but I both rue and lament it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top