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

Linking method 1

Status
Not open for further replies.

Bioinformatician

Technical User
Sep 8, 2006
2
0
0
GB

Hi

I'm trying to identify the most appropriate way to link using a URL to part of an XML document displaying only that part (with #ID (A link) not ideal as it displays the entire document). I'm essentially after something like 'get' in a CGI program.

At the moment I have a hack whereby I've stored my various data entries as seperate XML files, with a totals of over 25,000 files. Obviously this is very inefficient.

My XML documents are displayed in Internet Explorer and using XSLT.

Thanks,
Andy
 
Basically, in your XSL, you need to loop through the various records and check the parameter against the corresponding value in the record. Once it matches, then do your HTML output of the values in the record.

It sounds like you've currently got the loop and the HTML output, you just need to add the if statement in between.

Your url would look like "GET in a cgi program": url?ID=735
 
Hi Miros

I've got a HTML output that is generated from linking an file XML with an XSLT in a web browser. I can also add an if statement that uses a variable in an if XPath statement.

But how would you get the XSLT to recognise ?ID=735 as a variable?

e.g. <xsl:param name="instance" select="ARGV[1]"/>

Cheers,
Andy
 
I'm sorry, I'm drawing a complete blank on this, but I know there's a way to get at what you need.

Maybe something like:

<parameter name="ID"> instead of "ARGV[1]"

 
Without knowing what environment integrated into the transformation, to remain within the xslt strict, you can always access an external xml file as a sort of dynamic input to the stylesheet.
[tt]
<xsl:param name="instance" select="document('exturl.xml')/root/queryid"/>
[/tt]
The exturl.xml with that in mind is simply like this.
[tt]
<root>
<queryid>735</queryid>
</root>
[/tt]
As to how this url is established, it would depend on the working environment of the application.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top