XSLT, using document() to fetch a local JSP generated XML file

Advertisement
October 11

All,
I have 1 XML document that keeps track of various subsite owners of a domain I manage. The xml file doesn't hold much, something along the lines of:
<?xml version="1.0"?>
<sitedirectory>
     <page id="/marys_page" name="Mary's Page"">
          <content_contact ntid="smithm" />
          <technical_contact ntid="techguy" />
     </page>
</sitedirectory>Now I also have a JSP page, that when given an NT id as a URL parameter, rifles through LDAP and spits out an xml document with all the relavent ISID fields for that person's id (first name, last name, phone number, e-mail address etc).
I use the document() function in an XSL file to access that dynamic JSP page, fetch the contents of the resulting XML file. Using the document() function with just a regular file call like "getldap.jsp" only feeds my stylesheet the source of that JSP file, not the resulting XML file that I'm looking for when it's been processed.
So... I have my document() function calling the full URL to that JSP file on my domain, an example <value-of /> call in my XSL file would be:
<xsl:value-of select="document('http://my.domain.com/jsp_util/ldap_person.jsp?ntid=smithm')/person/firstname" />and I get what I want, that person's first name, drawn from LDAP into my XSL file. But it seems a little weird to me, having a server-side transformation, accessing a JSP file by making an http call to the same server the transformation resides in.
Am I missing something? Is there a better way to do this or some directive I'm missing? I'd appreciate any help.

Advertisement

Replay

That's a creative but perfectly reasonable way to use the document() function.
There are other ways to solve the problem, such as including Java calls in your XSL and applying a customized URIResolver to your transformation, but my approach would be to use the simplest method that works acceptably. So if you don't have performance problems with your solution, I would leave it alone.

View 2 Replies

Tags:

  1. arp mac aging best practices
  2. v7 things that we dont know about coc
  3. hp 2560p restarts after shutdown
  4. PARNR LiVE ViDEo ON
  5. rounding off in PR to PO
  6. xai class http
  7. PWKI
  8. usefule1m
  9. DAQmx_Val_ChanPerLine
  10. itunes download 10.5
Copyrights 2019 Fcffair BigData Resource, All rights reserved