XML, XSLT and Omniportlet

Hello, I hope I can find some help.
Using 10.1.14.
I'm importing an XML document. I don't know if it's in rowset/row format (don't know what that is).
I use XSL to transform it. When I click "test", I see pretty much what I want. A table tag, a td with a value, a td with another value, this repeats 4 times. This is the number of "item" elements I have. Great. Everything is set to default.
When I view my page, however, this is the response: Error fetching XML data. Or nothing, because I've tried many different configurations of XSL. When I view my page, it never works.
this is my xml:
<?xml version="1.0" encoding="UTF-8"?>
<record name="N/A" type="content">
<item name="Title"><value>Disclosure of Position Reclassifications</value></item>
<item name="Language"><value>eng</value></item>
<item name="Other Language File Name"><value>/sm/srh/prh/cngc/dsc/Reclass_f</value></item>
<item name="Content"><value>
& lt;table border="0" cellspacing="0" cellpadding="0" width="450"& gt;
& lt;tr& gt;
& lt;td colspan="3"& gt;& lt;h2& gt;Disclosure of Position Reclassifications& lt;/h2& gt;& lt;/td& gt;
& lt;/tr& gt;
& lt;/table& gt;
***LOTS OF HTML CLIPPED***
Act& lt;/u& gt;& lt;/i& gt;& lt;/a& gt; does not appear on this web site.& lt;/p& gt;
& lt;/td& gt;
& lt;/tr& gt;
& lt;/table& gt;
</value></item></record>
this is my xsl:
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:template match="record">
<table>
<xsl:for-each select="item">
<tr>
<td><xsl:value-of select="@name"/></td>
<td><xsl:value-of select="value" disable-output-escaping="yes"/></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:transform>

Hi there,
I think missunderstand some basics.
to display XML documents, omniportlet takes in input onlu XML docs like this :
<rowset>
<row>my 1st line</row>
<row>my 2nd line</row>
<row> ... </row>
</rowset>
That means that the XML tags of your document MUST be ROWSET for the group and ROW for each element.
Omniportlet will render the previous XML fragment like this :
<table>
<tr>
<td>my 1st line</td>
<td>my 2ndline</td>
</tr>
<table>
So you got to write your XSL in order to transform your Initial XML in the rowset/row format. Omniportlet will take in charge of the HTML-table rendering.
Otherwise, your XML is not written in a good way. It should have been like this :
<?xml version="1.0" encoding="UTF-8"?>
<record name="N/A" type="content">
<Title>Disclosure of Position Reclassifications</Title>
<Language>eng</Language>
<OtherLanguageFileName>/sm/srh/prh/cngc/dsc/Reclass_f</OtherLanguageFileName>
<Content>
& lt;table border="0" cellspacing="0" cellpadding="0" width="450"& gt;
& lt;tr& gt;
& lt;td colspan="3"& gt;& lt;h2& gt;Disclosure of Position Reclassifications& lt;/h2& gt;& lt;/td& gt;
& lt;/tr& gt;
& lt;/table& gt;
***LOTS OF HTML CLIPPED***
Act& lt;/u& gt;& lt;/i& gt;& lt;/a& gt; does not appear on this web site.& lt;/p& gt;
& lt;/td& gt;
& lt;/tr& gt;
& lt;/table& gt;
</Content></record>I recommand you to have a look at XML tutorials : http://www.w3schools.com/xml/xml_elements.asp
XSL tutorials (if you need) : http://www.w3schools.com/xsl/
I hope this could help you.

Similar Messages

  • Xml xslt and java

    To obtain a HTML form from a xsd (xml schema) I thought I must use a parser to parse the schema and extract field info (how many fields needed and which type) to create the form to add records to a simple XML DB, like:
    <db>
    <rec id="0">
    </rec>
    </db>
    but someone suggested me to use a XSLT, but I don't figure I can use it... and anyway... I must use xalan to apply that xslt to my xml schema to translate it, right?
    suggestions, tips and so on are really appreciated!
    Thank you in advance!
    Dakkar

    javax.xml.transform:
    javax.xml.transform.stream:
    Source xsltSource = new StreamSource(new File("mytemplate.xslt")); // e.g. from XSLT file
    Transformer t = TransformerFactory.newInstance().newTransformer(xsltSource);
    t.transform(source,result); // where source is your schema doc and result is the target (a stream, a file ...)

  • JSP   vs.    XML/XSLT

    Hi all!
    I'm in a bit of a dilema. As the least knowledgable member of our small development group (3 people incl. me) I'm caught in the middle of a pretty fierce debate over whether or not to we should implement JSP.
    Currently to seperate business logic from presentation we have our servlets pass XML to the browser and then the browser renders the HTML using the appropriate .xsl (sometimes we use server-side transformation).
    Now one of the guys wants to use MVC/Struts and JSPs in order to create a much needed UI for an application. The plan is to not put any Java code in the JSP (seperation of logic and presentation - good, business logic in both the JSP and Servlet - bad.) but the other guy is still vehemently against it.
    He says that anything JSP can do we can already do with XML/XSLT and to add JSP to our environment would complicate things.
    And while I agree with him there, there are some things that when you do them with JSPs make the code more readable and transparent.
    If you had to take a side, which one would you choose?
    Has anyone else out there already gone through this debate? I'd be interested in knowing the outcome.
    Thanks,
    John

    I have a couple of comments.
    1> "XML to the browser and then the browser renders the HTML using the appropriate .xsl"
    I all cases you should do the transformations on the server. Lot of browser do not know how to
    do a xsl transform. And since you can do it some time why not do it not everytime?
    2> "business logic in both the JSP and Servlet"
    Business logic should neither be in servlets nor in jsp. I think they should be in business logic beans.
    3> "anything JSP can do we can already do with XML/XSLT "
    Although anything can be done using xml/xsl or jsp there are a bit of differences where struts-jsp architecture is more perferable.
    Imaging a web site which has lots of online forms(with textfiedls, checkboxes, select lists, etc) which are to be validated and if some validation fails the same form is to be shown with the values already submitted prefilled. Doing this with xml/xsl or even simple jsp could be a nightmare.
    But if you use struts MVC architecture with jsp and struts taglib this will be very very simple.
    Introducing struts-jsp will not complicate things and if the scnario described above is there or could arise in your application then you should seriously think about using struts+jsp. That does not mean you will have to scrap you xml+xsl architecture. You can still generate the xml using your action bean , put the xml in request and forward it to you jsp for rendetion. The jsp page could then use a taglib which has the xsl transformation code to do the xslt transformation.
    The above comments are not just my thoughts but i have also implemented/experienced the above during various projects and they have proved to be useful.
    Cheers!

  • Simple XML to Text onversion using XSLT and Java?

    Hi all!
    I'm completly new to using XSLT and Java and are trying to convert a XML file into a ordinary Textfile that I am gonna import into another application.
    I started up writing a ordinary XML parser in Java which interpreted the XML file, but realized later on that it was possible to do with a ordinary XSLT.
    So far it is a 2-step process right now, I've tied my XSLT to the XML file and then just open the XML file up in a ordinary browser and then get the result.
    I found an example (http://www.onjava.com/pub/a/onjava/excerpt/java_xslt_ch5/index.html?page=3) where u hook up a XML file and a XSL file separately and the process it, and dump it to Stdout. But do I need to hook up a XSL file like this when the XML file is tied to a XSL file internally?

    Just to give you an example to show you how easy it is: http://www.daniweb.com/forums/thread137587.html

  • Question about Java,XSLT and XML

    I am new to Java and XML. I'm not quite clear the relationship between Java,XSLT and XML.
    To exercise, I am going to write a Java program that makes embedded calls to an XSLT processor(XALAN), to produce results for several constrained transformations from a given XML document(x.xml) such as:
    1.Transform the x.xml (which satisfies d1.dtd) in such a way that it now conforms to the DTD d2.dtd. Output the resulting xx.xml document.
    2.query some information from the x.xml and then form an Html output.
    3.summary some information, do some statistics from the x.xml and then form an Html output.
    I don't konw which java classes and XSLT functions might be used.(Actually I don't know how/where to start).
    Can anyone give me some clue ?
    thanks a lot!

    You must provide XSLT stylesheeds to specify transformations (1), (2),
    and (3); let's call those stylesheets task1.xsl and so on.
    The following code will transform x.xml into xx.xml according to task1.xsl. It gives you an idea which packages and classes to use, but it doesn't teach you proper Java programming technics :)
    import java.io.File;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.*;
    public class Test
        public static void main(String[] args) throws Exception
            TransformerFactory factory = TransformerFactory.newInstance();
            Source config = new StreamSource(new File("task1.xsl"));
            Transformer transformer = factory.newTransformer(config);
            Source source = new StreamSource(new File("x.xml"));
            Result result = new StreamResult(new File("xx.xml"));
            transformer.transform(source, result);
    }To read about XSLT, see:
    http://www.w3.org/TR/xslt
    there is a tutorial on using XSLT with Java:
    http://java.sun.com/xml/jaxp/dist/1.1/docs/tutorial/xslt/index.html.

  • Import XML, apply XSLT and embed images

    Hi everyone. I've been looking for days now about a way to export the content of a website as XML and import it then into InDesign, involving some basic text formatting and maybe links, lists and tables. Getting a XML version of a website isn't actually the problem. But including some InDesign readable formatting structure caused me some headache.
    First of all, I used InDesign from CS2 and read a lot about INX structure, XML Namespaces and Tagged Text. None of what I did seemed to result in any acceptable or properly working import. So I've read about CS3 having a new feature of applying XSL Stylesheets when importing a XML file and finally downloaded a trial version to test this out. Problem is, I can't find any helpful documentation on how to use this feature right. Neither in the web nor in your forums.
    So how does a XSL file have to look like in order to import XML with some basic formatting?
    Let's say the XML looks like this, very simple:
    ] <?xml version="1.0" encoding="UTF-8"?>
    ] <?xsl-stylesheet type="text/xsl" href="style.xsl"?>
    ] <root>
    ] <text>
    ] <bold>This text is bold</bold> and <italic>this seems to be italic</italic>.
    ] </text>
    ] <underline>I'm under the line</underline>
    ] </root>
    How does my XSLT code in "style.xsl" have to look like in order to tell InDesign that the content of <bold> has to be bold, the one of <italic> italic and leaving <underline> underlined?
    I tried placing Tagged Tags around the content with XSL but this just resulted in errors or plain text output in InDesign. I also tried to understand the magical code structure of INX, but left it behind until I recognized how complex it is.
    Until now, only Tagged Tags do what they shall do for me. Only problem is, the file with this Tagged Tags has to be TXT, but I want XML. Isn't there any way to apply a XSL file over a XML file and replace the XML tags with some Tagged Tags, and finally import everything successful into InDesign? I tried something like that and told the XSL to output the file as Text with
    i <xsl:output method="text" />
    but InDesign replies with an error as "text" is not valid for DOM structuring.
    Moreover, another problem is with importing images without having them saved on the local machine. Meaning, how to send images embed in XML files?
    Here I also tried many things like <![CDATA[base64-code-here]]> and so on, but never happened to tell InDesign that it has to do something with this code instead of just displaying it. Using
    i <image href="data:image/jpeg;base64,base64-code-here" />
    or anything alike didn't work at all.
    In the end, I want to allow downloading a XML version of the viewed site on my website which can be imported into InDesign with all basic formatting used on the site itself. Getting the XML file prepared is just a matter of some PHP scripting. Now I only have to know what InDesign can actually read, and of course, if InDesign is even able to do anything of what I've planned.
    I hope someone can help me.
    Thank you very much in advance, Dan

    XSL will re-arrange incoming XML so that you can flow the XML into an InDesign document that may be arranged differently than the incoming XML file.  You still need to set up tags and associate those tags with styles in order to achieve what you want.  You can use Maivald's "A Designer's Guide to Adobe InDesign and XML: Harness the Power of XML to Automate your Print and Web Workflows" as a starting point, but you will need to play with the pieces to figure it out.<br /><br />For your simple example, you will need to set up tags in text frames for <bold> and <italic>, create paragaph (or object) styles of [bold] and [italic] and then associate those styles with the tags.  Only then can you import the XML file and have things work.  InDesign has no pre-defined knowledge of what any XML tag means, even when the meaning seems obvious.  You are free to define your <bold> XML tag to mean italic text, for example.<br /><br />Though I've read through the Maivald book and converted a Spanish cookbook to English (as a gift for my mom), I am not by any means overly knowledgeable here.  It could well be that there are many ways to achieve the goal and I only know one, lol.<br /><br />Hope this helps.

  • XML transformation using XSLT and Resin 2.1.11

    I have the following problem:
    I'm using a servlet to transform the xml files in my web-app to html. The servlet caches the ones transformed results. For each request it checks if there exists a cached result and if the result is based on the most actual xml file version (checking the "lastModified" method of java.io.File that represents the requested file).
    This servlet works fine and without any errors.
    My web-app also has some other servlets that use the xml transformation to generate a fragment of html code (the menu structure of my "normal" servlets is defined in one xml file for all other files and servlets).
    After invoking these servlets (those that use the xml transformation to create their menu) the first described servlet (transformation of requested xml files) is not working "fine" any longer. All it results is the generated header and footer of the page (hard-coded in the XSL file). The complete content is lost.
    Any ideas how to solve this problem?
    Thanks in advance,
    Thof

    1. The cache:
    The Hashtable is a field of my servlet called XMLTransformerServlet. The cache is not removed or deleted and none of its items is removed or deleted.
    As I said: Caching works fine, wonderful, perfectly...
    That's definitively not the problem.
    2. Thread safety:
    I've made all my servlet methods thread safe (just checked this...)
    3. About the "anonymous" other servlet type that uses xml transformations:
    Some of my servlets use a (thread safe) method to generate a fragment of html code that will show a simple menu structure. Therefore my web-app uses a file called menu.xml - by that way there's only one menu to maintain what makes sure that all my pages get the same menu structure (finally also the xsl file I'm using for "normal" xml transformation imports/includes and interprets this menu.xml).
    The (thread safe) method has transforms the menu.xml file using a special xsl file (menu.xsl) and outputs the result to a StringWriter. From this StringWriter I obtain the code-fragment that will be returned by the method.
    Before I saw the class StringWriter the first time I've used a temporary file to output the transformation result. Next I red in the file and returned its content.
    Finally - this method is working fine and it's always returning the expected data.
    4. The problem:
    Sorry for repeating this all the time...
    What I'm processing:
    &#160;- requesting some xml files -> XMLTransformerServlet is invoked and works fine:
    &#160;&#160;&#160;-> doGet checks the resource (if resource doesn't exist HTTP404 will be responded)
    &#160;&#160;&#160;-> doGet checks the caching state for this resource
    &#160;&#160;&#160;&#160;&#160;&#160;a) resource is in cache and no newer version of the File exists -> return cached element
    &#160;&#160;&#160;&#160;&#160;&#160;b) resource is in cache but a newer version exists in the file system -> recache and return newly cached element
    &#160;&#160;&#160;&#160;&#160;&#160;c) resource is not in cache -> cache the resource and return the newly cached element
    &#160;- requesting one of the other servlets (those that use xml transformation for menu generation)
    &#160;&#160;&#160;-> servlets invoked work fine
    &#160;- requesting a xml file:
    &#160;&#160;&#160;a) current version in cache -> return cached element
    &#160;&#160;&#160;b) no current version in cache -> transform the xml file and cache it
    This last transformation of the requested xml file fails.
    It is not failing in the sense of "throwing an exception"... it seems to work 100% fine and results a String that could be responded to the browser.
    But stupidly it is not working fine...
    Maybe (as you wrote) this is a bug (maybe in Resins xml transformation api).
    Just thought someone else might have made a similar experience...

  • Reading XML file and skip certain elements/attributes??

    Hi folks!
    Suppose I have a XML file looking like this:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE dvds SYSTEM "DTDtest.dtd">
    <dvds>
    <dvd>
    <title>
    Aliens
    </title>
    <director>
    James Cameron
    </director>
    <format>
    1.85:1
    </format>
    </dvd>
    <dvd>
    <title>
    X-Men
    </title>
    <director>
    Bryan Singer
    </director>
    <format>
    2.35:1
    </format>
    </dvd>
    </dvds>
    In my Java application I want to read this XML file and print it on the screen (including all tags etc). So far, so good. BUT, if I want to skip certain elements, i.e. all information about the dvd 'X-Men', how am I supposed to do this? In other words, I would like my app to skip reading all information about X-Men and continue with the next <dvd>... </dvd> tag. Is this possible?
    My code so far is from the XML tutorial from Sun and it looks like this:
    import java.io.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.DefaultHandler;
    import javax.xml.parsers.SAXParserFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParser;
    public class MyXML extends DefaultHandler
    public static void main(String argv[]) {
    if (argv.length != 1) {
    System.err.println("Usage: cmd filename");
    System.exit(1);
    // Use an instance of ourselves as the SAX event handler
    DefaultHandler handler = new MyXML();
    // Use the default (non-validating) parser
    SAXParserFactory factory = SAXParserFactory.newInstance();
    try {
    // Set up output stream
    out = new OutputStreamWriter(System.out, "UTF8");
    // Parse the input
    SAXParser saxParser = factory.newSAXParser();
    saxParser.parse( new File(argv[0]), handler);
    } catch (Throwable t) {
    t.printStackTrace();
    System.exit(0);
    static private Writer out;
    //===========================================================
    // SAX DocumentHandler methods
    //===========================================================
    public void startDocument()
    throws SAXException
    emit("<?xml version='1.0' encoding='UTF-8'?>");
    nl();
    public void endDocument()
    throws SAXException
    try {
    nl();
    out.flush();
    } catch (IOException e) {
    throw new SAXException("I/O error", e);
    * <p>This method prints the start elements including attr.
    * @param namespaceURI
    * @param lName
    * @param qName
    * @param attrs
    * @throws SAXException
    public void startElement(String namespaceURI,
    String lName, // local name
    String qName, // qualified name
    Attributes attrs)
    throws SAXException
    String eName = lName; // element name
    if ("".equals(eName)) eName = qName; // namespaceAware = false
    emit("<"+eName);
    if (attrs != null) {
    for (int i = 0; i < attrs.getLength(); i++) {
    String aName = attrs.getLocalName(i); // Attr name
    if ("".equals(aName)) aName = attrs.getQName(i);
    emit(" ");
    emit(aName+"=\""+attrs.getValue(i)+"\"");
    emit(">");
    public void endElement(String namespaceURI,
    String sName, // simple name
    String qName // qualified name
    throws SAXException
    emit("</"+qName+">");
    * <p>This method prints the data between 'tags'
    * @param buf
    * @param offset
    * @param len
    * @throws SAXException
    public void characters(char buf[], int offset, int len)
    throws SAXException
    String s = new String(buf, offset, len);
    emit(s);
    //===========================================================
    // Utility Methods ...
    //===========================================================
    // Wrap I/O exceptions in SAX exceptions, to
    // suit handler signature requirements
    private void emit(String s)
    throws SAXException
    try {
    out.write(s);
    out.flush();
    } catch (IOException e) {
    throw new SAXException("I/O error", e);
    // Start a new line
    private void nl()
    throws SAXException
    String lineEnd = System.getProperty("line.separator");
    try {
    out.write(lineEnd);
    } catch (IOException e) {
    throw new SAXException("I/O error", e);
    Sorry about the long listing... :)
    Best regards
    /Paul

    A possibility that comes to mind is to create an XSLT script to do whatever it is you want - and call it from inside the program. The XSLT script can be stashed inside your .jar file by using getClass().getClassLoader().getResource("...")
    - David

  • Any website for XSLT AND ABAP mapping

    Hi XI experts,
    I am looking for any good website/Material for XSLT and ABAP Mapping with examples.
    So experts if you any one of you have any clue , i would appreciate it , if you post the info here .
    Regds,
    Ram.

    Hi,
    For XSLT mapping, please try to create msg types for sender and recv, import these two into XML Mapforces (This is a software which enables us to do mapping this you can download from altova mapforce site) , do mapping in that mapforce , late click on XSLT icon , one XSLT file will be c reated that file , prepare zip and late come to xi , import under imported archieves,do Interface mapping by selecting the XSLT mapping option, select imported archieve..
    See below examples..
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/01a57f0b-0501-0010-3ca9-d2ea3bb983c1
    http://www.troobloo.com/tech/xslt.toc.shtml
    http://www.w3schools.com/xsl/
    http://www.w3.org/TR/xslt
    http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/frameset.htm
    https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-code-samples/generic%20xslt%20mapping%20in%20sap%20xi%2c%20part%20i.pdf
    /people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping
    Required XSLT Mapping tips!
    Regards
    Chilla..

  • XML XSLT Maping Problem in XI

    Hi,
    I'm actually doing some tests with the possibility to invoke a ABAP-Mapping (ABAP-Class).
    So my scenario is quite simple:
    I have a import xml where I want to substitute exactly one value (database select).
    Now my problem is that the xml comes in with a namespace at the toplevel element (I wrote the complete source string to the trace in my execute function) called "ns0".
    So I stored the output of the trace to a local file for testing and developing a XSLT-Mapping.
    In debugging mode I see that the command:
    <xsl:for-each select="ns0:BAPI_SALESORDER_CREATEFROMDAT2/ORDER_PARTNERS">
    doesn't work as (I) expected (want to loop at the partners) on this content:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:BAPI_SALESORDER_CREATEFROMDAT2 xmlns:ns0="urn:sap-com:document:sap:rfc:functions">
    <ORDER_HEADER_IN>
    <DOC_TYPE>TA</DOC_TYPE>
    <SALES_ORG>1000</SALES_ORG>
    <DISTR_CHAN>10</DISTR_CHAN>
    <DIVISION>00</DIVISION>
    <PURCH_NO_C>654</PURCH_NO_C>
    </ORDER_HEADER_IN><ORDER_ITEMS_IN>
    <item>
    <PO_ITM_NO>10</PO_ITM_NO>
    <MATERIAL>100-100</MATERIAL>
    <TARGET_QTY>100</TARGET_QTY>
    <T_UNIT_ISO>PCE</T_UNIT_ISO>
    </item>
    <item><PO_ITM_NO>20</PO_ITM_NO>
    <MATERIAL>P-100</MATERIAL>
    <TARGET_QTY>100</TARGET_QTY>
    <T_UNIT_ISO>PCE</T_UNIT_ISO>
    </item>
    </ORDER_ITEMS_IN>
    <ORDER_PARTNERS>
    <item>
    <PARTN_ROLE>AG</PARTN_ROLE>
    <PARTN_NUMB>0000001000</PARTN_NUMB>
    </item>
    <item>
    <PARTN_ROLE>WE</PARTN_ROLE>
    <PARTN_NUMB>0000001000</PARTN_NUMB>
    </item>
    </ORDER_PARTNERS>
    </ns0:BAPI_SALESORDER_CREATEFROMDAT2>
    Anyone an idea?
    Thnx
    Olli

    Hi Olli,
    Did you declare the namespace in the XSLT itself?
    Did your write something like?
    <xsl:stylesheet
      exclude-result-prefixes="xsl ns0"
      version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:ns0="urn:sap-com:document:sap:rfc:functions">
    Actually, the prefix is something you can freely choose.  It is not necessary to use the same prefix as in the source document.  You could just as well use the prefix "x" in your XSLT and write:
    <xsl:stylesheet ...
      xmlns:x="urn:sap-com:document:sap:rfc:functions">
      <xsl:for-each select="x:BAPI_SALESORDER_CREATEFROMDAT2/ORDER_PARTNERS">
    Kind regards, Guy Crets

  • HELP: JSP + XML + XSLT = HTML?

    Hello, all.
    I am trying out Weblogic 6 and I am trying to get the JSP + XML + XSLT =>
    HTML chain working.
    I am coming from using Orion and SAXON.. and in that situation I had a JSP
    that contained XML tags... they were filled in at runtime and then using
    Servlet-Chaining was passed along to the SAXON XSLT Processer. SAXON checked
    for the inline XSL specified and then used that to transform the document
    into HTML.
    It worked well, but there were some other features missing/not documented
    that we now need.
    With Weblogic I am trying to use the XSLT Tag Library that comes with the
    distribution, but it seems to be very finicky. I followed the directions and
    I got it to do a sort of roundabout transformation. But it doesn't seem to
    work quite right.
    The best I can get is the following:
    I have an 'xslt' directory url-pattern-mapped to xslt.jsp (as instructed)...
    but can't figure out how to specify the xsl file on-the-fly... that is, if I
    don't hard-code the XSL file in the x:xslt element in the xslt.jsp it
    complains about some XML file not having a root element.
    Ideal situation:
    1. I have a JSP that includes XML elements.
    2. It is filled from a database at runtime and specifys (using a PI) what
    XSL stylesheet it is to be processed with.
    3. Somehow (fingers crossed) the XML is processed and transformed into HTML
    by the appropriate XSL file.
    I think I am mostly stuck moving between steps 2 and 3.
    Can anyone give me some hints? Are there some Weblogic specific
    elements/tags that I have to include in the XML file that Weblogic will
    catch and re-direct to the XSL Parser?
    Please, anyone, if you have some information, I would much appreciate it.
    Dylan Parker
    PS - I apologize for the cross-post, I hope it doesn't cause too much
    traffic.

    Craig,
    I've since discovered how to do it with the WL Taglibrary... and have
    moved on =)
    It has to do with the EXTREMELY BADLY documented x:xml tag that can
    appear within the x:xslt tag body...
    So the WL Tag Library allows something like the following.
    (Please note, angled brackets are omitted in this post to prevent html
    parsing)
    [x:xslt stylesheet="sheet.xsl"]
    [x:xml]
    Here is the XML to run the sheet on.
    This should have all relevant XML syntax: the PIs, the doctype,
    root elements etc...
    [x:xml]
    [x:xslt]
    And that DOES work. But not very well. WL, a little prematurely
    incorporated versions 1.2 of Xerces and Xalan in their product -- and
    these versions have some irritating bugs.
    Also -- There tag library doesn't copy the source XML across as UTF-8
    .. so a lot of the Japanese I have embedded there (from a DB) gets
    mangled somewhere in their code...
    AND -- If you hammer a little bit on an JSP/XML that uses the WL Tag
    Library (eg clicking refresh lots of times in IE)... I get huge
    amounts of irritating exceptions appearing in the log files.
    NullPointerExceptions
    XSL Parsing Exceptions
    XML Parsing Exceptions
    but completely unpredictably...
    In my eyes.. the WL XML/XSL Tag Library using the incorporated and
    untouchable Xalan and Xerces (v1.2) is virtually unusable.
    What a pain.
    BUT! Apache offers a similar OPEN SOURCE XSL Tag Library available
    here:
    http://jakarta.apache.org/taglibs/doc/xsl-doc/intro.html
    And it uses the standard, non-weblogic-incorporated, Xerces and Xalan
    (which means you can provide whatever version you want).. and it works
    impressively well.
    It has almost identical performance as the WL Taglib, and without all
    of the bizarre exceptions being thrown.
    And it does proper passing of the character encoding type!
    If only the taglib did caching though =(
    The performance hit over pure JSP is huge. Almost two orders of
    magnitude. On my desktop box I can get around 500Requests/Sec if I am
    returning HTML direct from a JSP... while if I produce XML that gets
    processed by XSL into HTML the Requests/Sec drops to 5!!!!
    Caching. Caching. And more Caching. A lot of DiskIO is going on with
    the XML/XSL/XHTML chain of events.
    I hope this helps!
    I'd be curious as to what you find out as well.
    Dylan Parker
    On 5 Mar 2001 07:20:00 -0800, "Craig Macha"
    <[email protected]> wrote:
    >
    Yep, I feel Dylan's pain.
    I am trying to accomplish the same thing. A JSP page generating
    dynamic XML content and then utilizing an XSLT stylesheet to transform
    all the content into XHTML.
    Does anyone have some examples that show exactly how to accomplish
    this? Can I do this with WLS and the XML taglib that comes with
    it? Or do I have to move on to something like Cocoon to get this
    capability?
    Any insight would be greatly appreciated.
    Thanks,
    Craig Macha
    "Dylan Parker" <[email protected]> wrote:
    Hello, all.
    I am trying out Weblogic 6 and I am trying to get the
    JSP + XML + XSLT =>
    HTML chain working.
    I am coming from using Orion and SAXON.. and in that situation
    I had a JSP
    that contained XML tags... they were filled in at runtime
    and then using
    Servlet-Chaining was passed along to the SAXON XSLT Processer.
    SAXON checked
    for the inline XSL specified and then used that to transform
    the document
    into HTML.
    It worked well, but there were some other features missing/not
    documented
    that we now need.
    With Weblogic I am trying to use the XSLT Tag Library
    that comes with the
    distribution, but it seems to be very finicky. I followed
    the directions and
    I got it to do a sort of roundabout transformation. But
    it doesn't seem to
    work quite right.
    The best I can get is the following:
    I have an 'xslt' directory url-pattern-mapped to xslt.jsp
    (as instructed)...
    but can't figure out how to specify the xsl file on-the-fly...
    that is, if I
    don't hard-code the XSL file in the x:xslt element in
    the xslt.jsp it
    complains about some XML file not having a root element.
    Ideal situation:
    1. I have a JSP that includes XML elements.
    2. It is filled from a database at runtime and specifys
    (using a PI) what
    XSL stylesheet it is to be processed with.
    3. Somehow (fingers crossed) the XML is processed and
    transformed into HTML
    by the appropriate XSL file.
    I think I am mostly stuck moving between steps 2 and 3.
    Can anyone give me some hints? Are there some Weblogic
    specific
    elements/tags that I have to include in the XML file that
    Weblogic will
    catch and re-direct to the XSL Parser?
    Please, anyone, if you have some information, I would
    much appreciate it.
    Dylan Parker
    PS - I apologize for the cross-post, I hope it doesn't
    cause too much
    traffic.

  • XSLT and Java lookup cache

    Hi,
    I´m trying the "Easy RFC lookup from XSLT mappings using a Java helper class" article and I getting a weird problem.
    The result of the RFC lookup called inside the java class is maintained in a kind of cache and  I always get the same results independent of the parameters I use in the following calls.
    Just after calling a Complete Cache Refresh (SXI_CACHE) I got a new result to the lookup.
    If I call in the Interface Mapping Test option it runs fine. However, when I call it from my scenario (SOAP Adapter Sender) the first result of the lookup will be returned until a forced cache refresh.
    Any ideas?
    Thank you,
    Fabiano.

    Hello Fabiano,
    I had the same problem like you had.
    The main Problem is that with the example code the request variable is created as NodeList object. In XSLT a variable is somekind of a constant and can't be changed. As the request object is empty after the first request the programm fails at the following line:
    Source source = new DOMSource(request.item(0));
    So I've created a workaround for this problem.
    In the call of the template I've put the request as a parameter object at the template call:
    <xsl:with-param name="req">
    <rfc:PLM_EXPLORE_BILL_OF_MATERIAL xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
      <APPLICATION>Z001</APPLICATION>
      <FLAG_NEW_EXPLOSION>X</FLAG_NEW_EXPLOSION>
      <MATERIALNUMBER><xsl:value-of select="value"/></MATERIALNUMBER>
      <PLANT>FSD0</PLANT>
      <VALIDFROM><xsl:value-of select="//Recordset/Row[name='DTM-031']/value"/></VALIDFROM>
      <BOMITEM_DATA/>
    </rfc:PLM_EXPLORE_BILL_OF_MATERIAL>
    </xsl:with-param>
    With this change the request will be provided as a String object and not as a NodeList object.
    Afterwards the RfcLookup.java has to be changed to the following:
    package com.franke.mappings;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.PrintWriter;
    import java.io.StringWriter;
    import java.util.Map;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import com.sap.aii.mapping.lookup.Channel;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import com.sap.aii.mapping.api.AbstractTrace;
    import com.sap.aii.mapping.lookup.RfcAccessor;
    import com.sap.aii.mapping.lookup.LookupService;
    import com.sap.aii.mapping.lookup.XmlPayload;
    * @author Thorsten Nordholm Søbirk, AppliCon A/S
    * Helper class for using the XI Lookup API with XSLT mappings for calling RFCs.
    * The class is generic in that it can be used to call any remote-enabled
    * function module in R/3. Generation of the XML request document and parsing of
    * the XML response is left to the stylesheet, where this can be done in a very
    * natural manner.
    * TD:
    * Changed the class that request is sent as String, because of IndexOutOfBound-exception
    * When sending multiple requests in one XSLT mapping.
    public class RfcLookup {
         * Execute RFC lookup.
         * @param request RFC request - TD: changed to String
         * @param service name of service
         * @param channelName name of communication channel
         * @param inputParam mapping parameters
         * @return Node containing RFC response
         public static Node execute( String request,
                 String service,
                 String channelName,
                 Map inputParam)
              AbstractTrace trace = (AbstractTrace) inputParam.get(StreamTransformationConstants.MAPPING_TRACE);
              Node responseNode = null;
              try {
                  // Get channel and accessor
                  Channel channel = LookupService.getChannel(service, channelName);
                  RfcAccessor accessor = LookupService.getRfcAccessor(channel);
                   // Serialise request NodeList - TD: Not needed anymore as request is String
                   /*TransformerFactory factory = TransformerFactory.newInstance();
                   Transformer transformer = factory.newTransformer();
                   Source source = new DOMSource(request.item(0));
                   ByteArrayOutputStream baos = new ByteArrayOutputStream();
                   StreamResult streamResult = new StreamResult(baos);
                   transformer.transform(source, streamResult);*/
                    // TD: Add xml header and remove linefeeds for the request string
                    request = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+request.replaceAll("[\r\n]+", ""); 
                    // TD: Get byte Array from request String to send afterwards
                    byte[] requestBytes = request.getBytes();
                   // TD: Not used anymore as request is String
                    //byte[] requestBytes = baos.toByteArray();
                    trace.addDebugMessage("RFC Request: " + new String(requestBytes));
                    // Create input stream representing the function module request message
                    InputStream inputStream = new ByteArrayInputStream(requestBytes);
                    // Create XmlPayload
                    XmlPayload requestPayload =LookupService.getXmlPayload(inputStream);
                    // Execute lookup
                    XmlPayload responsePayload = accessor.call(requestPayload);
                    InputStream responseStream = responsePayload.getContent();
                    TeeInputStream tee = new TeeInputStream(responseStream);
                    // Create DOM tree for response
                    DocumentBuilder docBuilder =DocumentBuilderFactory.newInstance().newDocumentBuilder();
                    Document document = docBuilder.parse(tee);
                    trace.addDebugMessage("RFC Response: " + tee.getStringContent());
                    responseNode = document.getFirstChild();
              } catch (Throwable t) {
                   StringWriter sw = new StringWriter();
                   t.printStackTrace(new PrintWriter(sw));
                   trace.addWarning(sw.toString());
              return responseNode;
         * Helper class which collects stream input while reading.
         static class TeeInputStream extends InputStream {
               private ByteArrayOutputStream baos;
               private InputStream wrappedInputStream;
               TeeInputStream(InputStream inputStream) {
                    baos = new ByteArrayOutputStream();
                    wrappedInputStream = inputStream;
               * @return stream content as String
               String getStringContent() {
                    return baos.toString();
              /* (non-Javadoc)
              * @see java.io.InputStream#read()
              public int read() throws IOException {
                   int r = wrappedInputStream.read();
                   baos.write(r);
                   return r;
    Then you need to compile and upload this class and it should work.
    I hope that this helps you.
    Best regards
    Till

  • XSLT and XQuery recommendation for BPEL and OSB

    Hi,
    1. Why is XQuery recommeded for OSB and XSLT for BPEL. Are there any specific performance optimization reason behind this.
    2. Apart from OSB and BPEL, both XSLT and XQuery has xml transformation options and creating HTML. What is the difference between these two.
    Thanks in advance!

    you can create the graphical view of Xquery in Eclipse but not for XSLT
    Xquery is much faster than XSLT in OSB.
    Through XSLT however you can achieve more complex transformation.
    OSB has its historic origins in BEA Aqalogic stable and so Xquery was widely used used even though XSLT is supported. It is a matter of choice(your standards in your organization,your developer skillsets,your re-usable libraries etc )
    In Jdeveloper you can develop xslt in graphical mode though and attain complex transformation

  • XML/XSLT problem

    I'm currently reading info on using XSLT with XML documents ("Java Server Programming" by WROX), but I'm having quite a few problems getting anything to work. Can someone point me to a page/document that simply explains what .jar files to install, where to get them and where to place them to enable parsing XML files and using XSLT? I'm running jdk1.3.1_02.
    Thank You
    Tom Berry

    - download: http://java.sun.com/xml/downloads/javaxmlpack.html
    - install JAXP
    - follow the XSLT tutorial: http://java.sun.com/webservices/docs/1.0/tutorial/doc/JAXPXSLT.html
    - have fun!

  • XML+XSLT Portlet -- feature still in 5x?

    Did you guys take this feature out of the product? In 4.5, you used to be able to create a remote gadget by supplying an XML document and an XSLT stylesheet, the end result being an HTML portlet. Is that possible in 5.0? Customer 1000 wants me to do it and I can't seem to find the feature any more. Thanks, Chris Bucchere

    The feature in no longer in the portal, but has been offloaded to a portlet web service, the XML Transformer portlet. This portlet service runs in a Java application server, and is part of the Optional Web Services installation.

Maybe you are looking for

  • Syncing Multiple Devices and Cals

    We have between us an iMac, iPad, and both of us have an iPhone 4S. We both have a calendar each but can view them both on all devices (we have one each so we know who's event it is). I would like it so when one of us creates an event (mostly on our

  • Windows 7 RC on mid-2007 MBP

    As a part-time Vista Bootcamp user, I was happy to have the opportunity for updating to 7. In preparation, I unpartitioned, then repartitioned, using the Boot Camp Assistant. Using the 32-bit Win 7 build 7100 (RC), I installed Windows with no issue.

  • Getting list of valid elements

    Say I have a Schema or DTD that says that <foo /> can have 1 or more <bar /> elements in it. When parsing through an XML file and I've got a reference to the "foo" node, is there a way to "know" that only "bar" elements can be a firstChild? Or when I

  • How i can load excel sheet into a table in oracle through pl/sql procedure

    Hi, How i can load excel sheet into a table in oracle through pl/sql procedure or a pl/sql block. Excel sheet is saved on my c or d drive on my machine. In xls format.

  • Adding a dummy row in the tabular form

    Hi 'm an ApEX newbie. I'm in need to add a dummy row in between a tabular form to make it more appealing at the user end. A representation of my Tabular Form having 3 columns (i.e Sr No & Skill is of display only format and Remarks column is of text