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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

call java program from xsl

Status
Not open for further replies.

lovinasd

Programmer
Jan 23, 2005
23
US
Hi,
can you generate a dynamic xsl using database?
I have generated a report which is a dynamic xml populated from the database.How can we call a java program in a xsl.

<report>
<q_1_a>test1</q_1_a>
<q_1_b>test2</q_1_b>
<q_1_c>test3</q_1_c>
<q_1_d>test4</q_1_d>
</report>

I would like the xsl to pick the text from the java program for the elemeent name and descriptioni.e. <q_1_a>
Is it possible to generate a dynamic xsl than changing my xml which will make it lengthier.





The out put would be dynamic output from the java program will be the element q_1_a and the lengthier description.
The xml contains the column 1 values like
above is it possible to geneerate the names and map them


column 1 column2
q_1_a Is this a test?
q_1_b Is this a test1?
q_1_c Is this a test2?
Tha values of column 2 can be something lengthier like 255 char.
in order to avoid the dynamic xml to write the va;ue again and again i have given it names like q_1_a


the output would look like
column replace the elemnt tag
q_1_a
replaced
by the below content from database.

q_1_a q_1_b q_1_c
is this test? Is this test1? Is this text3?

note :here would be the value of this tags below
test1 test2 test3


Thanks,





 
Hello again...

Well, you have asked this 'question' before without much response, so perhaps you could review this FAQ from the VB forum: faq222-2244.

lovinasd said:
can you generate a dynamic xsl using database? I have generated a report which is a dynamic xml populated from the database.How can we call a java program in a xsl[?]

What I understand from this is that you have issued a SQL query (from Java?) the result set of which is an XML document. Is that correct?

What do you consider 'dynamic xsl'?

Perhaps you could restate what problem you are trying to solve at a slightly more abstract level. We can see from this and previous posts what has not been working for you, but I for one have absolutely no reasonable understanding of what problem you are trying to solve.

Tom Morrison
 
Yes, Tom is right. State the problem, as there is probably a better way to achieve this. Calling code from XSL is almost always a hack, and almost never necessary.

XSL does not necessarily have to match specific names of elements. It can work with position instead. Depending on what you're doing, perhaps its better to use a script to create an XML file from the data, then use a more generic XSL stylesheet to get the desired output.

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