TransformerException

I have the following method with transforms my XML using an XSLT file. I get an javax.xml.transform.TransformException: java.lang.nullPointerException on the line
transformer = tFactory.newTransformer(xsltSource);
I know that it is finding my xslt file okay and can read it as I test this using the File.canRead() method. Any ideas on why I am getting this exception?
public void outputXSL(PrintWriter out) {
Document document = createXMLDocument();
// Make the input sources for the XML and XSLT documents
Source xmlSource = new DOMSource(document);
// XSL input, check file can be read
File file = new File("c:\\ServletsWorking\\MS.xsl");
System.out.println("Read from File: " + file.canRead());
StreamSource xsltSource = new StreamSource(file);
// output response to printwriter of HTTPResponse object
StreamResult xmlResult = new StreamResult(out);
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = null;
try {
//Get a XSLT transformer
transformer = tFactory.newTransformer(xsltSource);
} catch(TransformerConfigurationException e) {
e.printStackTrace();
try{
transformer.transform(xmlSource, xmlResult);
} catch(TransformerException e) {
e.printStackTrace();
}

Your code seems to be correct and it should work. But the way canRead() is used is more related to the IO accesability than not to the security constrains. I mean, you get true because there are not security restrictions, not because it is physically possible to read. Did you try to read from a file that is unconditionally unused?
Also try checking xsltSource:
if(xsltSource != null)
  try {
    //Get a XSLT transformer
    transformer = tFactory.newTransformer(xsltSource);
  } catch(TransformerConfigurationException e) {
    e.printStackTrace();
  }I'm not sure if my english is good enough, so if you don't understand my answer, excuse me.

Similar Messages

  • XSLT - getting inner exception from TransformerException

    Hi,
    Iam using JAXP to perform XSLT transformation from java. When the stylesheet contains an error, the Transformer throws a TransformerException and TransformerConfigurationException. How to retrieve the exact error that occurred and the line number information from these exceptions.
    Any help is appreciated.
    cheers,
    vidyut

    It should be sufficient to call getMessage(), not getException().getMessage() as there probably isn't a wrapped exception. But what about getLocator() and getLocationAsString()? Looks to me as if the line number information should be there.

  • TransformerException -- possible bug in weblogic.apache.xalan.transformer.TransformerImpl

    Using WebLogic Server 6.1 SP2. Am using xslt to transform xml into html. After
    repeatedly
    using the same Transformer object to transform different xml documents, the Transformer
    eventually becomes corrupt – sometimes after 20 or so transforms, sometimes only
    after
    thousands.
    Once the Transformer object becomes corrupt, any additional attempt to call the
    transform
    method results in the following exception:
    =============================
    javax.xml.transform.TransformerException: -1
    at weblogic.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1248)
    at weblogic.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:483)
    at weblogic.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1153)
    at … <snip>
    Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
    at weblogic.apache.xml.utils.NodeVector.popQuick(NodeVector.java:247)
    at weblogic.apache.xpath.XPathContext.popCurrentNode(XPathContext.java:552)
    at weblogic.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2100)
    at weblogic.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1225)
    at … <snip>
    =============================
    Using cavaj to decompile weblogic.apache.xalan.transformer.TransformerImpl yields:
    Method: applyTemplateToNode:
    try
    pushElemTemplateElement(elemtemplateelement1);
    m_xcontext.pushCurrentNode(node);
         <snip>
    catch(SAXException saxexception)
    throw new TransformerException(saxexception);
    finally
    m_xcontext.popCurrentNode();
         <snip>
    So what appears to be happening is that one of the two push calls at the beginning
    of the try
    block is throwing an Exception, causing the pop method to be called in the finally
    block without
    first having had a successful call to push. The corresponding NodeVector inside
    m_xcontext
    thereupon becomes corrupt, and it is only a matter of time before the above
    ArrayIndexOutOfBoundsException appears.
    Unfortunately, we are unable to consistently reproduce this Transformer corruption
    and
    currently have no idea how it happens in the first place. We figure there’s probably
    some sort
    of error in our xsl stylesheet which is at the root of all this, but have had
    no luck in finding it.
    So, two questions:
    1.) Has anyone encountered this problem of having a bad xsl stylesheet which,
    when applied
    repeatedly on certain xml documents, can cause the Transformer to become corrupt
    as a result
    of calling NodeVector.pop without a corresponding call to NodeVector.push? If
    so, do you have
    a simple example of the type of xsl template and/or xml document which might reproduce
    the
    scenario.
    2.) Would not the above code snippet in TransformerImpl be considered buggy in
    any case,
    since it should not be possible for an invalid xsl stylesheet to permanently corrupt
    the
    Transformer? If there’s agreement that this represents a bug in TransformerImpl,
    has it been
    fixed in 6.1 SP3 or higher, or in subsequent versions of the Weblogic Server?
    Thanks,
    John

    hi,
    I've just recently started getting this error too. It's completely random as
    to when it occurs. My system can process hundreds of translations with no problems
    and then once and awhile I get this exact error.
    I'm using WebLogic v7.0 sp2. I've noticed however that this only happens on my
    Windows system - I've got it running on a solairs box with no problems.
    Has anyone else seen this ?
    Thanks.
    Jerry
    "John Lame" <[email protected]> wrote:
    >
    Using WebLogic Server 6.1 SP2. Am using xslt to transform xml into html.
    After
    repeatedly
    using the same Transformer object to transform different xml documents,
    the Transformer
    eventually becomes corrupt – sometimes after 20 or so transforms, sometimes
    only
    after
    thousands.
    Once the Transformer object becomes corrupt, any additional attempt to
    call the
    transform
    method results in the following exception:
    =============================
    javax.xml.transform.TransformerException: -1
    at weblogic.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1248)
    at weblogic.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:483)
    at weblogic.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1153)
    at … <snip>
    Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
    at weblogic.apache.xml.utils.NodeVector.popQuick(NodeVector.java:247)
    at weblogic.apache.xpath.XPathContext.popCurrentNode(XPathContext.java:552)
    at weblogic.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2100)
    at weblogic.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1225)
    at … <snip>
    =============================
    Using cavaj to decompile weblogic.apache.xalan.transformer.TransformerImpl
    yields:
    Method: applyTemplateToNode:
    try
    pushElemTemplateElement(elemtemplateelement1);
    m_xcontext.pushCurrentNode(node);
         <snip>
    catch(SAXException saxexception)
    throw new TransformerException(saxexception);
    finally
    m_xcontext.popCurrentNode();
         <snip>
    So what appears to be happening is that one of the two push calls at
    the beginning
    of the try
    block is throwing an Exception, causing the pop method to be called in
    the finally
    block without
    first having had a successful call to push. The corresponding NodeVector
    inside
    m_xcontext
    thereupon becomes corrupt, and it is only a matter of time before the
    above
    ArrayIndexOutOfBoundsException appears.
    Unfortunately, we are unable to consistently reproduce this Transformer
    corruption
    and
    currently have no idea how it happens in the first place. We figure
    there’s probably
    some sort
    of error in our xsl stylesheet which is at the root of all this, but
    have had
    no luck in finding it.
    So, two questions:
    1.) Has anyone encountered this problem of having a bad xsl stylesheet
    which,
    when applied
    repeatedly on certain xml documents, can cause the Transformer to become
    corrupt
    as a result
    of calling NodeVector.pop without a corresponding call to NodeVector.push?
    If
    so, do you have
    a simple example of the type of xsl template and/or xml document which
    might reproduce
    the
    scenario.
    2.) Would not the above code snippet in TransformerImpl be considered
    buggy in
    any case,
    since it should not be possible for an invalid xsl stylesheet to permanently
    corrupt
    the
    Transformer? If there’s agreement that this represents a bug in TransformerImpl,
    has it been
    fixed in 6.1 SP3 or higher, or in subsequent versions of the Weblogic
    Server?
    Thanks,
    John

  • Javax.xml.transform.TransformerException durin XSL Transformation in Java

    Hi,
    Below is my piece of code where i access a web service that returns a xml as a string. I apply a xsl tranformation on it and try to store the result as a string. I get this error message
    javax.xml.transform.TransformerException: Result object passed to ''{0}'' is invalid.
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getOutputHandler(Unknown Source)
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
         at NewService.main(NewService.java:52)My Code:
    import java.io.BufferedWriter;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.StringReader;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.rmi.RemoteException;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.ServiceException;
    import javax.xml.transform.Result;
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerConfigurationException;
    import javax.xml.transform.TransformerException;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.stream.StreamResult;
    import javax.xml.transform.stream.StreamSource;
    import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;
    public class NewService {
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              String endPoint = "http://localhost:8080/SampleDynamicWebProj/services/SampleClient";
              Service service = new Service();
              Call callOne;
              try {
                   callOne = (Call) service.createCall();
                   callOne.setTargetEndpointAddress(new URL(endPoint));
                   callOne.setOperationName(new QName("http://DefaultNamespace",
                             "getXMLString"));
                   String concated = (String) callOne.invoke(new Object[] { "s" });
                   InputStream xsltFile = new FileInputStream("xslpackage/empTran.xsl");
                   Source xmlSource = new StreamSource(new StringReader(concated));
                 Source xsltSource = new StreamSource(xsltFile);
                 TransformerFactory transFact =
                    TransformerFactory.newInstance();
                 Transformer trans = transFact.newTransformer(xsltSource);
                 Result result = new StreamResult();
                 trans.transform(xmlSource, result);
                 System.out.println(result.toString());
              } catch (ServiceException e) {
                   e.printStackTrace();
              } catch (MalformedURLException e) {
                   e.printStackTrace();
              } catch (RemoteException e) {
                   e.printStackTrace();
              } catch (FileNotFoundException e) {
                   e.printStackTrace();
              } catch (TransformerConfigurationException e) {
                   e.printStackTrace();
              } catch (TransformerException e) {
                   e.printStackTrace();
    }I get the transformed XML into a Result object, but when i do a toString() oon it, i get the above exception.
    any help wil be appreciated,
    Dilip

    Oh well, yes it was a typo in address tag...ok agreed that its a bad example, check this out then,
    i have a XML data that i convert to a html format using xsl transformation, now this converted html has to be shown in a html page(i use the out.write option).
    so my initial xml looks like this ::
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <Results>
        <ColumnCount>6</ColumnCount>
        <Columns>
            <column>UID</column>
            <column>UserName</column>
            <column>Password</column>
            <column>LastName</column>
            <column>FirstName</column>
            <column>EmailAddress</column>
        </Columns>
        <Rows>
            <Row>
                <value>1</value>
                <value>userone</value>
                <value>password-1</value>
                <value>Anant</value>
                <value>Dilip</value>
                <value>[email protected]</value>
            </Row>
            <Row>
                <value>2</value>
                <value>usertwo</value>
                <value>password-2</value>
                <value>Palli</value>
                <value>Gilli</value>
                <value>[email protected]</value>
            </Row>
        </Rows>I apply XSL transformation on this to get a HTML which i will be writing into my output screen hoping that the user will see it in a tabular format!
    <[!CDATA["
    <?xml version="1.0" encoding="UTF-8"?>
    <table border="1">
    <tr bgcolor="#9acd32">
    <th align="left">UID</th>
    <th align="left">UserName</th>
    <th align="left">Password</th>
    <th align="left">LastName</th>
    <th align="left">FirstName</th>
    <th align="left">EmailAddress</th>
    </tr>
    <tr>
    <td>1</td>
    <td>userone</td>
    <td>password-1</td>
    <td>Anant</td>
    <td>Dilip</td>
    <td>[email protected]</td>
    </tr>
    <tr>
    <td>2</td>
    <td>usertwo</td>
    <td>password-2</td>
    <td>Palli</td>
    <td>Gilli</td>
    <td>[email protected]</td>
    </tr>
    </table>
    "]]>The entire data is passed to a XML parser . I want the transformed xml data (which will be inside a <status></status> tag to be untouched by this parser. As you see i have put the transformed xml in a CDATA tag, but this aint helping me...
    need urgent help,
    Dilip

  • TransformerException occurred during XSLT mappingMDMProductMaterialToMatmas

    Hi all,
    The scenario is MDM to ECC. From MDM i m gettin idoc data in xml file format and posting it as IDOC to ECC.
    File as sender comm chnl and IDOC as receiver commn chnl
    I am using xslt mapping and  std opertion mapping: Matmas05_600ToMatmas05  from  MDM Business Content 7.1
    File is getting picked and in moni i am  getting this error message:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Request Message Mapping
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>Application</SAP:Category>
      <SAP:Code area="MAPPING">TRANSFORMER_EXCEPTION</SAP:Code>
      <SAP:P1>MDMProductMaterialToMatmas</SAP:P1>
      <SAP:P2>http://sap.com/xi/MDEApplicationContent</SAP:P2>
      <SAP:P3>36dbecd0-7d84-11dc-cc2c-e95d0a115642</SAP:P3>
      <SAP:P4>-1</SAP:P4>
      <SAP:AdditionalText />
      <SAP:Stack>TransformerException occurred during XSLT mapping MDMProductMaterialToMatmas (http://sap.com/xi/MDEApplicationContent, 36dbecd0-7d84-11dc-cc2c-e95d0a115642, -1)</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Please provide the solution for this
    'Thanks in Advance
    Kiruthi

    Hi abhishek,
    Source system: MDM target System : ECC
    I am getting MATMAS05 (Material master data) from MDM in xml file and generating IDOC to ECC.
    This is the XSLT mapping : MDMProductMaterialToMatmas.xsl and the operation mapping is Matmas05_500ToMatmas05.I have provided the test file also. 
    As I dont have XSLT tool to test.Could you please test and tell me.
    The input file:
    <?xml version="1.0" encoding="UTF-8"?>
    <MATMAS05><IDOC BEGIN="1"><E1MARAM SEGMENT="1"><MSGFN>005</MSGFN><MATNR>1234321</MATNR><ERSDA>/</ERSDA><ERNAM>/</ERNAM><LAEDA>/</LAEDA><AENAM>/</AENAM><LVORM>/</LVORM><MTART>HAWA</MTART><MBRSH>E</MBRSH><MATKL>01</MATKL><ZEINR>/</ZEINR><ZEIAR>/</ZEIAR><ZEIVR>/</ZEIVR><ZEIFO>/</ZEIFO><AESZN>/</AESZN><BLATT>/</BLATT><BLANZ>/</BLANZ><FORMT>/</FORMT><GROES>455</GROES><WRKST>/</WRKST><NORMT>/</NORMT><EKWSL>/</EKWSL><BRGEW>112.000</BRGEW><NTGEW>100.000</NTGEW><GEWEI>KGM</GEWEI><VOLUM>34.000</VOLUM><VOLEH>MTQ</VOLEH><BEHVO>/</BEHVO><RAUBE>/</RAUBE><TEMPB>/</TEMPB><TRAGR>0003</TRAGR><STOFF>/</STOFF><SPART>01</SPART><KUNNR>/</KUNNR><WESCH>/</WESCH><BWVOR>/</BWVOR><BWSCL>/</BWSCL><SAISO>/</SAISO><ETIAR>/</ETIAR><ETIFO>/</ETIFO><EAN11>3344554321234</EAN11><PRDHA>/</PRDHA><CADKZ>/</CADKZ><ERGEW>/</ERGEW><ERGEI>/</ERGEI><GEWTO>/</GEWTO><VOLTO>/</VOLTO><KZKFG>/</KZKFG><XCHPF>X</XCHPF><VHART>/</VHART><FUELG>/</FUELG><STFAK>/</STFAK><MAGRV>/</MAGRV><BEGRU>/</BEGRU><QMPUR>/</QMPUR><RBNRM>/</RBNRM><MHDRZ>/</MHDRZ><MHDHB>/</MHDHB><MHDLP>/</MHDLP><VPSTA>/</VPSTA><EXTWG>3200</EXTWG><MSTAE>/</MSTAE><MSTAV>/</MSTAV><MSTDE>/</MSTDE><MSTDV>/</MSTDV><KZUMW>X</KZUMW><MFRPN>/</MFRPN><MFRNR>/</MFRNR><BMATN>/</BMATN><MPROF>/</MPROF><PROFL>GP0</PROFL><ILOOS>X</ILOOS><COMPL>/</COMPL><KZEFF>/</KZEFF><RDMHD>/</RDMHD><IPRKZ>/</IPRKZ><PRZUS>/</PRZUS><MTPOS_MARA>SAMM</MTPOS_MARA><GEWTO_NEW>/</GEWTO_NEW><VOLTO_NEW>/</VOLTO_NEW><WRKST_NEW>/</WRKST_NEW><AENNR>/</AENNR><MATFI>/</MATFI><CMREL>/</CMREL><SATNR>/</SATNR><SLED_BBD>/</SLED_BBD><GTIN_VARIANT>/</GTIN_VARIANT><GENNR>/</GENNR><SERLV>/</SERLV><RMATP>/</RMATP><MCOND>/</MCOND><RETDELC>/</RETDELC><LOGLEV_RETO>/</LOGLEV_RETO><NSNID>/</NSNID><WEORA>/</WEORA><_-CWM_-TOLGR>/</_-CWM_-TOLGR><_-CWM_-TARA>/</_-CWM_-TARA><_-CWM_-TARUM>/</_-CWM_-TARUM><PACKCODE>/</PACKCODE><DG_PACK_STATUS>/</DG_PACK_STATUS><E1MAKTM SEGMENT="1"><MSGFN>005</MSGFN><SPRAS>/</SPRAS><MAKTX>Box</MAKTX><SPRAS_ISO>EN</SPRAS_ISO></E1MAKTM><E1MAKTM SEGMENT="1"><MSGFN>005</MSGFN><SPRAS>/</SPRAS><MAKTX>Box</MAKTX><SPRAS_ISO>DE</SPRAS_ISO></E1MAKTM><E1MAKTM SEGMENT="1"><MSGFN>005</MSGFN><SPRAS>/</SPRAS><MAKTX>Box</MAKTX><SPRAS_ISO>NL</SPRAS_ISO></E1MAKTM><E1MAKTM SEGMENT="1"><MSGFN>005</MSGFN><SPRAS>/</SPRAS><MAKTX>Box</MAKTX><SPRAS_ISO>SV</SPRAS_ISO></E1MAKTM><E1MAKTM SEGMENT="1"><MSGFN>005</MSGFN><SPRAS>/</SPRAS><MAKTX>Box</MAKTX><SPRAS_ISO>DA</SPRAS_ISO></E1MAKTM><E1MAKTM SEGMENT="1"><MSGFN>005</MSGFN><SPRAS>/</SPRAS><MAKTX>Box</MAKTX><SPRAS_ISO>NO</SPRAS_ISO></E1MAKTM><E1MAKTM SEGMENT="1"><MSGFN>005</MSGFN><SPRAS>/</SPRAS><MAKTX>Box</MAKTX><SPRAS_ISO>PL</SPRAS_ISO></E1MAKTM></E1MARAM><E1MARAM SEGMENT="1"><MSGFN>005</MSGFN><MATNR>3234321</MATNR><ERSDA>/</ERSDA><ERNAM>/</ERNAM><LAEDA>/</LAEDA><AENAM>/</AENAM><LVORM>/</LVORM><MTART>HAWA</MTART><MBRSH>E</MBRSH><MATKL>01</MATKL><MEINS>KGM</MEINS><ZEINR>/</ZEINR><ZEIAR>/</ZEIAR><ZEIVR>/</ZEIVR><ZEIFO>/</ZEIFO><AESZN>/</AESZN><BLATT>/</BLATT><BLANZ>/</BLANZ><FORMT>/</FORMT><GROES>11</GROES><WRKST>/</WRKST><NORMT>/</NORMT><EKWSL>/</EKWSL><BRGEW>12.000</BRGEW><NTGEW>23.000</NTGEW><GEWEI>KGM</GEWEI><VOLUM>12.000</VOLUM><VOLEH>GRM</VOLEH><BEHVO>/</BEHVO><RAUBE>/</RAUBE><TEMPB>/</TEMPB><TRAGR>0002</TRAGR><STOFF>/</STOFF><SPART>10</SPART><KUNNR>/</KUNNR><WESCH>/</WESCH><BWVOR>/</BWVOR><BWSCL>/</BWSCL><SAISO>/</SAISO><ETIAR>/</ETIAR><ETIFO>/</ETIFO><EAN11>3344554321234</EAN11><NUMTP>IC</NUMTP><PRDHA>/</PRDHA><CADKZ>/</CADKZ><ERGEW>/</ERGEW><ERGEI>/</ERGEI><GEWTO>/</GEWTO><VOLTO>/</VOLTO><KZKFG>/</KZKFG><VHART>/</VHART><FUELG>/</FUELG><STFAK>/</STFAK><MAGRV>/</MAGRV><BEGRU>/</BEGRU><QMPUR>/</QMPUR><RBNRM>/</RBNRM><MHDRZ>/</MHDRZ><MHDHB>/</MHDHB><MHDLP>/</MHDLP><VPSTA>/</VPSTA><EXTWG>2434</EXTWG><MSTAE>/</MSTAE><MSTAV>/</MSTAV><MSTDE>/</MSTDE><MSTDV>/</MSTDV><KZUMW>X</KZUMW><MFRPN>/</MFRPN><MFRNR>/</MFRNR><BMATN>/</BMATN><MPROF>/</MPROF><PROFL>GP0</PROFL><ILOOS>X</ILOOS><COMPL>/</COMPL><KZEFF>/</KZEFF><RDMHD>/</RDMHD><IPRKZ>/</IPRKZ><PRZUS>/</PRZUS><MTPOS_MARA>YBKP</MTPOS_MARA><GEWTO_NEW>/</GEWTO_NEW><VOLTO_NEW>/</VOLTO_NEW><WRKST_NEW>/</WRKST_NEW><AENNR>/</AENNR><MATFI>/</MATFI><CMREL>/</CMREL><SATNR>/</SATNR><SLED_BBD>/</SLED_BBD><GTIN_VARIANT>/</GTIN_VARIANT><GENNR>/</GENNR><SERLV>/</SERLV><RMATP>/</RMATP><MCOND>/</MCOND><RETDELC>/</RETDELC><LOGLEV_RETO>/</LOGLEV_RETO><NSNID>/</NSNID><WEORA>/</WEORA><_-CWM_-TOLGR>/</_-CWM_-TOLGR><_-CWM_-TARA>/</_-CWM_-TARA><_-CWM_-TARUM>/</_-CWM_-TARUM><PACKCODE>/</PACKCODE><DG_PACK_STATUS>/</DG_PACK_STATUS><E1MAKTM SEGMENT="1"><MSGFN>005</MSGFN><SPRAS>/</SPRAS><MAKTX>Remote</MAKTX><SPRAS_ISO>EN</SPRAS_ISO></E1MAKTM><E1MAKTM SEGMENT="1"><MSGFN>005</MSGFN><SPRAS>/</SPRAS><MAKTX>Remote</MAKTX><SPRAS_ISO>DE</SPRAS_ISO></E1MAKTM><E1MAKTM SEGMENT="1"><MSGFN>005</MSGFN><SPRAS>/</SPRAS><MAKTX>Remote</MAKTX><SPRAS_ISO>NL</SPRAS_ISO></E1MAKTM><E1MAKTM SEGMENT="1"><MSGFN>005</MSGFN><SPRAS>/</SPRAS><MAKTX>Remote</MAKTX><SPRAS_ISO>SV</SPRAS_ISO></E1MAKTM><E1MAKTM SEGMENT="1"><MSGFN>005</MSGFN><SPRAS>/</SPRAS><MAKTX>Remote</MAKTX><SPRAS_ISO>DA</SPRAS_ISO></E1MAKTM><E1MAKTM SEGMENT="1"><MSGFN>005</MSGFN><SPRAS>/</SPRAS><MAKTX>Remote</MAKTX><SPRAS_ISO>NO</SPRAS_ISO></E1MAKTM><E1MAKTM SEGMENT="1"><MSGFN>005</MSGFN><SPRAS>/</SPRAS><MAKTX>Remote</MAKTX><SPRAS_ISO>PL</SPRAS_ISO></E1MAKTM></E1MARAM><E1MARAM SEGMENT="1"><MSGFN>005</MSGFN><MATNR>3456789</MATNR><ERSDA>/</ERSDA><ERNAM>/</ERNAM><LAEDA>/</LAEDA><AENAM>/</AENAM><LVORM>/</LVORM><MTART>HAWA</MTART><MBRSH>E</MBRSH><MATKL>01</MATKL><ZEINR>/</ZEINR><ZEIAR>/</ZEIAR><ZEIVR>/</ZEIVR><ZEIFO>/</ZEIFO><AESZN>/</AESZN><BLATT>/</BLATT><BLANZ>/</BLANZ><FORMT>/</FORMT><GROES>100</GROES><WRKST>/</WRKST><NORMT>/</NORMT><EKWSL>/</EKWSL><BRGEW>44.000</BRGEW><NTGEW>33.000</NTGEW><GEWEI>KGM</GEWEI><VOLUM>22.000</VOLUM><VOLEH>MTQ</VOLEH><BEHVO>/</BEHVO><RAUBE>/</RAUBE><TEMPB>/</TEMPB><TRAGR>0003</TRAGR><STOFF>/</STOFF><SPART>20</SPART><KUNNR>/</KUNNR><WESCH>/</WESCH><BWVOR>/</BWVOR><BWSCL>/</BWSCL><SAISO>/</SAISO><ETIAR>/</ETIAR><ETIFO>/</ETIFO><EAN11>3344554321234</EAN11><PRDHA>/</PRDHA><CADKZ>/</CADKZ><ERGEW>/</ERGEW><ERGEI>/</ERGEI><GEWTO>/</GEWTO><VOLTO>/</VOLTO><KZKFG>/</KZKFG><XCHPF>X</XCHPF><VHART>/</VHART><FUELG>/</FUELG><STFAK>/</STFAK><MAGRV>/</MAGRV><BEGRU>/</BEGRU><QMPUR>/</QMPUR><RBNRM>/</RBNRM><MHDRZ>/</MHDRZ><MHDHB>/</MHDHB><MHDLP>/</MHDLP><VPSTA>/</VPSTA><EXTWG>3200</EXTWG><MSTAE>/</MSTAE><MSTAV>/</MSTAV><MSTDE>/</MSTDE><MSTDV>/</MSTDV><MFRPN>/</MFRPN><MFRNR>/</MFRNR><BMATN>/</BMATN><MPROF>/</MPROF><PROFL>G0P</PROFL><IHIVI>X</IHIVI><ILOOS>X</ILOOS><COMPL>/</COMPL><KZEFF>/</KZEFF><RDMHD>/</RDMHD><IPRKZ>/</IPRKZ><PRZUS>/</PRZUS><MTPOS_MARA>SAMM</MTPOS_MARA><GEWTO_NEW>/</GEWTO_NEW><VOLTO_NEW>/</VOLTO_NEW><WRKST_NEW>/</WRKST_NEW><AENNR>/</AENNR><MATFI>/</MATFI><CMREL>/</CMREL><SATNR>/</SATNR><SLED_BBD>/</SLED_BBD><GTIN_VARIANT>/</GTIN_VARIANT><GENNR>/</GENNR><SERLV>/</SERLV><RMATP>/</RMATP><MCOND>/</MCOND><RETDELC>/</RETDELC><LOGLEV_RETO>/</LOGLEV_RETO><NSNID>/</NSNID><WEORA>/</WEORA><_-CWM_-TOLGR>/</_-CWM_-TOLGR><_-CWM_-TARA>/</_-CWM_-TARA><_-CWM_-TARUM>/</_-CWM_-TARUM><PACKCODE>/</PACKCODE><DG_PACK_STATUS>/</DG_PACK_STATUS><E1MAKTM SEGMENT="1"><MSGFN>005</MSGFN><SPRAS>/</SPRAS><MAKTX>Box</MAKTX><SPRAS_ISO>EN</SPRAS_ISO></E1MAKTM><E1MAKTM SEGMENT="1"><MSGFN>005</MSGFN><SPRAS>/</SPRAS><MAKTX>Box</MAKTX><SPRAS_ISO>DE</SPRAS_ISO></E1MAKTM><E1MAKTM SEGMENT="1"><MSGFN>005</MSGFN><SPRAS>/</SPRAS><MAKTX>Box</MAKTX><SPRAS_ISO>NL</SPRAS_ISO></E1MAKTM><E1MAKTM SEGMENT="1"><MSGFN>005</MSGFN><SPRAS>/</SPRAS><MAKTX>Box</MAKTX><SPRAS_ISO>SV</SPRAS_ISO></E1MAKTM><E1MAKTM SEGMENT="1"><MSGFN>005</MSGFN><SPRAS>/</SPRAS><MAKTX>Box</MAKTX><SPRAS_ISO>DA</SPRAS_ISO></E1MAKTM><E1MAKTM SEGMENT="1"><MSGFN>005</MSGFN><SPRAS>/</SPRAS><MAKTX>Box</MAKTX><SPRAS_ISO>NO</SPRAS_ISO></E1MAKTM><E1MAKTM SEGMENT="1"><MSGFN>005</MSGFN><SPRAS>/</SPRAS><MAKTX>Box</MAKTX><SPRAS_ISO>PL</SPRAS_ISO></E1MAKTM></E1MARAM></IDOC></MATMAS05>

  • Xalan.jar ----- javax.xml.transform.TransformerException

    Hi,
    I am using Pramati 4.1 Server.
    My application is working fine for a single or few more users. But In Performance Testing when more than 100 users hit the same link at a time, it throws lots of Transformer Exception such as �
    Exception in quicklinks.jsp: javax.xml.transform.TransformerException: java.net.SocketException: Connection reset
    javax.xml.transform.TransformerException: java.lang.ArrayIndexOutOfBoundsException: 8195
         at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:725)
         at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:425)
         at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:216)
         at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2339)
         at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2160)
         at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1213)
         at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:668)
         at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1129)
         at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1107)
         at com.niit.cliks.control.web.tagext.viewmenu.doStartTag(Unknown Source)
         at com.pramati.jsp.generated.jsp_p2f_common_p2f_menu._pramati_tag_var_cliks_viewmenu12_method(jsp_p2f_common_p2f_menu.java:315)
         at com.pramati.jsp.generated.jsp_p2f_common_p2f_menu._jspService_delegate(jsp_p2f_common_p2f_menu.java:599)
         at com.pramati.jsp.generated.jsp_p2f_common_p2f_menu._jspService(jsp_p2f_common_p2f_menu.java:623)
         at com.pramati.jsp.runtime.HttpJspSuper.service(HttpJspSuper.java:64) ....
    .....................Can anybody please help me out to resolve this problem?
    Thank you.

    I've found that using the document() function in XSL is the trigger for this bug.
    The Xalan JAXP implementation caches any document() calls. A workaround apparerently is to put in the processing instruction <?xalan-doc-cache-off?>.

  • TransformerException, getting the source

    Hi, I'm creating an XSLT editor, and using the javax.xml.transform library, I'm allowing the users to do the transformations in my program.
    When the stylesheet is not valid, e.g. there is a missing tag, or an element missing a required attribute, an TransformerException is thrown. I would like to show them the source of the problem as the exception message doesn't always provide a line number.
    I'm trying to use the source locator to provide better information, than that of:
    file:///C:/Documents%20and%20Settings/y0210323/Desktop/classes/text.xsl: line 2: You cannot call an attribute ''
    but unfortunately the source locator is always null, when I pull it from the exception.
    public void alertError(TransformerException e){
         SourceLocator sl = e.getLocator();
         String line = "";
         if(sl != null){
              System.out.println("SL not null: "+ sl.getLineNumber());
         else{
              System.out.println("SL Null");
    It always produces

    I've sorted the problem out now.
    The transformer exception sometimes wrapped the exception. I wrote a method to check if the sourcelocator was null for the given exception.
    If it was null, it would recursively unwrap the exception to get the root. And depending on the class of the root it would get the line and column numbers. If the root was a TransformerException it would get the sourceLocator, but if it was a SAXParseException it would get the line and column numbers directly from the exception.

  • TransformerException: No defined output handler for transformation result.

    I am attempting to write a Document object out to a file. However, when transformer.transform(domSource, streamResult) is executed, I get the following exception:
    Any thoughts?
    javax.xml.transform.TransformerException: No defined output handler for transformation result.
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:267)

    ideogon wrote:
    ngoonee wrote:
    My PERSONAL opinion, just dump OSS and never return. This is normally a flame-bait sort of topic, but for me its quite simple, regardless of merit or otherwise, with Ubuntu and the rest of the big distros adopting Pulseaudio en masse, it'll become (maybe already is) the default standard sound server, and it prefers to run on top of Alsa (don't think it can even run on an ossv4 backend).
    Not that that'll happen on Arch, with the focus on minimalism, but as more and more apps become Pulseaudio only, with perhaps support for ALSA as well, the choice will become easier. Or, put in another way, what apps require OSS and won't run on Alsa?
    See, I really don't have my background knowledge of the differences. I read up on ALSA vs. OSS in the Arch wiki when I built this system, and I made my decision somewhat arbitrarily.  I never even heard of Pulse until I started researching this particular issue with MPD.
    Anyway, thanks much for your perspective!
    The differences:-
    1. OSS runs on all UNIXes, ALSA only on Linux.
    2. OSS uses what some people call the 'right' UNIX way, where audio devices are just basically special files. ALSA abstracts the audio devices more.
    3. Due to licensing issues, Linux as a whole moved away from OSS (v3) years back. ALSA was developed to replace it.
    4. OSSv4 is currently available, supersedes OSSv3, but only has like 1 or 2 people working on it. ALSA is the default sound architecture to receive work in Linux.
    5. Because of 4. - driver support on most machines is better with ALSA, though there ARE quite a few user reports where ALSA is buggy with a particular device that OSS works just fine on. If you don't have this problem it doesn't apply to you.
    6. OSS has one big advantage over ALSA, per-app volume control built in. ALSA does not do this (you'd need Pulseaudio on top).
    Pretty basic stuff, you can get all of this and more from an afternoon of googling.

  • Strange TransformerException

    Hello,
    Ever since upgrading from JVM 1.4.0 to JVM 1.4.2, I have been getting a strange exception thrown. I can not seem to figure out why it worked in 1.4.0, but not in 1.4.2.
    Executing *in a bat file):
    java -Xmx500m -cp third-party/fit.jar;third-party/iText-0.95.jar;third-party/jcommon-0.7.1.jar;third-party/jfreechart-0.9.4.jar;third-party/jlfgr-1_0.jar;third-party/JSAP_1.0.2.jar;third-party/junit.jar;third-party/mysql-connector-java-3.0.9-stable-bin.jar;third-party/openmap.jar;third-party/ostermiller-org-utils.jar;third-party/trove.jar;third-party/xalan.jar;third-party/xercesImpl.jar;third-party/xml-apis.jar;third-party/xmlParserAPIs.jar RecreateTool %1 %2
    Here is the stack trace:
    javax.xml.transform.TransformerException: A location step was expected following the '/' or '//' token.
    at org.apache.xpath.compiler.XPathParser.error(Unknown Source)
    at org.apache.xpath.compiler.XPathParser.RelativeLocationPath(Unknown Source)
    at org.apache.xpath.compiler.XPathParser.LocationPath(Unknown Source)
    at org.apache.xpath.compiler.XPathParser.PathExpr(Unknown Source)
    at org.apache.xpath.compiler.XPathParser.UnionExpr(Unknown Source)
    at org.apache.xpath.compiler.XPathParser.UnaryExpr(Unknown Source)
    at org.apache.xpath.compiler.XPathParser.MultiplicativeExpr(Unknown Source)
    at org.apache.xpath.compiler.XPathParser.AdditiveExpr(Unknown Source)
    at org.apache.xpath.compiler.XPathParser.RelationalExpr(Unknown Source)
    at org.apache.xpath.compiler.XPathParser.EqualityExpr(Unknown Source)
    at org.apache.xpath.compiler.XPathParser.AndExpr(Unknown Source)
    at org.apache.xpath.compiler.XPathParser.OrExpr(Unknown Source)
    at org.apache.xpath.compiler.XPathParser.Expr(Unknown Source)
    at org.apache.xpath.compiler.XPathParser.initXPath(Unknown Source)
    at org.apache.xpath.XPath.<init>(Unknown Source)
    at org.apache.xpath.XPathAPI.eval(Unknown Source)
    at org.apache.xpath.XPathAPI.selectNodeIterator(Unknown Source)
    at org.apache.xpath.XPathAPI.selectSingleNode(Unknown Source)
    at org.apache.xpath.XPathAPI.selectSingleNode(Unknown Source)
    I thought it might be out of date xalan.jar, xercesImpl.jar, xml-apis.jar, xmlParserAPIs.jar files, but I updated them (I think) and it still doesn't work.
    Suggestions?
    Thanks.

    i had similar problems when i was using XPathAPI,selectSingleNode on a node with a xpath similar to
    "/Parent/Child/" where this would work in jdk1.4.1 but not jdk1.4.2
    remove the trailing slash, thus making it "/Parent/Child", would work correctly

  • TransformerException: A location step was expected following the '/' or '//

    I'm new to using the JAVA API to transform XML to HTML via XSLT
    I am attempting to create an application that generates this html file. I can generate the file through the command line with no problems.
    I don't know if it's because my folder name has a space in the path.
    All help is appreciated. THANKS in advance.
    Environment is WSAD. Xalan.jar, xsltc.jar, xercesImpl.jar have been included in the jars on the build path.
    Java Code
    public void createHTMLFile() {
         TransformerFactory tFactory;
         Transformer transformer;
         String stylesheet = "C://Folder Name//Project//properties//inputXSL.xsl";
         String sourceID = "C://Folder Name//Project//properties//inputXML.xml";
         File outputHTML =
              new File("C://Folder Name//Project//properties//index.html");
         FileOutputStream os;
         try {
              tFactory = TransformerFactory.newInstance();
              os = new FileOutputStream(outputHTML);
    // Exception occurs here
              transformer = tFactory.newTransformer(new StreamSource(stylesheet));
              transformer.transform(new StreamSource(sourceID),
                        new StreamResult(os));
              catch (Exception e) {
                   System.out.println(e.getMessage());
         part of XSL File
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xalan="http://xml.apache.org/xslt">
    <xsl:output method="html" encoding="UTF-8" />

    Here's my complete code
    XSL
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xalan="http://xml.apache.org/xslt">
    <xsl:output method="html" encoding="UTF-8" />
    <xsl:template match="/">
         <html>
              <head>
                   <title>HI315B</title>
              </head>
              <body>
              <table bgcolor="black" width="100%" border="1">
              <tr>
              <td>
              <div align="center">
              <b>
              <font size="6" color="#FFFF00">Data Monitoring System</font>
              </b>
              </div>
              </td>
              </tr>
         </table>
              <br />
              <br />
              <br />
         <table width="100%">
              <tr>
              <td bgcolor="#000000" colspan="4">
              <font color="#FF0000">
              <b>
                                                 <font color="#FFFF00">Title Message</font>
         </b>
         </font>
              </td>
              </tr>
              <tr>
              <xsl:for-each select="/input/set/">
              <td>
              <xsl:value-of select="locationID" />
              </td>
              </xsl:for-each>
              </tr>
              <tr>
              <xsl:for-each select="/input/set/">
              <td>
              <a>
              <xsl:attribute name="href">
              <xsl:value-of select="locationID" />
                                                        <xsl:text disable-output-escaping="yes">_</xsl:text>
                                                      <xsl:value-of select="setID" />
                                                      <xsl:text disable-output-escaping="yes">.pdf</xsl:text>
                                                 </xsl:attribute>
                                                 <xsl:attribute name="target">_blank</xsl:attribute>
                                                 <xsl:value-of select="setID" />
         </a>
         </td>
         </xsl:for-each>
         </tr>
         </table>
         <br />
         <center>
         <font size="4">
         <a href="./NotifierEmailLog.txt" target="_blank">Alert Message Log File</a>
         </font>
         </center>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>XML Code
    <input>
    <set>
         <setID>9999999</setID>
         <locationID>M3021A</locationID>
    </set>
    <set>
         <setID>9999999</setID>
         <locationID>M3021B</locationID>
    </set>
    <set>
         <setID>9999999</setID>
         <locationID>M3051A</locationID>
    </set>
    <set>
         <setID>9999999</setID>
         <locationID>M3051B</locationID>
    </set>
    <set>
         <setID>9999999</setID>
         <locationID>M3039A</locationID>
    </set>
    <set>
         <setID>REF</setID>
         <locationID>REF</locationID>
    </set>
    </input>

  • How can I display XSLT transformer errors on a web page ?

    Hi,
    I have some JSP pages that access DB, create an XML based on DB data and then transform it into HTML through an XSLT stylesheet. Developing the XSL code it's easy to make mistakes and generate errors on trasformation, but what I receive on the web page is only a "Could not compile stylesheet" TransformerConfigurationException, while the real cause of the error is displayed only on tomcat logs. This is the code for transformation:
    static public void applyXSLT(Document docXML, InputStream isXSL, PrintWriter pw) throws TransformerException, Exception {
            // instantiate the TransformerFactory.
            TransformerFactory tFactory = TransformerFactory.newInstance();
            // creates an error listener
            XslErrorListener xel = new XslErrorListener();
            // sets the error listener for the factory
            tFactory.setErrorListener(xel);
            // generate the transformer
            Transformer transformer = tFactory.newTransformer(new SAXSource(new InputSource(isXSL)));
            // transforms the XML Source and sends the output to the HTTP response
            transformer.transform(new DOMSource(docXML), new StreamResult(pw));
    }If an exception is thrown during the execution of this code, its error message is displayed on the web page.
    This is the listener class:
    public class XslErrorListener implements ErrorListener {
        public XslErrorListener() {
        public void warning(TransformerException ex) {
            // logs on error log
            System.err.println("\n\nWarning on XEL: " + ex.getMessage());
        public void error(TransformerException ex) throws TransformerException {
            // logs on error log
            System.err.println("\n\nError on XEL: " + ex.getMessage());
            // and throws it
            throw ex;
        public void fatalError(TransformerException ex) throws TransformerException {
            // logs on error log
            System.err.println("\n\nFatal Error on XEL: " + ex.getMessage());
            // and throws it
            throw ex;
    }When I have an error in the XSL stylesheet (for examples a missing closing tag), I can find on tomcat logs the real cause of the error:
    [Fatal Error] :59:10: The element type "table" must be terminated by the matching end-tag "</table>".
    Error on XEL: The element type "table" must be terminated by the matching end-tag "</table>".but on my web page is reported just the TransformerConfigurationException message that is:
    "Could not compile stylesheet".
    How can I display the real cause of the error directly on the web page?
    Thanks,
    Andrea

    This code is part of a bigger project that let developers edit XSL stylesheets through a file upload on the system and we can't impose the use of any tool for checking the xsl. So, I need to display the transformer error on the web page.I see. This code is part of an editorial/developmental tool for developers to create and edit XSL stylesheets.
    As part of the editorial process, XSL errors during editing can be considered a normal condition. In other words, it is normal to expect that the developers will generate XSL errors as they are developing stylesheets.
    In this light, handling the XSL transformation errors is a business requirement that you need to handle. Using the Java Exceptions mechanisms, e.g. try / catch are inappropriate to handle business requirements, in my opinion.
    I suggest that you look at how you handle the occurence of XSL errors differently than what you currently have. You need to:
    (1) capture the Transformation exception on the server;
    (2) extract the message from the exception and put it into a message that can be easily understood by the user;
    The current error message that you have going to the web browser is not useful.
    And you should not have the Transformation exception sent to the web browser either.
    What you are attempting to do with the exception is not appropriate.
    Handle the Transformation exception on the Business tier and use it to create a useful message that is then sent to the Presentation tier. In other words, do not send Java exceptions to web browser.
    />

  • PI 7.1 XSLT and ASMA

    Hi,
    I want to set the file name in the File Adapter as part of an XSLT-Mapping.
    The steps are as follows in the XSLT:
    1. Set Filename to new filename in ASMA.
    2. Check if Month = '1' on payload xml. .
    If month = 1 , then copy record in xml, else next record.
    But I get an error:
    Execution of mapping "urn:rlp.de:budgeting/OM_FileIN_to_FileOUT_Budget_1" failed. Reason: MappingException: Mapping failed, TransformException: Transformer exception occurred when executing XSLT BudgetFileNameMap (urn:rlp.de:budgeting, -1, 24903e11-1bce-11df-97ba-ddab0a076144), javax.xml.transform.TransformerException: com.sap.engine.lib.xsl.xpath.XPathException: Illegal number of arguments or types of arguments in a call of function 'dyn:put'., XPathException: Illegal number of arguments or types of arguments in a call of function 'dyn:put'.
    The XSLT:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                                         xmlns:fo="http://www.w3.org/1999/XSL/Format" 
                                         xmlns:ns0="urn:rlp.de:test:budgeting"
                                         xmlns:map="java:java.util.Map"
                                         xmlns:dyn="java:com.sap.aii.mapping.api.DynamicConfiguration"
                                         xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
         <xsl:param name="inputparam"/>
         <xsl:template match="/">          
              <!--change asma attributes -->
              <xsl:variable name="dynamic-conf"  select="map:get($inputparam, 'DynamicConfiguration')" />
               <!-- create asma key for FileName configuration -->
              <xsl:variable name="dynamic-key"   select="key:create('http://sap.com/xi/XI/System/File', 'FileName')" />
              <xsl:variable name="new-value"     select="yourfilename.xml" />
              <xsl:variable name="fileName"      select="dyn:put($dynamic-conf, $dynamic-key, $new-value)" />
              <MT_FileIn_Budget>
                   <xsl:copy-of select="/ns0:MT_FileIn_Budget/BudgetRecord[Monat=1]"/>
              </MT_FileIn_Budget>
        <!-- copy payload -->
        <xsl:copy-of select="." />
         </xsl:template>     
    </xsl:stylesheet>

    found it, was an error in the code:
    wrong:     <xsl:variable name="new-value"     select="yourfilename.xml" />
    right:     <xsl:variable name="new-value"     select=" 'yourfilename.xml' " />
    double quote single quote in a row!
    cheers
    Holger

  • XSLT Mapping error

    Hi All
    I am working on PI 7.1 where I have customized standard XSLT mapping according to my requirement.
    I have to add 2 fields in the standard data type ReplenishmentOrder_Notfication from SNC 7.0 SWCV.
    In standard scenario once IDOC STPPOD.DELVRY03 is released from ECC the PI scenario send this to SNC Proxy ReplenishmentOrderNotification_In.
    In my requirement I have to send XML file generated from IDOC to one of Application Folder. I have customized data type, message type, operation mapping, service interface by coping standard things.
    So the changes I have done in standard XSLT mapping are just changin name of data type and not added any mapping for the two new fields I have added to the data type as its not require at the moment.
    When I am running test I am getting follwoing error in Trace. Here please notice that its mentioning standard xslt mapping program name only though on the top you see customized names.
    Please give your inputs to resolve the issue. Thanks.
    Operation Mapping
    StppodDelvry03_MT_ReceivedDeliveryNotification_01
    Name
    StppodDelvry03_MT_ReceivedDeliveryNotification_01
    Namespace
    http://sap.com/xi/SNC/Global
    Runtime error
    TransformerException occurred during XSLT mapping StppodDelvry03_ReceivedDeliveryNotification_01 (http://sap.com/xi/SNC/Global, 46c20a71-248e-11dc-c4be-dd500a115642, -1)
    <Trace level="1" type="B">CL_MAPPING_XMS_PLSRV3-ENTER_PLSRV</Trace> <Trace level="1" type="T">Interface Mapping http://sap.com/xi/SNC/Global StppodDelvry03_ReceivedDeliveryNotification_01 </Trace> <Trace level="1" type="T">TransfromerException during XSLT processing: Thrown: javax.xml.transform.TransformerException: com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(, row:1, col:8)(, row=1, col=8) -&gt; com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(, row:1, col:8) at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:251) at com.sap.aii.ib.server.mapping.execution.AbstractMappingTransformer.transform(AbstractMappingTransfor
    Edited by: Amol on May 22, 2009 3:26 PM

    Hi Amol
    for the error CL_MAPPING_XMS_PLSRV3-ENTER_PLSRV
    <Trace level="1" type="B">CL_MAPPING_XMS_PLSRV3-ENTER_PLSRV</Trace> <Trace level="1" type="T">
    just check this Thread issue is solved by restarting  the service verifySenderAgreement
    at thread
    Re: Wrong Sender Agreement
    Thanks
    Abhishek

  • Can not replace the built in XSL Transformations

    I have a web app which uses Xalan (2.3.1++) runnin on 7.0.0.1. It runs fine in
    WL 6.1 using the weblogic transformer. However, when porting it to 7.0 I keep
    getting exceptions such below. What worries me is that I have replaced the XML
    Registry (see attached file) with the actual xalan classes.
    Are there other steps to replace the registry?
    javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException:
    javax.xml.transform.TransformerException: Did not find the stylesheet root! at
    org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:995)
    at weblogic.xml.jaxp.RegistryTransformerFactory.newTemplates(RegistryTransformerFactory.java:175)
    at

    The web controller lists cameras that are bound to Podcast Producer. It cannot list ad-hoc sources, which usually includes the built-in iSight camera. If you were to bind your camera to Podcast Producer using the Podcast Capture application, it will show up in the web controller.

  • PI Java Mapping NullPointerException

    Hi Gurus,
    I'm having some troubles doing the mapping through java mapping in PI.
    I've done the java class in the SAP NWDS and imported it on PI through the ESR.
    Now i'm trying to test through the SOAP and i've found the following error in the "Communication Channel Monitor":
    500   Internal Server Error  SAP NetWeaver Application Server/Java AS 
    java.lang.NullPointerException: while trying to invoke the method com.sap.aii.af.sdk.xi.lang.Binary.getBytes() of a null object returned from com.sap.aii.af.sdk.xi.mo.xmb.XMBPayload.getContent()
    And the following error in the SXMB_MONI:
    <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="INTERNAL">CLIENT_SEND_FAILED</SAP:Code>
      <SAP:P1>500</SAP:P1>
      <SAP:P2>Internal Server Error</SAP:P2>
      <SAP:P3>(See attachment HTMLError for details)</SAP:P3>
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:Stack>Error while sending by HTTP (error code: 500 , error text: Internal Server Error) (See attachment HTMLError for details)</SAP:Stack>
    I've developed the code below:
    public class PI_Mapping_IF extends AbstractTransformation {
      public void transform(TransformationInput in, TransformationOutput out)    throws StreamTransformationException  {  
      this.execute(in.getInputPayload().getInputStream(), out.getOutputPayload().getOutputStream()); 
      public void execute(InputStream in, OutputStream out)  throws StreamTransformationException { 
      try  
      // Inicio do java mapping
      getTrace().addInfo("JAVA Mapping Iniciado"); //Log para o PI/XI
      // Declarações referentes ao XML de entrada
      DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
      DocumentBuilder db = dbf.newDocumentBuilder();
      Document xml_in = db.parse(in);
      // Declarações referentes ao XML de saída
      Document xml_out = db.newDocument();
      TransformerFactory transformerFactory = TransformerFactory.newInstance();
      Transformer transformer = transformerFactory.newTransformer();
      // Remove o standalone
      xml_in.setXmlStandalone(true);
      // Declara a estrutura que a RFC irá receber
      Element root = xml_out.createElement("ns1:ZFSD_VMOI_UPLOAD_CF_PG");
      root.setAttribute("xmlns:ns1","urn:sap-com:document:sap:rfc:functions");
      xml_out.appendChild(root);
      Element i_cenario = xml_out.createElement("I_CENARIO");
      root.appendChild(i_cenario);
      Element t_input = xml_out.createElement("T_INPUT");
      root.appendChild(t_input);
      Element item = xml_out.createElement("ITEM");
      t_input.appendChild(item);
      Element STRING = xml_out.createElement("STRING");
      item.appendChild(STRING);
      Element t_return = xml_out.createElement("T_RETURN");
      root.appendChild(t_return);
      Element item_r = xml_out.createElement("ITEM");
      t_return.appendChild(item_r);
      Element message = xml_out.createElement("MESSAGE");
      item_r.appendChild(message);
      // Verifica se existe algum filho no nó
      NodeList nodos = xml_in.getChildNodes(); 
      if (nodos.item(0) != null)
      getTrace().addInfo("O nó(XML) possui filhos"); //Log para o PI/XI
      // Declaração de variáveis
      String ident = ""; // <Ident>
      String buyer = ""; // <BuyerLineItemNum>
      String result = ""; // <Ident>;<BuyerLineItemNum>;<Date>;<QuantityValue>
      // Inicia a extração das informações do XML
      try{
      // Recupera o nó ShipToParty
      NodeList nodeShip = xml_in.getElementsByTagName("ns0:ShipToParty");
      Node node = nodeShip.item(0);
      Element elemXML = (Element) node;
      try{
      NodeList nodeIdent = elemXML.getElementsByTagName("ns0:Ident");
      Element nameElement = (Element) nodeIdent.item(0);
      nodeIdent = nameElement.getChildNodes();
      // Recupera o valor da chave <Ident>
      ident = PI_Mapping_IF.VerifyNull(((Node) nodeIdent.item(0)).getNodeValue());
      }catch(Exception e){
      result += "0.0;";
      // Recupera o nó ListOfMaterialGroupedPlanningDetail
      NodeList nodeBuyer  = xml_in.getElementsByTagName("ns0:MaterialGroupedPlanningDetail");
      for (int i = 0; i < nodeBuyer.getLength(); i++) {
      node = nodeBuyer.item(i);
      elemXML = (Element) node;
      try{
      // Preenche a chave BuyerLineItemNum
      NodeList nodeBuyerLine = elemXML.getElementsByTagName("ns0:BuyerLineItemNum");
      Element elemBuyerLine = (Element) nodeBuyerLine.item(0);
      nodeBuyerLine = elemBuyerLine.getChildNodes();
      buyer = PI_Mapping_IF.VerifyNull(((Node) nodeBuyerLine.item(0)).getNodeValue());
      }catch(Exception e){
      buyer += "0;";
      result = ident+";"+buyer+";";
      Node nodeDt_Qnt = nodeBuyer.item(i);
      Element elemDt_Qnt = (Element)nodeDt_Qnt;
      NodeList nodeValores = elemDt_Qnt.getElementsByTagName("ns0:ScheduleDetail");
      for (int j = 0; j < nodeValores.getLength(); j++) {
      node = nodeValores.item(j);
      elemXML = (Element) node;
      try{
      // Preenche a chave Date
      NodeList modelExtra = elemXML.getElementsByTagName("ns0:Date");
      Element extraElement = (Element) modelExtra.item(0);
      modelExtra = extraElement.getChildNodes();
      result += PI_Mapping_IF.VerifyNull(((Node) modelExtra.item(0)).getNodeValue())+";";
      }catch(Exception e){
      result += "//;";
      try {
      // Preenche a chave QuantityValue
      NodeList modelURL = elemXML.getElementsByTagName("ns0:QuantityValue");
      Element urlElement = (Element) modelURL.item(0);
      modelURL = urlElement.getChildNodes();
      result += PI_Mapping_IF.VerifyNull(((Node) modelURL.item(0)).getNodeValue())+";";
      } catch (Exception e) {
      result += "0.0;";
      // Marca o final do registro
      result += "||";
      // Preenche os nós itens
      Text srcxml = xml_out.createTextNode(result);
      STRING.appendChild(srcxml);
      result = "";
      buyer = "";
      }catch(Exception e){
      // Remove o standalone
      xml_out.setXmlStandalone(true);
      // Preenche o Cenario
      Text cenario = xml_out.createTextNode("P&G");
      i_cenario.appendChild(cenario);
      // Preenche mensagem de retorno
      Text msgxml = xml_out.createTextNode("XML lido com sucesso!");
      message.appendChild(msgxml);
      // Escreve a saida do XML            
      transformer.transform(new DOMSource(xml_out), new StreamResult(out));
      getTrace().addInfo("Fim da execução do Java Mapping");
      } catch (ParserConfigurationException e) {
      getTrace().addWarning(e.getMessage());
      throw new StreamTransformationException("Can not create DocumentBuilder.", e);
      } catch (SAXException e) {
      e.printStackTrace();
      } catch (IOException e) {
      e.printStackTrace();
      } catch (TransformerConfigurationException e) {
      e.printStackTrace();
      } catch (TransformerException e) {
      e.printStackTrace();
    Am i doing anything wrong in the code? Where can this nullpointerexception be triggered?
    Thanks.

    These three xml are the same:
    <?xml version="1.0"?><a:xml xmlns:a="urn:123">root</a:xml>
    <?xml version="1.0"?><xml xmlns="urn:123">root</xml>
    <?xml version="1.0"?><ns0:xml xmlns:ns0="urn:123">root</ns0:xml>
    But your code will work only with last one, because it doesn't bound namespace to prefix ns0.

Maybe you are looking for

  • How can I make a FlashAlbumExporter background transparent?

    I really like the very cool FAE (as suggested on this most excellent forum) but the gui offers no choice as for background opacity. A little search on the net reveals a few ideas but none of them seem to work. I am using the following iframe code in

  • How to create print sharing for Mac and PC computers

    Hello~ I hope someone can answer these questions... Thanks! We are a small design office. We have trouble printing recently after we upgrade our Mac OSX v10.4. We have: 2 PC computers (Window XP Home Edition) 1 Power Mac G4 1 Power Mac G5 1 PowerBook

  • WEBUTIL - file already open problem

    Hy everybody, I request your help for a problem with de Webutil library. I want to open a PDF document with the command : Ret := WEBUTIL_HOST.Nonblocking( Cmd ) ; (Cmd = path + file name) This function is called on a "When Button pressed" trigger in

  • Record old VHS to HDD with Hauppauge HD PVR [Solved]

    Video is fine but there is no sound. The best I can get is a scratching noise from the recording. There is nothing wrong with the equipment. I have both sound and video in windows. I tried 'cat /dev/video1 > video.mp4' and 'mplayer /dev/video1' and c

  • Management Pack reference/dependency cleanup tool

    Has anyone else seen a tool that locates old/stale MP references and removes them?  I swore I ran across a tool the other day that did this, however I can't find it now that I actually need it.