JavaServlet with XSLT

Hi. Guys
I am trying to develop a web application using javaservlet, this application invokes an XSLT style sheet to transform an XML document. I am getting a mistake that I believe it is concern with the configuration, any one can help please?
Here is how I’m invoking the xslt sttylesheet
try {
curName="/WEB-INF/classes/xslt/transforme.xsl";
URL xsltURL=getServletContext().getResource(curName);
{color:#ff0000} String xsltSystemID=xsltURL.toExternalForm();{color}
this.thanksTemplates=transFact.newTemplates(new StreamSource (xsltSystemID));
The code in red is line number 63
And here is the error message
java.lang.NullPointerException
at Mypackage. TransDoc.doGet(TransDoc.java:63)
in addition, the xslt stylesheet is resided in the correct path. And saxon8.jar is embedded in my classpath.
Many thanks in advance

String xsltSystemID=xsltURL.toExternalForm();The only thing which can be null in this line is xsltURL. So the resource simply doesn't exist. Doublecheck the name and the availability. Hint: classpath covers /WEB-INF/classes, not /.

Similar Messages

  • Possible with XSLT mapping?

    Hi,
    I have source xml structure of format
    <Header fld1 fld2 fld3
    fld4 fld5 fld6  ><line   fld7 fld8 fld9 </line></header>
    Header occurence is 1---unbounded
    and line occurence is 0---unbounded
    and line items can exist or not for some header items.for some headers items can be single or multiple.
    I get xml files on sender side and need to convert to flat files ,so I am using sender file CC on sender and receiver file CC with FCC on the receiver side.
    I am able to get with receiver file FCC ,I know FCC can support two level heirarchies only.
    header1
    header2
    header3
    header n
    line x
    line y
    line z
    line n
    so i dont know to which header values the item values belong to.I need to get
    this structure
    header1....(if no items)
    header2....(let say 2 items)
    linex
    liney
    header3...(no items)
    header4....(one item)
    linez
    header n.....(again no items)
    so I have another Xi guy,he told me that we can achieve this by using a XSLT mapping rather than gaphical mapping which I am using now.
    so can we get the structure what I wanted with XSLT mapping or is it nothing with mapping and it is with adapter?(I think its nothing with mapping)
    I know we may get the required output structure by writing a module program and call that in the receiver file adapter.
    suggestions please.
    thank you,
    regards,
    Babu

    udo,
    sorry if I put in confusion with my structures of both source and target.I am trying to give little eloberate
    I have source  xml data like this.
    <Header1 fld1=1234 fld2="name1" fld3='SAP1"
    fld4='000" fld5=0 fld6="sdn1"</header>...............no line items here
    <Header2 fld1=123 fld2="name" fld3='SAP"
    fld4='00" fld5=0 fld6="sdn" ><line fld7=value1 fld8=value2 fld9=value3 /line><line fld7=value4 fld8=value5 fld9=value6 /line></header>.....two line items here
    <Header3 fld1=123 fld2="name" fld3='SAP"
    fld4='00" fld5=0 fld6="sdn" ><line fld7=value7 fld8=value8 fld9=value9 /line></header>......one line item here
    Header4 fld1=12345 fld2="name2" fld3='SAP2"
    fld4='0006" fld5=01 fld6="sdn2"</header>.......no line items here
    I want target flat file structure like this considering "~" (tild)as delimiter
    1234name1SAP100000~sdn1 ...................> flatfile values for header1(no item values for this header1)
    123nameSAP000~sdn..........................> flat file values for hader2
    value1value2value3...........................>line item values for header2
    value4value5value6...........................>line item values for header2(two line item values for this header2)   
    123nameSAP000~sdn..........................>values for hader3
    value7value8value9...........................>line item values for header3(one item values for this header3)
    12345name2SAP2000601~sdn2..................>values for header4(no item values for this header4)
    ................... like for n header values.

  • Using transform api with xslt and DOM Nodes

    Hi,
    when trying to transform a xml document with xslt using the javax.xml.transform api
    providing an element node of a previously parsed document, I find that absolute
    paths are not recognized.
    The following program shows what I am basically doing (the class can be executed
    on the command line providing a stylesheet and xml instance):
    import java.io.*;
    import org.w3c.dom.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.*;
    import javax.xml.parsers.*;
    class Transform {
    public static void main(String [] args) throws Exception {
         TransformerFactory tfactory = TransformerFactory.newInstance();
         Transformer transformer = tfactory.newTransformer(new StreamSource(args[0]));
         DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
         DocumentBuilder parser = dfactory.newDocumentBuilder();
         Document doc = parser.parse(args[1]);
         Element domElem = doc.getDocumentElement();
         // workaround
    //     StringWriter out = new StringWriter();
    //     Transformer id = tfactory.newTransformer();
    //     id.transform(new DOMSource(domElem),new StreamResult(out));
    //     String xml = out.toString();
    //     transformer.transform(new StreamSource(new StringReader(xml)), new StreamResult(System.out));
         transformer.transform(new DOMSource(domElem), new StreamResult(System.out));
    transformer.clearParameters();
    If I use this on e.g.
    xsl:
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output indent="yes" encoding="ISO-8859-1" method="xml"/>
    <xsl:template match="/">
    <xsl:value-of select="/foo/bar"/>
    </xsl:template>
    </xsl:stylesheet>
    xml:
    <foo>abc<bar>def</bar></foo>
    I get
    <?xml version="1.0" encoding="ISO-8859-1"?>
    abcdef
    instead of
    <?xml version="1.0" encoding="ISO-8859-1"?>
    def
    I think this is due to the fact, that the transformation does not recognize
    any absolutely adressed xpath correctly.
    From what I read in the API docs, I think what I'm doing should be ok.
    So: did I misunderstand something or is this a bug in the java libraries?
    I'm using j2sdk 1.4.1_01 on i386 linux.
    If I use the commented code (serializing the xml and doing the transformation
    with a StreamSource, that has to be parsed again), everything's fine.
    Of course it would be easier to parse the file directly in the example but in the
    real program, I already have a dom tree and want to transform a part of it.
    Any help appreciated.
    Thanks, Morus

    why?
    that's all the point of XSL: define what part of your
    XML you want in your XSL templates, there is no need
    to prepare a sub-DOM of your DOM.
    Ok. Right. That's an alternative.
    The problem remains, that there are some stylesheets originally written
    for the current solution and though they should work with the whole document
    as well, it's not certain.
    Actually I don't know if this ever worked. I did neither write this code nor maintained the system so far.
    btw. you would be faster by giving a StreamSource to
    your transformation.Probably yes. But that would imply to rewrite a lot of code.
    What is happening is:
    there is a SOAP answser containing a xml document as the result parameter.
    The SOAP answer is parsed (I guess by the soap classes already) and the
    result xml is extracted. That's where the element node I'm trying to transform
    stems from.
    Besides, I still don't see why DOMSource takes any node if only document nodes
    work.
    Thanks, Morus

  • Issue with xslt transform

    I'm having a problem with xslt transformations.
    I'm sending a DOMDocument to be transformed into a varchar2. The transformation was into html and I was then printing the returning varchar2 to a web page, along the lines of...
    htp.prn(Xslt.transform(domdoc, xslt.stylesheet( l_stylesheet_bfile)));
    I subsequently broke the varchar2 32k limit so I started playing with transforming into a dom instead of a varchar, then writing the dom to a clob and the printing the clob to the web page in 32k chunks.
    I noticed this produced different results than the first method. Now I'm assuming that this is not because xslt is doing the transformations differently but because it's trying to put my html into a well-formed DOMdocument. I have noticed, though, that things like & #160; seemed to have disappeared.
    Just wondering if I'm doing something wrong, and also any reason why the transform functionality doesn't have an output option of CLOB?
    Thanks
    Jason

    What is the DB version?

  • Using Starts-with XSLT function with XI

    Hi All,
    Any help is apperciated. I am using the starts-with xslt function and when i do so the message gets stucks in the queue. If i run code without the starts-with then is works??
    <xsl:for-each select="receipt/prod">
         <xsl:for-each select="carrier/carrier_detail/carrier">
               <xsl:choose>
                   <xsl:when test="carrier_type='CASE'">
                        <xsl:choose>
                             <xsl:when test="starts-with(carrier_barcode, '00')">
                                                   do something
                                            </xsl:when>
                                           <otherwise>
                                                 do something
                                           </otherwise>
    so on..
    when i try to process messsage using this xslt format it gets sysfail in the queue, but without it, it works fine.
    I need to a special format if the condition of barcode starts with 00

    Chirag,
    Create xslt on abap mapping using transaction SXLT_TOOL on XI abap stack. Copy paste same xslt code and run with test file. You can debug code or most likely you can see error message too.
    Actually your mapping raising an exception which result in sys-fail.
    Hope this will help.
    Nilesh

  • Problem with portlets with XSLT generating dynamic portal compatible links

    Hi,
    We're using XSLT to transform XML data to HTML in a portlet. The problem is that
    the XML contains headlines and we need to create links to the complete article,
    which has to be displayed in the same portlet. How do I create a portal comaptible
    link with XSLT? In the JSP you can use the netui tag library like:
    <netui:anchor action="..">
    link
    <netui:parameter name="id" value="{id}"/>
    </netui:anchor>
    but how can I achieve this with XSLT? We tried generating the xsl with a jsp,
    but this doesn't work since the data entered in the value attribute of the netui:parameter
    tag will be encoded causing the XSL transformer to fail.
    Is there an easy solution to this? Or can XSLT only be used with very simple content?
    Ard

    We're trying to display some news headlines, clicking a headline has to invoke
    an action to display the complete article in the same portlet (using pageflow).
    When displaying the articles we use XSLT like (this is a JSP generating XSLT):
    <?xml version="1.0"?>
    <%@ page contentType="text/x-xslt"%>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html"/>
    <xsl:template match="items">
    <xsl:apply-templates select="item"/>
    </xsl:template>
    <xsl:template match="item">
    <nobr>
    <%-- ###### Here we need an action link, with the title as a request parameter
    ###### --%>
    <xsl:value-of select="@title"/>
    </nobr>
    </xsl:template>
    </xsl:stylesheet>
    The XML is like:
    <items>
    <item title="some title"/>
    <item title="some other title"/>
    </items>
    We need to generate a portal compatible link which invokes an action (show_details)
    with the title of the article as a request parameter.
    I know how to do this in a JSP, but since the data is in XML we like to do this
    with XSLT.
    Can you help?
    Subbu Allamaraju <subbuATBeaDOTCom> wrote:
    Could you elaborate (perhaps with some xsl snippet generated by jsp)
    the
    failures you were getting with xslt?
    Subbu
    Ard van der Scheer wrote:
    Hi,
    We're using XSLT to transform XML data to HTML in a portlet. The problemis that
    the XML contains headlines and we need to create links to the completearticle,
    which has to be displayed in the same portlet. How do I create a portalcomaptible
    link with XSLT? In the JSP you can use the netui tag library like:
    <netui:anchor action="..">
    link
    <netui:parameter name="id" value="{id}"/>
    </netui:anchor>
    but how can I achieve this with XSLT? We tried generating the xsl witha jsp,
    but this doesn't work since the data entered in the value attributeof the netui:parameter
    tag will be encoded causing the XSL transformer to fail.
    Is there an easy solution to this? Or can XSLT only be used with verysimple content?
    Ard

  • Change a attribute value with XSLT before importing an XML

    I need change the attribute value with XSLT before importing an XML
    <table class="x" style="width="50pt">...
    I have to divide by 200 the value of "width", and the result multiplied by 100:
    (50/200) * 100
    It's possible with a XLST?

    Hi,
    Yes you can do this via XSLT.
    You can try similar to the one below:
    <table>
       <xsl:attribute name="width">
         <xsl:value-of select="((./width) div 200)*(100)" />
       </xsl:attribute>
    </table>
    I have not tested yet... Try it....
    Green4ever
    (I am back after long time)....

  • Unable to refer to custom resource bundle in WPC content rendered with xslt

    Hi,
    I need to use the resource bundle messages inside WPC content.
    When rendered by standard xsl templates the  call to XSLTHelper class is done to retrieve message from the standard SAP resource bundle com.sap.nw.wpc.bundles.core.properties, like this:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                         xmlns:wpc="com.sap.nw.wpc.km.service.editor.hslt.XsltHelperCore">
    <xsl:value-of select="wpc:getString([key defined in sap bundle], string(/document/@locale))"/>
    The problem is that helper class doesn't provide any API to use custom bundles.
    I tried to create xslt helper (including config in KM), but that didn't succeed neither. It would return with error NoClassDefFound.
    Could you please help on configuring xslt helper and registering it with xslt rendering engine for Web Page Composer? I could not find any how-to guides on xslt helpers for WPC.
    Thanks in advance.
    Ruslan

    Hi
    Did you find a solution?
    Christof

  • Target XML attribute with XSLT

    Hello,<br />I have an xml file which looks like this:<br /><br /><PRODUCTS><br /><PRODUCT><br /><IMAGE href="file://./0001.tif"></IMAGE><br /></PRODUCT><br /><PRODUCT><br /><PRODUCTS><br /><br />Is there a way to target the href attribute of the PRODUCT element with XSLT?<br /><br />Thanks

    hi marco,
    > Thank you gregor, I'll take a look to this reference; I'm total newby to
    > XSLT, so any suggestions would be surely fine.. another question: do you
    > think it's better to work with XSLT or XmlRules?
    there is no short answer on this. it depends on your documents/data you
    want to process, what to achieve and you're knowledge in scripting vs.
    xslt. i use xmlRules for styling my documents, xslt for data transformation.
    in general you've got more control, especially over the rendered
    document, using xmlRules. if you want to process layout rules/guidelines
    in dependency of the actual document you have to render it first.
    complex data transformation and composition is better with xslt outside
    of indesign. i prefer to prepare my data (select relevant data,
    numbering, ...) with xslt.
    cheers,
    gregor

  • "Unwrap" CDATA with XSLT

    Hi,
    I know this isn't necessarily a FrameMaker question, but it is a place where I know people. So forgive me for asking it here.
    I have some CDATA sections in an XML file that contain markup that I want to be parsed eventually, and I want to be able to extract it with the markup intact. Can I do this with XSLT, or does the nature of CDATA negate the use of retrieving the markup with an XML-parser-dependent technology?
    Here's a sample element (element tags replaced with curly braces)
    {documentation}{![CDATA[{p}Some text{/p}]]}{/documentation}
    Is there any way I can get that p element out of there with XSLT, without excaping any of the characters, so it is parsable markup in the output?
    [{p}Some text{/p}
    Thanks,
    Russ

    Russ,
    Two XSLT 1.0 attributes that might allow you to accomplish what you want are:
    <xsl:output cdata-section-elements="documentation">
    This XSLT element tells the XSLT processor to always output text nodes within documentation elements as CDATA sections. Hence, with this
    <xsl:output> element and the template:
    <xsl:template match="documentation">
      <xsl:copy>
        <xsl:apply-templates/>
      </xsl:copy>
    </xsl:template
    your original example would be output as itself:
    <documentation><![CDATA[<p>Some text</p>]]></documentation>
    It gets more complicated if you want to illustrate CDATA sections in your documentation element.
    <xsl:value-of disable-output-escaping="yes">
    tells the processor to output those special characters that are interpreted by an XML parser as themselves instead of as one of the XML representations of those characters. Thus, you can try:
    <xsl:template match="documentation">
      <xsl:copy>
        <xsl:value-of disable-output-escaping="yes" select="."/>
      </xsl:copy>
    </xsl:template
    --Lynne

  • Can SAX be used with XSLT

    I'm having Java memory problems with 8.1.7 when using a large
    XML file and creating a XML DOM. One solution I may have found
    is to use SAX which will create seperate trees for each
    ROWSET/ROW instead of building the entire tree in memory like
    DOM. But I can't figure out how to use SAX with XSLT. I want
    each record written to the same text file using a XSLT
    template. Anyone know how to do this?

    The solution can be found in the XMLLoader application written
    by Steven Muench, in his book "Building Oracle XML
    Applications". It is also somewhere online under the book's
    O'Reilly pages but I don't have the exact URL.
    The solution is basically that the SAX model is used to parse
    the large file and build a DOM tree as each node is
    encountered. When the SAX model detects the closing tag of a
    subdocument (probably what would be in your <ROWSET></ROWSET>
    tags) then the current DOM tree is used to perform the proper
    database operation. Then the SAX parser goes on with life until
    it finds the next complete subdocument, etc. Pretty slick.
    XMLLoader takes as an argument, the stylesheet you want to apply
    to the data, so you can transform your XML data into something
    that now has the Oracle canonical format on the fly.
    There are numerous posts in this newsgroup regarding XMLLoader,
    and Muench regularly answers questions here as well.
    Good luck!
    Mike

  • Any way to generate a single quote (') with XSLT?

    Hi:
    I guess this is really an XSLT question. I'm using the Transform() method of an XMLType variable to apply a style sheet. The XML in the variable is just something simple like
    <TBL>
    <LAST_NAME>LIKE|JONES</LAST_NAME>
    <FIRST_NAME>=|MARY</FIRST_NAME>
    <AGE>=|50</AGE>
    </TBL>
    I am trying to get a stylesheet to transform something like the above into SQL such as
    Select * from foo where LAST_NAME like 'JONES'
    and FIRST_NAME ='MARY'
    and AGE = 50But to do this, I need to generate the single quotes around the search terms and I can't get anything but LAST_NAME LIKE &apos;JONES&apos;. Is there a way to do this? For now I am generating a ~ and replacing ~ for ' throughout the generated SQL text but that's a pretty sorry solution.
    I thought that something like <xsl:text disable-output-escaping="yes">&amp;</xsl:text> was going to work but then found out it has been deprecated. I was thinking character-map might work but that's an XSLT 2.0 thing and apparently 10g is on XSLT 1.0? In any case, it had no idea what I was trying to do with a character map.
    So, am I overlooking an obvious way to get my stylesheet to insert apostrophes?
    Thanks.

    It's 10.2.0.4.
    Here's the procedure that accepts the XML/XSL clobs and tries to produce a SQL statement.
    PROCEDURE GetSQLQueryFromXML(XMLClob in CLOB, XSLStylesheet in CLOB,
                SQLQuery out CLOB, status out integer) IS
        -- Define the local variables
      xmldata               XMLType;  -- The XMLType format of the XML to transform
      xsldata               XMLType;  -- The XMLType format of the stylesheet to apply
      sqlQuery_XMLType      XMLType;  -- The XMLType format of the SQL query.
      v_SQLQuery            Clob;     -- Holds XML Clob before translating ~ to '
    BEGIN
    status := -1;  -- Initially unsuccessful
      -- Get the XML document using the getXML() function defined in the database.
      -- Since XMLType.transform() method takes XML data as XMLType instance,
      -- use the XMLType.createXML method to convert the XML content received
      -- as CLOB into an XMLType instance.
      xmldata := XMLType.createXML(XMLClob);
      -- Get the XSL Stylesheet using the getXSL() function defined in the database.
      -- Since XMLType.transform() method takes an XSL stylesheet as XMLType instance,
      -- use the XMLType.createXML method to convert the XSL content received as CLOB
      -- into an XMLType instance.
      xsldata := XMLType.createXML(XSLStylesheet);
      -- Use the XMLtype.transform() function to get the transformed XML instance.
      -- This function applies the stylesheet to the XML document and returns a transformed
      -- XML instance.
      sqlQuery_XMLType := xmldata.transform(xsldata);
      -- Return the transformed XML instance as a CLOB value.   
      v_SQLQuery := sqlQuery_XMLType.getClobVal();
      -- Change tildas to apostrophes.  Currently unable to get an XSLT transformation
      -- to insert single quotes, so we're inserting ~ instead.  Now we need to
      -- translate all ~s to 's in our query.
      SQLQuery := translate(to_char(v_SQLQuery),'~','''');
      status := 1; -- Everything went fine to get here
    EXCEPTION
      WHEN OTHERS THEN         
        raise_application_error
        (-20102, 'Exception occurred in GetSQLQueryFromXML :'||SQLERRM);
    END GetSQLQueryFromXML;The XML it works off of is
        someXML CLOB :=
        to_clob('<?xml version="1.0" encoding="windows-1252" ?>
    <variable table_name="SOME_PERSON_TABLE" query_type="PERSON">
      <item>
        <fieldName><![CDATA[PERSON_KEY]]></fieldName>
        <criteria><![CDATA[=]]></criteria>
        <fieldType><![CDATA[Integer]]></fieldType>
        <value><![CDATA[123456789]]></value>
      </item>
      <item>
        <fieldName><![CDATA[LAST_NAME]]></fieldName>
        <criteria><![CDATA[=]]></criteria>
        <fieldType><![CDATA[String]]></fieldType>
        <value><![CDATA[DOE]]></value>
      </item>
      <item>
        <fieldName><![CDATA[FIRST_NAME]]></fieldName>
        <criteria><![CDATA[=]]></criteria>
        <fieldType><![CDATA[String]]></fieldType>
        <value><![CDATA[JOHN]]></value>
      </item>
      <item>
        <fieldName><![CDATA[MIDDLE_NAME]]></fieldName>
        <criteria><![CDATA[-]]></criteria>
        <fieldType><![CDATA[String]]></fieldType>
        <value />
      </item>
      <item>
        <fieldName><![CDATA[SUFFIX]]></fieldName>
        <criteria><![CDATA[-]]></criteria>
        <fieldType><![CDATA[String]]></fieldType>
        <value />
      </item>
    </variable>');And the corresponding XSLT that should translate it is:
      myStylesheet  CLOB :=
      to_clob('<?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <!-- <xsl:preserve-space elements="list-of-element-names"/> -->
      <!-- We just want the SQL text output.  No XML declaration etc. -->
      <xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
    <!-- Apostrophes will be made tildas and the PL/SQL will translate those to -->
    <!-- apostrophes for the final SQL string. -->
    <xsl:variable name="apos">~</xsl:variable>
      <xsl:template match="/">
        select * from
        <xsl:value-of select="variable/@table_name"/>
        where 1=1
        <xsl:for-each select="variable/child::node()">
          <xsl:choose>
            <!-- if the value node is not null... -->
            <xsl:when test="./value/text()[normalize-space(.)]">
            <!-- There is another predicate.  Add the AND term and the predicate -->
              AND <xsl:value-of select="./fieldName"/>
              <xsl:text> </xsl:text>
              <xsl:value-of select="./criteria"/>
              <xsl:text> </xsl:text>       
              <xsl:choose>
                <xsl:when test="string(./fieldType)=''String''">
                  <xsl:copy-of select="$apos" />
                  <xsl:value-of select="./value"/>
                  <xsl:copy-of select="$apos" />
                </xsl:when>         
                <xsl:when test="string(./fieldType)=''Clob''">
                  <xsl:copy-of select="$apos" />
                  <xsl:value-of select="./value"/>
                  <xsl:copy-of select="$apos" />
                </xsl:when>
                <xsl:otherwise>
                  <xsl:value-of select="./value"/>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:when>
          </xsl:choose>
        </xsl:for-each>
      </xsl:template>
    </xsl:stylesheet>');Basically if the VALUE element has a value then the fieldType is checked. If fieldType is String or Clob then we'll need the apostrophes. For now I'm putting in tildas and changing them later.

  • Need Help with XSLT Mapping....

    My scenario is synchronous scenario. SAP(Proxy) to XI to WebServer(SOAP)
    The response is coming back in asingle ANY field and so I guess I need XSLT Mapping to map it to the response message going  backto SAP.
    The response sent by webserver is of the structure:
    <?xml version="1.0" encoding="UTF-8"?>
    <GetStudentsExResponse xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/LMSWebSvc/LMS_Interface">
       <GetStudentsExResult>
          <Courses xmlns="">
             <Warnings/>
             <Course CourseName="Requal RWT with Instructional Blocks TEST" CourseId="1325">
                <Student LastName="LMSTest" FirstName="A" SSN="112345678" LoginID="lms123456a" CompanyName="LMS Test" CourseStatus="P" CourseStatusDate="03/14/2007 09:24:36" CourseScore="90">
                   <Lesson LessonCode="1915" LessonName="RWT Part 1"/>
                   <Lesson LessonCode="1916" LessonName="RWT Part 2"/>
                   <Lesson LessonCode="1917" LessonName="RWT Requal Exam" LessonStatus="p" LessonStatusDate="03/14/2007 09:24:36" LessonScore="90" ProctorID="1" ProctorName="Account Default">
                      <ExamInteractions QuesNum="17758" StudentResp="D" CorrectResp="D" Judged="c"/>
                      <ExamInteractions QuesNum="17769" StudentResp="B" CorrectResp="C" Judged="w"/>
                      <ExamInteractions QuesNum="8465" StudentResp="A" CorrectResp="A" Judged="c"/>
                      <ExamInteractions QuesNum="8471" StudentResp="A" CorrectResp="A" Judged="c"/>
                      <ExamInteractions QuesNum="8496" StudentResp="C" CorrectResp="C" Judged="c"/>
                      </Lesson>
                </Student>          
             </Course>
          </Courses>
       </GetStudentsExResult>
    </GetStudentsExResponse>
    The Structure that I need to map this to is:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Course_Response_MT xmlns:ns0="urn:sce-com:xi:fi:goyala">
       <GetStudentsExResponse>
          <GetStudentsExResult>
             <Courses>
                <Course>
                   <CourseName/>
                   <CourseID/>
                   <Student>
                      <LastName/>
                      <FirstName/>
                      <SSN/>
                      <LoginID/>
                      <CourseStatus/>
                      <CourseStatusDate/>
                      <CourseScore/>
                      <Lesson>
                         <LessonCode/>
                         <LessonName/>
                         <LessonStatus/>
                         <LessonStatusDate/>
                         <ExamInteractions>
                            <QuesNum/>
                            <StudentResp/>
                            <CorrectResp/>
                            <Judged/>
                         </ExamInteractions>
                      </Lesson>
                   </Student>
                </Course>
             </Courses>
          </GetStudentsExResult>
       </GetStudentsExResponse>
    </ns0:Course_Response_MT>
    and  the xslt mapping that I have written for this is:
    <?xml version='1.0' encoding='utf-8' ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="urn:sce-com:xi:fi:goyala" xmlns:DateUtils="com.sce.hcm.xi.util.DateUtils">
         <xsl:template match="/">
              <a:Course_Response_MT>
                   <GetStudentsExResponse>
                        <GetStudentsExResult>
                             <Courses>
                                  <CourseName>
                                       <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course[@CourseName]"/>
                                       <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course[@CourseID]"/>
                                       <Student>
                                            <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student[@LastName]"/>
                                            <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student[@FirstName]"/>
                                            <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student[@SSN]"/>
                                            <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student[@LoginID]"/>
                                            <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student[@CourseStatus]"/>
                                            <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student[@CourseStatusDate]"/>
                                            <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student[@CourseScore]"/>
                                            <Lesson>
                                                 <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/Lesson[@LessonCode]"/>
                                                 <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/Lesson[@LessonName]"/>
                                                 <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/Lesson[@LessonStatus]"/>
                                                 <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/Lesson[@LessonStatusDate]"/>
                                                 <ExamInteractions>
                                                             <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/Lesson/ExamInteractions[@QuesNum]"/>
                                                             <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/Lesson/ExamInteractions[@StudentResp]"/>
                                                             <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/Lesson/ExamInteractions[@CorrectResp]"/>
                                                                   <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/Lesson/ExamInteractions[@Judged]"/>
                                                 </ExamInteractions>
                                            </Lesson>
                                       </Student>                                   
                                  </CourseName>
                             </Courses>
                        </GetStudentsExResult>
                   </GetStudentsExResponse>                                        
              </a:Course_Response_MT>
         </xsl:template>
    </xsl:stylesheet>
    But This mapping is not working...  I am getting errors...
    Pls advice, this is urgent..
    Regards,
    XIer
    Edited by: XIer on Apr 25, 2008 12:23 PM
    Edited by: XIer on Apr 25, 2008 12:37 PM
    Edited by: XIer on Apr 25, 2008 12:37 PM

    Hi All,
              I have now modified my XSLT Mapping as :
    <?xml version='1.0' encoding='utf-8' ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="urn:sce-com:xi:fi:goyala" xmlns:DateUtils="com.sce.hcm.xi.util.DateUtils">
         <xsl:template match="/">
              <a:Course_Response_MT>
                   <GetStudentsExResponse>
                   <xsl:value-of select="a:GetStudentsExResponse"/>
                        <GetStudentsExResult>
                        <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult"/>
                             <Courses>
                             <xsl:for-each select="a:GetStudentsExResponse/GetStudentsExResult/Courses">
                                  <Course>
                                   <CourseName>
                                       <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/@CourseName"/>
                                       </CourseName>
                                       <CourseID>
                                       <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/@CourseID"/>
                                       </CourseID>
                                       <xsl:for-each select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student">
                                       <Student>
                                       <LastName>
                                            <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/@LastName"/></LastName>
                                       <FirstName>     <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/@FirstName"/></FirstName>
                                            <SSN><xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/@SSN"/></SSN>
                                            <LoginID><xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/@LoginID"/></LoginID>
                                            <CourseStatus><xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/@CourseStatus"/></CourseStatus>
                                            <CourseStatusDate><xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/@CourseStatusDate"/></CourseStatusDate>
                                            <CourseScore><xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/@CourseScore"/></CourseScore>
                                            <xsl:for-each select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/Lesson">
                                            <Lesson>
                                                 <LessonCode><xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/Lesson/@LessonCode"/></LessonCode>
                                                 <LessonName><xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/Lesson/@LessonName"/></LessonName>
                                                 <LessonStatus><xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/Lesson/@LessonStatus"/></LessonStatus>
                                                 <LessonStatusDate><xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/Lesson/@LessonStatusDate"/></LessonStatusDate>
                                                 <ExamInteractions>
                                                      <QuesNum>       <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/Lesson/ExamInteractions/@QuesNum"/></QuesNum>
                                                      <StudentResp>       <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/Lesson/ExamInteractions/@StudentResp"/></StudentResp>
                                                      <CorrectResp>       <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/Lesson/ExamInteractions/@CorrectResp"/></CorrectResp>
                                                         <Judged>          <xsl:value-of select="a:GetStudentsExResponse/GetStudentsExResult/Courses/Course/Student/Lesson/ExamInteractions/@Judged"/></Judged>
                                                 </ExamInteractions>
                                            </Lesson>
                                            </xsl:for-each>
                                       </Student>                                   
                                  </xsl:for-each>
                                  </Course>
                                  </xsl:for-each>
                             </Courses>
                        </GetStudentsExResult>
                   </GetStudentsExResponse>                                        
              </a:Course_Response_MT>
         </xsl:template>
    </xsl:stylesheet>     
    However when i execute this mapping in IR, I get empty tags at the target side:
    <?xml version="1.0" encoding="UTF-8"?>
    <a:Course_Response_MT xmlns:a="urn:sce-com:xi:fi:goyala"><GetStudentsExResponse><GetStudentsExResult><Courses/></GetStudentsExResult></GetStudentsExResponse></a:Course_Response_MT>
    Please Advice....
    Regards,
    XIer

  • Problem in using DOMAdapter with xslt

    I have created one .xslt file for transforming one XML to another XML. I am using api's like xerces-2_7_1,xalan-j_2_7_1 from Apache.
    In side my xslt I have taken variable(for sample) like:
    <xsl:variable name="MyVar">
      <Nodes>
        <Node>
          <xsl:attribute name="type">TypeOne</xsl:attribute>
          <Value>This is first node.</Value>
         </Node>
         <Node>
           <xsl:attribute name="type">TypeTwo</xsl:attribute>
           <Value>This is second node.</Value>
         </Node>
         <Node>
           <xsl:attribute name="type">TypeThree</xsl:attribute>
           <Value>This is Third node.</Value>
         </Node>
      </Nodes>
    </xsl:variable>
    <xsl:for-each select="myextension:testMethod ($MyVar)">
         <!-- My Code on selected object.-->
    </xsl:for-each>I want to access this variable in my XSLTExtension class which is a simple java class. I have called method of this class with select="myextension:testMethod ($MyVar)" above.
    I am getting variable in XSLTExtension file and even got all values of it.
    I written code in java file like:
    import com.sun.org.apache.xalan.internal.xsltc.dom.DOMAdapter;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    public static DOMAdapter testMethod (Object adapter){
            DOMAdapter domAdapter = (DOMAdapter) adapter;
            Node nodes = domAdapter.makeNode (domAdapter.getIterator ());
            NodeList list = nodes.getChildNodes ();
                   Code for getting values form NodeList which is quite simple.
                   Processing those values with my business logic and
                   creating new Document to be returned as DOMAdapter.
    }As I mentioned in method I want to return DOMAdapter from method to calling XSLT file. How can I do this?
    if any one have any Idea then please tell me. Any comment regarding this will help me.
    Thanks in Advance,
    TYPurohit.

    Since you said it works fine with an Orange SIM card, it sounds more like it's a network issue than a handset issue. I'd give T-Mobile a call and see what they can do for you - Your SIM may have call barring setup.
    Aubs
    Aubs

  • JDBC to Mail scenario with XSLT mapping

    Hi all,
    I am working on JDBC to Mail scenario. We have to pick the data from Oracle system and mail has to be sent with an attached Excel file.
    I am doing this scenario by using of following blog.
    eMail Report as Attachment (Excel/Word)
    I am getting the output as an attachment but iam not getting the data.
    the same xslt coding iam using which has given in blog.
    any idea........
    Thanks,
    Sreedhar Goud.

    Hi Gaurav,
    JDBC is picking the data.In SXMB_MONI outbound payload iam able to see the data but in inbound payload there is no data.i think the problem is in XSLT code only.
    My source structure:
      <?xml version="1.0" encoding="utf-8" ?>
      <ns:MT_ORMS_Errors xmlns:ns="http://mg.adityabirla.com/mg/orms/mail">
        <row>
            <INTERFACE_NAME>MG_SAP_RMS_ITEM_PKG</INTERFACE_NAME>
            <RECORD_DETAIL>Item</RECORD_DETAIL>
            <ERROR>item</ERROR>
            <CREATE_DATE>2008-11-03 00:00:00.0</CREATE_DATE>
            <MAIL_SENT>N</MAIL_SENT>
        </row>
      </ns:MT_ORMS_Errors>
    XSLT code:
    <?xml version='1.0'?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
      <xsl:variable name="break">&lt;br&gt;</xsl:variable>
      <xsl:variable name="tableB">&lt;table&gt;</xsl:variable>
      <xsl:variable name="tableE">&lt;/table&gt;</xsl:variable>
      <xsl:variable name="trB">&lt;tr&gt;</xsl:variable>
      <xsl:variable name="trE">&lt;/tr&gt;</xsl:variable>
      <xsl:variable name="tdB">&lt;td&gt;</xsl:variable>
      <xsl:variable name="tdE">&lt;/td&gt;</xsl:variable>
      <xsl:variable name="nbsp">&amp;nbsp;</xsl:variable>
      <xsl:variable name="thB">&lt;tr BGCOLOR="#CCCC99"&gt;</xsl:variable>
      <xsl:template match="/">
       <ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">
        <Subject>Deliveries from XI</Subject>
        <From></From>
        <To></To>
        <Content_Type>application/vnd.ms-excel</Content_Type>
        <Content>
         <xsl:text xsl:space="preserve">These deliveries has been completed:</xsl:text>
         <xsl:value-of select="$break"/>
         <xsl:value-of select="$break"/>
         <xsl:value-of select="$tableB"/>
         <xsl:value-of select="$thB"/>
         <xsl:value-of select="$tdB"/>
         <xsl:text xsl:space="preserve">INTERFACE_NAME</xsl:text>
         <xsl:value-of select="$nbsp"/>
         <xsl:value-of select="$tdE"/>
         <xsl:value-of select="$tdB"/>
         <xsl:text xsl:space="preserve">RECORD_DETAIL</xsl:text>
         <xsl:value-of select="$nbsp"/>
         <xsl:value-of select="$tdE"/>
         <xsl:value-of select="$tdB"/>
         <xsl:text xsl:space="preserve">ERROR</xsl:text>
         <xsl:value-of select="$nbsp"/>
         <xsl:value-of select="$tdE"/>
         <xsl:value-of select="$tdB"/>
         <xsl:text xsl:space="preserve">CREATE_DATE</xsl:text>
         <xsl:value-of select="$nbsp"/>
         <xsl:value-of select="$tdE"/>
         <xsl:value-of select="$trE"/>
        <xsl:for-each select="MT_ORMS_Errors/row">
          <xsl:value-of select="$trB"/>
          <xsl:value-of select="$tdB"/>
          <xsl:value-of select="INTERFACE_NAME"/>
          <xsl:value-of select="$nbsp"/>
          <xsl:value-of select="$tdE"/>
          <xsl:value-of select="$tdB"/>
          <xsl:value-of select="RECORD_DETAIL"/>
          <xsl:value-of select="$nbsp"/>
          <xsl:value-of select="$tdE"/>
          <xsl:value-of select="$tdB"/>
          <xsl:value-of select="ERROR"/>
          <xsl:value-of select="$nbsp"/>
          <xsl:value-of select="$tdE"/>
          <xsl:value-of select="$tdB"/>
          <xsl:value-of select="CREATE_DATE"/>
          <xsl:value-of select="$nbsp"/>
          <xsl:value-of select="$tdE"/>
          <xsl:value-of select="$trE"/>
         </xsl:for-each>
         <xsl:value-of select="$tableE"/>
        </Content>
       </ns1:Mail>
      </xsl:template>
    </xsl:stylesheet>
    Thanks,
    Sreedhar Goud.

Maybe you are looking for

  • Error in using a variable in filter condition in an Interface

    Hi All, I am using a variable in my interface in a filter condition. I have an EMP table of scott schema and want to pull all the records wiht hiredate date lying between 2 dates, incremental pull.For this I have created 2 variables and using them in

  • I have a error code 301 on black screen how do i resolve this problem

    Have a problem with my hard drive wont down load chipset driver have a code 301

  • Purchased movie on ATV and it will not transfer to iTunes computer

    A few days ago I purchased "The Blind Side" on my ATV. Watched it no problems. Recently I did however notice that my itunes was downloading the extras content. When I went to look for the movie in the library the only thing there was the extras. I lo

  • Image in table dynamically , How?

    Hi Experts I have some requirement to display different image in table based on value attributes. I would be thankfull if some one can help me how to do this programically.I promise to sward points. Thank you Maruti

  • Sales Order Upload

    Hi, I need to upload sales orders from MS-excel spread-sheets. The upload process has to take place in Production once the system is live. LSMW does not seem to be a good option here as the user is going to run this upload process after go-live. We d