Pipelining XSLTs

Hello, i want a XML file (in this case an XHTML file, generated by a JSP) to pass through a series of XSLT file, before it's outputed
I have this codeStringReader sr = new StringReader(wrapper.toString());
InputSource xmlSource = new InputSource(sr);
TransformerFactory tFactory = TransformerFactory.newInstance();
SAXTransformerFactory saxTFactory = ((SAXTransformerFactory) tFactory);    
XMLFilter xmlFilter1 = saxTFactory.newXMLFilter(new StreamSource("file1.xslt"));
XMLFilter xmlFilter2 = saxTFactory.newXMLFilter(new StreamSource("file2.xslt));
XMLReader reader = XMLReaderFactory.createXMLReader();
xmlFilter1.setParent(reader);
xmlFilter2.setParent(xmlFilter1);
java.util.Properties xmlProps = OutputPropertiesFactory.getDefaultMethodProperties("xml");
xmlProps.setProperty("indent", "yes");
xmlProps.setProperty("standalone", "no");
Serializer serializer = SerializerFactory.getSerializer(xmlProps);       
serializer.setOutputStream(response.getOutputStream());
xmlFilter2.setContentHandler(serializer.asContentHandler());
xmlFilter2.parse(xmlSource);I took this from the Xalan site, and it's exactly like they have their (except i use 2 files, and they use 3).
My problem is that the output i get is exactly as it is, that is, it doesn't pass by the XSLT files.
PS: In Xalan site they also have a Pipe example, i've tried it also, and the result is the same.
Thanks

Never mind, i found out what was wrong
My first XSL transformation change an important part of the XML file, so the second one couldn't read
DUHHHHHHH
Thanks anyway

Similar Messages

  • Who knows about xdk: xslt vm and xml pipeline processor

    hello,
    i read anywhere that xslt vm and xml pipeline processor is
    part of the xdk.
    i would know more about xslt vm and pipeline processor,
    but where ??
    thank you!!

    Hi,
    XSLT VM is a high performance XSLT transformation engine in C.
    XML Pipeline Processor specifies Java processes to be executed in a declarative manner. W3C recommendation is at http://www.w3.org/TR/2002/NOTE-xml-pipeline-20020228/.
    Both of these are supported by Oracle in XDK 10i. More information at http://technet.oracle.com/tech/xml/xdk/content.html. Documentation at http://otn.oracle.com/docs/tech/xml/xdk/doc_library/Beta/index.html.
    Thanks.

  • PI Pipeline Doubt : Pipeline Steps in ABAP stack and JAVA stack

    Hello
    Can anyone please assist me with which stages steps of the PI Pipeline are executed on the Java or the ABAP stack.
    Receiver Determination
    Interface Determination
    Message Split
    Message Mapping
    Technical routing
    Call Adapter
    Also can anyone please provide links relating to the PI architecture diagram describing it from ABAP and Java Stack Perspective and not from the Components perspective i.e. Integration Repository and Directory.
    Thanks.
    Kiran

    Hi
    Tha ABAP stack consists of the Integration Server which in turn contains your Integration Engine and Business Process Engine.
    The J2EE stack contains the Adapter Engine and your IR and ID run on the J2EE engine.
    Most of XI pipelines happens in the ABAP stack.
    All messsages picked by the Adapter Framework running on the J2EE engine are passed to the Integration Engine, which does the routing. The mapping program again gets executed on the Java stack and the rest of the pipeline servies are executed again on the ABAP stack and so on.
    Message, Java & XSLT (under Imported Archives) mappings are executed at Java stack;
    ABAP & XSLT (in ABAP stack) mappings are executed at ABAP stack.
    PI Architecture  look threads
    Architecture
    /message/5802842#5802842 [original link is broken]

  • Using custom xslt file for mapping

    I have a map using custom xsl. I deployed it to different enviroment. When my BTS application ran, it complained
    There was a failure executing the receive pipeline: "WS.Pipeline.MsgTransformDebatchPipeline, WS.Pipeline, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c7f3bdebaae529db" Source: "MsgTransformDecoder" Receive Port: "WS_Debatch"
    URI: "C:\TestData\WS\InternalInput\*_batch.xml" Reason: Could not find file 'C:\WS\BTS\WS.Map\BatchOrder_to_CanonicalBatchOrder.xsl'.
    I have to create corresponding path and copy my xsl file there to make it work. Why?
    I tried Microsoft.Samples.BizTalk.ExtendingMapper.OverridingMapXslt sample. I compiled and deployed it, then I modified OverridingMapXslt.xslt to OverridingMapXslt2.xslt. I dropped input file and there was no complaint about missing OverridingMapXslt.xslt.
    I thought .xsl is treated like any other source code file and is compiled into the assembly at build time. Why I got this error?
    Thanks in advance!!!

    Unless you've compiled the .xsl into your custom component as a Resource, then yes, that exact path has to exist anywhere it will run.
    However, as la Cour points out, a BizTalk Map has a Custom XSLT Path property that will take care of that for you.

  • How to apply an XSLT transformation in OSB

    Hello all ,
    I tried to made a simple example - that apply a simple XSLT transformation in OSB .
    I followed the http://blog.jayway.com/2010/05/07/xslt-transformations-in-oracle-service-bus/ example but still is not working in my project .
    If I apply the imported xslt over the xml in testing window is working fine .
    But the action to replace the content of the xml with the new one is not working.
    Here is the xslt
    <xsl:template match="/">
    <ns0:donateToFund>
    <arg0>
    <xsl:value-of select="/Report/CustomerName"/>
    </arg0>
    <arg1>
    <xsl:value-of select="/Report/CustomerNumber"/>
    </arg1>
    <arg2>
    <xsl:value-of select="/Report/ReportName"/>
    </arg2>
    </ns0:donateToFund>
    </xsl:template>
    and here is a xml sample
    - <Report>
    <ReportName>Customer Report</ReportName>
    <CustomerName>XXX</CustomerName>
    <CustomerNumber>3423</CustomerNumber>
    <GeneratedDate>2010-11-25 08:15:24.695</GeneratedDate>
    - <Rowset>
    - <Row>
    <Quantity>100154</Quantity>
    <CustomerPartNo>ee</CustomerPartNo>
    <eSiliconPartNo>ee</eSiliconPartNo>
    <Sector>ee</Sector>
    <Location>eee</Location>
    </Row>
    - <Row>
    In my action I put /Report as XPath ; body as variable and XSL fro transformation .
    Can anyone help to fix this ?
    Many thanks in advance,
    Stefan

    Following works for me:
    XSLT
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" omit-xml-declaration="yes"/>
    <xsl:template match="/" xmlns:ns0="http://tempuri.org">
    <ns0:donateToFund>
    <arg0>
    <xsl:value-of select="/Report/CustomerName"/>
    </arg0>
    <arg1>
    <xsl:value-of select="/Report/CustomerNumber"/>
    </arg1>
    <arg2>
    <xsl:value-of select="/Report/ReportName"/>
    </arg2>
    </ns0:donateToFund>
    </xsl:template>
    </xsl:stylesheet>Input to Proxy
         <Report>
         <ReportName>Customer Report</ReportName>
         <CustomerName>XXX</CustomerName>
         <CustomerNumber>3423</CustomerNumber>
         <GeneratedDate>2010-11-25 08:15:24.695</GeneratedDate>
         <Rowset>
         <Row>
         <Quantity>100154</Quantity>
         <CustomerPartNo>ee</CustomerPartNo>
         <eSiliconPartNo>ee</eSiliconPartNo>
         <Sector>ee</Sector>
         <Location>eee</Location>
         </Row>
         <Row>
         <Quantity>100154</Quantity>
         <CustomerPartNo>aa</CustomerPartNo>
         <eSiliconPartNo>aa</eSiliconPartNo>
         <Sector>aa</Sector>
         <Location>aaa</Location>
         </Row>
         </Rowset>
         </Report>Output of Proxy:
         <ns0:donateToFund       xmlns:ns0="http://tempuri.org">
         <arg0>XXX</arg0>
         <arg1>3423</arg1>
         <arg2>Customer Report</arg2>
         </ns0:donateToFund>I am using a single Replace action in the request pipeline.
    It works for both configs below:
    Replace [ entire node ] of [ ./* ] in [ body ] with [Xslt Resource: default/OTN/temp
    Input Document: $body/Report
    Variable Names And Bindings ]
    Or
    Replace [ Node Contents ] of [ . ] in [ body ] with [Xslt Resource: default/OTN/temp
    Input Document: $body/Report
    Variable Names And Bindings ]
    You need to ensure that if you are doing replace entire node of . in body or / in body then you should replace it with an XML whose root node is soap:Body. To achieve that you will need to change the XSL and add soap:Body as root of the output. Easier solution is to use replace contents of . body or replace entire node of ./* in body.

  • Error in XSLT filter.

    Hi All,
    I have created some XSLT filters to display the XML file as the HTML. It was working fine before. but suddenly there's an error.
    After applying the XSLT filter to the content. When i clicked on the content to see the output it is throwing    " 500 INTERNAL SERVER ERROR -- Contact System Administrator ".
    I tried to find the error in the log :   Below is the log for the same::
    Error##Plain###Cannot instantiate user <anonymous>#
    #1.5#0011254E4B6500460000001F00001C0800044066D387C4F6#1196710286640#com.sapportals.wcm.WcmException#sap.com/irj#com.sapportals.wcm.WcmException.WcmException(118)#IntranetApprover#35##idbportst_TST_3777850#IntranetApprover#01477b00a1d511dc8c660011254e4b65#SAPEngine_Application_Thread[impl:3]_11##0#0#Error##Plain###Error downloading from URL: wcm://etc/filter/idbfilters/author.xsl, No user in context com.sapportals.wcm.util.urlcontentaccess.URLContentAccessException: Error downloading from URL: wcm://etc/filter/idbfilters/author.xsl, No user in context
         at com.sapportals.wcm.util.urlcontentaccess.URLContentAccess.readContent(URLContentAccess.java:263)
         at com.sapportals.wcm.util.urlcontentaccess.URLContentAccess.readContent(URLContentAccess.java:281)
         at com.sapportals.wcm.service.pipeline.producer.ProducerFromUrl.getData(ProducerFromUrl.java:54)
         at com.sapportals.wcm.service.pipeline.processor.XSLTProcessor.process(XSLTProcessor.java:141)
         at com.sapportals.wcm.service.pipeline.Pipeline.handle(Pipeline.java:269)
         at com.sapportals.wcm.service.pipeline.XSLTPipeline.handle(XSLTPipeline.java:118)
         at com.sapportals.wcm.service.pipeline.XSLTPipeline.handle(XSLTPipeline.java:134)
         at com.sapportals.wcm.repository.filter.xslt.XsltFilter.getContent(XsltFilter.java:150)
         at com.sapportals.wcm.repository.filter.xslt.XsltFilter.getInputStream(XsltFilter.java:90)
         at com.sapportals.wcm.repository.runtime.CmFilterHandler$VaryingContentWrapper1.getInputStream(CmFilterHandler.java:1050)
         at com.sapportals.wcm.repository.ContentImpl.getInputStream(ContentImpl.java:113)
         at com.sapportals.wcm.repository.ContentImpl.getInputStream(ContentImpl.java:132)
         at com.sapportals.wcm.protocol.webdav.server.WDGetHandler.internalHandle(WDGetHandler.java:364)
         at com.sapportals.wcm.protocol.webdav.server.WDGetHandler.handle(WDGetHandler.java:253)
         at com.sapportals.wcm.protocol.webdav.server.WDServlet.doGet(WDServlet.java:777)
         at com.sapportals.wcm.protocol.webdav.server.WDServlet.service(WDServlet.java:458)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sapportals.wcm.portal.proxy.PCProxyServlet.service(PCProxyServlet.java:331)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at
    can anyone please help me in this regard, it is very urgent.
    Thanks in advance,
    Kavitha.

    unaswered

  • Problem in working with xslt filter

    Hi All,
    I have created some XSLT filters to display the XML file as the HTML. It was working fine before. but suddenly there's an error.
    After applying the XSLT filter to the content. When i clicked on the content to see the output it is throwing " 500 INTERNAL SERVER ERROR -- Contact System Administrator ".
    I tried to find the error in the log : Below is the log for the same::
    Error##Plain###Cannot instantiate user <anonymous>#
    #1.5#0011254E4B6500460000001F00001C0800044066D387C4F6#1196710286640#com.sapportals.wcm.WcmException#sap.com/irj#com.sapportals.wcm.WcmException.WcmException(118)#IntranetApprover#35##idbportst_TST_3777850#IntranetApprover#01477b00a1d511dc8c660011254e4b65#SAPEngine_Application_Threadimpl:3_11##0#0#Error##Plain###Error downloading from URL: wcm://etc/filter/idbfilters/author.xsl, No user in context com.sapportals.wcm.util.urlcontentaccess.URLContentAccessException: Error downloading from URL: wcm://etc/filter/idbfilters/author.xsl, No user in context
    at com.sapportals.wcm.util.urlcontentaccess.URLContentAccess.readContent(URLContentAccess.java:263)
    at com.sapportals.wcm.util.urlcontentaccess.URLContentAccess.readContent(URLContentAccess.java:281)
    at com.sapportals.wcm.service.pipeline.producer.ProducerFromUrl.getData(ProducerFromUrl.java:54)
    at com.sapportals.wcm.service.pipeline.processor.XSLTProcessor.process(XSLTProcessor.java:141)
    at com.sapportals.wcm.service.pipeline.Pipeline.handle(Pipeline.java:269)
    at com.sapportals.wcm.service.pipeline.XSLTPipeline.handle(XSLTPipeline.java:118)
    at com.sapportals.wcm.service.pipeline.XSLTPipeline.handle(XSLTPipeline.java:134)
    at com.sapportals.wcm.repository.filter.xslt.XsltFilter.getContent(XsltFilter.java:150)
    at com.sapportals.wcm.repository.filter.xslt.XsltFilter.getInputStream(XsltFilter.java:90)
    at com.sapportals.wcm.repository.runtime.CmFilterHandler$VaryingContentWrapper1.getInputStream(CmFilterHandler.java:1050)
    at com.sapportals.wcm.repository.ContentImpl.getInputStream(ContentImpl.java:113)
    at com.sapportals.wcm.repository.ContentImpl.getInputStream(ContentImpl.java:132)
    at com.sapportals.wcm.protocol.webdav.server.WDGetHandler.internalHandle(WDGetHandler.java:364)
    at com.sapportals.wcm.protocol.webdav.server.WDGetHandler.handle(WDGetHandler.java:253)
    at com.sapportals.wcm.protocol.webdav.server.WDServlet.doGet(WDServlet.java:777)
    at com.sapportals.wcm.protocol.webdav.server.WDServlet.service(WDServlet.java:458)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.sapportals.wcm.portal.proxy.PCProxyServlet.service(PCProxyServlet.java:331)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    can anyone please help me in this regard, it is very urgent.
    Thanks in advance,
    Kavitha.

    unaswered

  • BizTalk Map - Xslt Issue

    Hi,
    Here is a piece of xslt, i need to replace the characters with their shortcode which are not supported in xml.
    For eg i need to replace '&' to '&amp' and similarly all other characters as mentioned
    Unsupported characters and their replacements:
    & - &amp;
    < - &lt;
    > - &gt;
    " - &quot;
    ' - &#39;
    XSLT:
    <xsl:if test="/*[local-name()='Root' and namespace-uri()='http://schemas.microsoft.com/BizTalk/2003/aggschema']/*[local-name()='InputMessagePart_1' and namespace-uri()='']/*[local-name()='GetOrderDetailsByIdResponse' and namespace-uri()='http://tempuri.org/']/*[local-name()='GetOrderDetailsByIdResult'
    and namespace-uri()='http://tempuri.org/']/*[local-name()='TermsAndConditionList' and namespace-uri()='http://schemas.datacontract.org/2004/07/GEP.Cumulus.P2P.BusinessEntities']/*[local-name()='TermsAndCondition' and namespace-uri()='http://schemas.datacontract.org/2004/07/Gep.Cumulus.CSM.Entities']/*[local-name()='TermsConditionText'
    and namespace-uri()='http://schemas.datacontract.org/2004/07/Gep.Cumulus.CSM.Entities']/text()">
    <Extrinsic>
    <HeaderExtrinsic>
    <TermsAndConditions>
    <xsl:for-each select="../s10:TermsAndConditionList">
    <xsl:for-each select="s9:TermsAndCondition">
    <xsl:if test="s9:TermsConditionText">
    <TermsAndCondition>
    <xsl:value-of select="s9:TermsConditionText/text()" /> 
    </TermsAndCondition>
    </xsl:if>
    </xsl:for-each>
    </xsl:for-each>
    </TermsAndConditions>
    </HeaderExtrinsic>
    </Extrinsic>
    </xsl:if>
    [Need to do it in the value coming from termandcondition text ie s9:TermsConditionText]
    Thanks in Advance

    Then go back to the source and explain to them that this is not valid XML, and you cannot consume it. Have you tried opening this XML in a web browser? or have an XML Disassemble Pipeline Component consume it?
    It should be 
    <ns5:TermsConditionText>Terms&amp;conditions</ns5:TermsConditionText>
    From the source, otherwise you will not be able to parse it as XML.
    Morten la Cour

  • Problem inworking of the  XSLT filter

    Hi All,
    I have created some XSLT filters to display the XML file as the HTML. It was working fine before. but suddenly there's an error.
    After applying the XSLT filter to the content. When i clicked on the content to see the output it is throwing " 500 INTERNAL SERVER ERROR -- Contact System Administrator ".
    I tried to find the error in the log : Below is the log for the same::
    Error##Plain###Cannot instantiate user <anonymous>#
    #1.5#0011254E4B6500460000001F00001C0800044066D387C4F6#1196710286640#com.sapportals.wcm.WcmException#sap.com/irj#com.sapportals.wcm.WcmException.WcmException(118)#IntranetApprover#35##idbportst_TST_3777850#IntranetApprover#01477b00a1d511dc8c660011254e4b65#SAPEngine_Application_Threadimpl:3_11##0#0#Error##Plain###Error downloading from URL: wcm://etc/filter/idbfilters/author.xsl, No user in context com.sapportals.wcm.util.urlcontentaccess.URLContentAccessException: Error downloading from URL: wcm://etc/filter/idbfilters/author.xsl, No user in context
    at com.sapportals.wcm.util.urlcontentaccess.URLContentAccess.readContent(URLContentAccess.java:263)
    at com.sapportals.wcm.util.urlcontentaccess.URLContentAccess.readContent(URLContentAccess.java:281)
    at com.sapportals.wcm.service.pipeline.producer.ProducerFromUrl.getData(ProducerFromUrl.java:54)
    at com.sapportals.wcm.service.pipeline.processor.XSLTProcessor.process(XSLTProcessor.java:141)
    at com.sapportals.wcm.service.pipeline.Pipeline.handle(Pipeline.java:269)
    at com.sapportals.wcm.service.pipeline.XSLTPipeline.handle(XSLTPipeline.java:118)
    at com.sapportals.wcm.service.pipeline.XSLTPipeline.handle(XSLTPipeline.java:134)
    at com.sapportals.wcm.repository.filter.xslt.XsltFilter.getContent(XsltFilter.java:150)
    at com.sapportals.wcm.repository.filter.xslt.XsltFilter.getInputStream(XsltFilter.java:90)
    at com.sapportals.wcm.repository.runtime.CmFilterHandler$VaryingContentWrapper1.getInputStream(CmFilterHandler.java:1050)
    at com.sapportals.wcm.repository.ContentImpl.getInputStream(ContentImpl.java:113)
    at com.sapportals.wcm.repository.ContentImpl.getInputStream(ContentImpl.java:132)
    at com.sapportals.wcm.protocol.webdav.server.WDGetHandler.internalHandle(WDGetHandler.java:364)
    at com.sapportals.wcm.protocol.webdav.server.WDGetHandler.handle(WDGetHandler.java:253)
    at com.sapportals.wcm.protocol.webdav.server.WDServlet.doGet(WDServlet.java:777)
    at com.sapportals.wcm.protocol.webdav.server.WDServlet.service(WDServlet.java:458)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.sapportals.wcm.portal.proxy.PCProxyServlet.service(PCProxyServlet.java:331)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    can anyone please help me in this regard, it is very urgent.
    Thanks in advance,
    Kavitha.

    unanswered

  • Create null message using BizTalk mapper XSLT

    Hi,
    I have a requirement to check if a message contains a certian value, and if so, throw away the message.  Does anyone know how this could be done using BizTalk mapper/ XSLT?  It's an ESB messaging only solution so don;t want to introduce orchestratons
    / c# code.
    In short is field A = 'yes' the message will be thrown away / made null. 
    Thanks in advance.
    GilesB

    If you consider doing this in Receive-side with some pipeline component, I am afraid you can't eat the data at the receive pipeline. For a null returned, I believe at least a empty message would be published to message box.
    Without orchestration, in message-only scenario one option you can consider is using a custom adapter where you can have your logic whether to send a stream/message out or not. Something like:
    public bool TransmitMessage(IBaseMessage msg)
    _terminate.Enter();
    try
    bool logMessages = Convert.ToBoolean(
    GetAdapterConfigValue(msg.Context, "logMessages")
    if ( logMessages ) {
    SystemMessageContext ctxt = new SystemMessageContext(msg.Context);
    //Add your logic using XPathReader - stream based XPath
    //and check whether the message has the value your're looking for
    bool isFound = false;
    if (!isFound)
    string msgData = "";
    StreamReader reader = new StreamReader(msg.BodyPart.Data);
    using (reader)
    msgData = reader.ReadToEnd();
    // discard the message
    return true;
    } finally {
    _terminate.Leave();
    Above is part of the send adapter code where you add your logic using XPathReader - stream based XPath and check whether the message has the value your're looking for. You can use
    null send adapter as refernce and build your logic where it would check for the required value in your custom adapter.
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Schema and execute Pipeline problem

    hello, 
    I created a shcema input that has the following structure 
    Root 
          any 
    date in order to accept the document root after any type of document. And a pattern of output which has the structure 
    Root 
          node A 
          node B 
          node C 
    now I want to map everything that is contained in any node within the node A. 
    I made a wild map with xslt. I deployed everything in biztalk. I set the apipepile receive a pass thru and send a xmlTrasmi with the map. But hottengo the following errors: 
    This Assembler can not retrieve a document specification using this type: "Root". 
    But the schema is deployed properly. 
    Finding the document specification by message type "Root" failed. Verify the schema deployed properly. 
    How can I fix the problem. I tried several solutions, but I did not succeed.

    This error is not to do with map, but the assembler not able to resolve the deployed schema to the received message. So remove the map (just to test) and just use XMLTransmit in the send port. And
    see what do you get. If the message passes thru the XMLTransmit
    pipeline, then the schema resolution happened.
    Can your send pipeline properties and set
    DocumentSpecNames property to fully qualified name of schema in format <schema type>+<root name> ,<schema assembly full name>. This would BizTalk engine to bound the specific deployed
    schema.
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Using Custom XSLT File for html output file

    Hi all
    I have probably rather a silly question but I have not found a solution yet.
    I would like to use a custom XSLT file, which I already have and is working, within a Biztalk Map. The custom XSLT is generating a html file out of an xml file. However I'm not able to succeed so far because I have probably some issues in defining the correct
    target schema. 
    The output that I get at the moment is just a duplicate of the input, probably because I have used the schema for source and target.
    So my question is, how do I create a html file out of an xml with a custom XSLT file?
    Sorry if this is a nooby question but I couldn't find an answer.

    Hi Jerome,
    Sorry, your question is not very clear. "I would like to use a custom XSLT file, which I already have and is working, within a BizTalk Map. The custom XSLT is generating a html file out of an xml file" -  You have an XSLT which you use for map and how
    its generating a HTML file? Are you using something like this?
    Changing an XML Response to an HTML output using a Map
    If your requirement is to output the html file from the received XML file using XSLT, then use a custom pipeline at send port like XSLT Transform Component and provide the XST which would change the XML to HTML. Here is an example of an XST which I have
    used in the past, which converts the received OrderResponse XML to nicely formatted HTML.
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://biztalk.orderapp.schemas.OrderResponse">
    <xsl:template match="/">
    <html>
    <body>
    <TABLE BORDER="0" cellspacing="2" cellpadding="2" width="90%">
    <xsl:apply-templates select="/ns0:OrderResponse"/>
    </TABLE>
    </body>
    </html>
    </xsl:template>
    <xsl:template match="/ns0:OrderResponse">
    <TR>
    <TD colspan="8" align="center">
    <H1>Order Confirmation</H1>
    </TD>
    </TR>
    <TR>
    <TD colspan="2">
    <B>Order no : </B>
    </TD>
    <TD colspan="6" align="left">
    <xsl:value-of select="ns0:OrderHeader/ns0:OrderNumber/text()"/>
    </TD>
    </TR>
    <TR>
    <TD colspan="2">
    <B>Supplier : </B>
    </TD>
    <TD colspan="6" align="left">
    <xsl:value-of select="ns0:SupplierDetails/ns0:SupplierName/text()"/>
    </TD>
    </TR>
    <TR>
    <TD colspan="2">
    <B>Supplier Order no : </B>
    </TD>
    <TD colspan="6" align="left">
    <xsl:value-of select="ns0:SupplierDetails/ns0:SupplierOrderNumber/text()"/>
    </TD>
    </TR>
    <TR>
    <TD colspan="2">
    <B>Account no : </B>
    </TD>
    <TD colspan="6" align="left">
    <xsl:value-of select="ns0:OrderHeader/ns0:CustomerAccountNumber/text()"/>
    </TD>
    </TR>
    <TR>
    <TD colspan="2">
    <B>Order date : </B>
    </TD>
    <TD colspan="6" align="left">
    <xsl:value-of select="ns0:OrderHeader/ns0:OriginalOrderCreationDate/text()"/>
    </TD>
    </TR>
    <TR>
    <TD colspan="2">
    <B>Delivery date : </B>
    </TD>
    <TD colspan="6" align="left">
    <xsl:value-of select="ns0:OrderHeader/ns0:DeliveryDate/text()"/>
    </TD>
    </TR>
    <TR>
    <TD colspan="2">
    <B>Order Status : </B>
    </TD>
    <TD colspan="6" align="left">
    <xsl:value-of select="ns0:OrderHeader/ns0:OrderStatus/text()"/>
    </TD>
    </TR>
    <TR>
    <TD colspan="8">
    <BR></BR>
    </TD>
    </TR>
    <TR>
    <TD valign="top">
    <B>Line</B>
    </TD>
    <TD valign="top">
    <B>Code</B>
    </TD>
    <TD valign="top">
    <B>UOM</B>
    </TD>
    <TD valign="top">
    <B>
    Avail<BR></BR>Qty
    </B>
    </TD>
    <TD valign="top">
    <B>
    Line<BR></BR>Price
    </B>
    </TD>
    <TD valign="top">
    <B>
    Line<BR></BR>Status
    </B>
    </TD>
    </TR>
    <xsl:for-each select="ns0:LineItems">
    <xsl:for-each select="ns0:LineItem">
    <TR>
    <TD valign="top">
    <xsl:value-of select="ns0:LineNumber/text()"/>
    </TD>
    <TD valign="top">
    <xsl:value-of select="ns0:ProductCode/text()"/>
    </TD>
    <TD valign="top">
    <xsl:value-of select="ns0:UnitOfMeasure/text()"/>
    </TD>
    <TD valign="top">
    <xsl:value-of select="ns0:Quantity/text()"/>
    </TD>
    <TD valign="top">
    <xsl:value-of select="ns0:UnitPrice/text()" />
    </TD>
    <TD valign="top">
    <xsl:value-of select="ns0:LineStatus/text()" />
    </TD>
    </TR>
    </xsl:for-each>
    </xsl:for-each>
    <TR>
    <TD colspan="8">
    <BR></BR>
    </TD>
    </TR>
    </xsl:template>
    </xsl:stylesheet>
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • How to iterate through each node in REPLACE stage/XSLT transform/OSB

    I need to iterate through a xml document in a 'REPLACE' stage in a OSB message flow and have each <courseTemplate> transformed into a new xml document. The XSLT transform works correctly using the XSLT Resource Tester so I know the stylesheet works.
    ex: input data:
    <enterprise>
    <courseTemplate><sourcedId>100001-01</sourcedId><label><language>en-US</language><text>100001-01</text></label><title><language>en-US</language><text>Lower Division General Credit</text></title><catalogDescription><shortDescription>Lower Division General Credit</shortDescription><longDescription>Lower Division General Credit</longDescription></catalogDescription><courseNumber><language>en-US</language><text>XFCR 2999SA</text></courseNumber><status>Active</status><dataSource>CS</dataSource><extension><extensionField><fieldName>Mode</fieldName><fieldType>String</fieldType><fieldValue>C</fieldValue></extensionField></extension></courseTemplate>
    <courseTemplate><sourcedId>100001-02</sourcedId><label><language>en-US</language><text>100001-02</text></label><title><language>en-US</language><text>Lower Division General Credit</text></title><catalogDescription><shortDescription>Lower Division General Credit</shortDescription><longDescription>Lower Division General Credit</longDescription></catalogDescription><courseNumber><language>en-US</language><text>XFCR 2999TC</text></courseNumber><status>Active</status><dataSource>CS</dataSource><extension><extensionField><fieldName>Mode</fieldName><fieldType>String</fieldType><fieldValue>C</fieldValue></extensionField></extension></courseTemplate>
    </enterprise>
    1) the output data should look like:
    <enterprise      xsi:noNamespaceSchemaLocation="import_xml4.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <group      recstatus="2">
         <sourcedid>
         <id>100001-01</id>
         </sourcedid>
         <grouptype>
         <typevalue      level="4">Course Template</typevalue>
         </grouptype>
         <description>
         <short>100001-01</short>
         <long>Lower Division General Credit</long>
         </description>
         <relationship      relation="1">
         <sourcedid>
         <id>Uh</id>
         </sourcedid>
         <label/>
         </relationship>
         <extension>
         <path/>
         </extension>
         </group>
         <group      recstatus="2">
         <sourcedid>
         <id>100001-02</id>
         </sourcedid>
         <grouptype>
         <typevalue      level="4">Course Template</typevalue>
         </grouptype>
         <description>
         <short>100001-02</short>
         <long>Lower Division General Credit</long>
         </description>
         <relationship      relation="1">
         <sourcedid>
         <id>Uh</id>
         </sourcedid>
         <label/>
         </relationship>
         <extension>
         <path/>
         </extension>
         </group>
    </enterprise>
    2) what is happening is the first node is being repeated:
    <enterprise      xsi:noNamespaceSchemaLocation="import_xml4.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <group      recstatus="2">
         <sourcedid>
         <id>100001-01</id>
         </sourcedid>
         <grouptype>
         <typevalue      level="4">Course Template</typevalue>
         </grouptype>
         <description>
         <short>100001-01</short>
         <long>Lower Division General Credit</long>
         </description>
         <relationship      relation="1">
         <sourcedid>
         <id>Uh</id>
         </sourcedid>
         <label/>
         </relationship>
         <extension>
         <path/>
         </extension>
         </group>
         <group      recstatus="2">
         <sourcedid>
         <id>100001-01</id>
         </sourcedid>
         <grouptype>
         <typevalue      level="4">Course Template</typevalue>
         </grouptype>
         <description>
         <short>100001-01</short>
         <long>Lower Division General Credit</long>
         </description>
         <relationship      relation="1">
         <sourcedid>
         <id>Uh</id>
         </sourcedid>
         <label/>
         </relationship>
         <extension>
         <path/>
         </extension>
         </group>
    </enterprise>
    3) here is what I am using in the replace stage:
    XPath Expression Editor      : Request Pipeline - replace
    //enterprise/courseTemplate
    //enterprise/courseTemplate
    in variable: body with Xslt: SAIP_OSB_Requester/CourseTemplateSAIP_XSLT
    Input Document: $body
    Variable Names And Bindings: saipCourseTemplatesParam - $body
    4) can you see what I need to change?
    Edited by: user11960867 on Jul 5, 2011 10:58 AM

    Here is the stylesheet I am using. I wonder if it is wrong if I am working with each current node:
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0"
         xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:output method="xml" indent="yes" />
    <xsl:variable name="saipCourseTemplates" />
    <xsl:param name="saipCourseTemplatesParam" />
         <xsl:template match="/enterprise">
              <enterprise xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="import_xml4.xsd">
                   <xsl:apply-templates select="courseTemplate" />
              </enterprise>
         </xsl:template>
         <xsl:template match="courseTemplate">
              <group recstatus="2">
                   <sourcedid>
                        <id>
                             <xsl:value-of select="sourcedId" />
                        </id>
                   </sourcedid>
                   <grouptype>
                        <typevalue level="4">Course Template</typevalue>
                   </grouptype>
                   <description>
                        <short>
                             <xsl:value-of select="sourcedId" />
                        </short>
                        <long>
                        <xsl:value-of select="catalogDescription/longDescription" disable-output-escaping="no" />
                        </long>
                   </description>
                   <relationship relation="1">
                   <sourcedid>
                   <id>Testing</id>
                   </sourcedid>
                   <label></label>
                   </relationship>
                   <extension>
                   <path></path>
                   </extension>
              </group>
         </xsl:template>
    </xsl:stylesheet>

  • FileName in ABAP XSLT Mapping

    Dear SDN,
    In an integration scenario we are using sender File Adapter and a  ABAP XSLT Mapping.
    Is there any way to get the source FileName from such mapping.  Im trying to use the adapter-specific message attributes, but it doesn't work, and I didn´t find an example, probably I and doing somthing wrong.
    regards,
    GP

    Thank you for your help,
    I just try to access the adapter-specific attibutes using:
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
    <xsl:variable name="filename"  select="key:create('http://sap.com/xi/XI/System/File', 'Directory')" />
    </xsl:stylesheet>
    but the following error raised:
    <SAP:Stack>Error while calling mapping program YXSLT_TEST (type Abap-XSLT, kernel error ID CX_XSLT_RUNTIME_ERROR) Call of unknown function</SAP:Stack>
    have you had this situation?

  • 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.
    />

Maybe you are looking for

  • Application Help

    Hi guys, I need help for an appilcation we have here at work. We have a stepmotor (HT23-398D-ZAA) that include a 2000cpr encoder with STR4 drive and a PCI-7334 controller board. We had a UMI-7774 but we broke it and we dont have time/money to invest

  • Problem in keyboard

    i have macbook pro and insall windows 7 but arabic keyboard on mac not in windows what shall i do for this problem

  • Indicator on previous tab opened?

    Is there a way to know which tab you last had open prior to the currently opened tab? Sometimes I have quite s few tabs up from the same website and it's easy to forget which tab was the last one you had open if you require to go straight back to it

  • Connecting iPod to new Powerbook without deleting all songs?

    I know that there's a button combination to hold when you connect your iPod to prevent from an auto-sync that erases everything on the iPod, but I cannot remember it. I'd look in the manual, but I lost it! Thanks a lot, I appreciate it! - Pat Francis

  • How to stop the 2nd thread when 1st thread caught exception.

    Hello Friends, I have written a java program using Thread. In this program i have created two separate threads. For example Thread1 and Thread2. During execution of both threads, If any exception comes on Thread1 or Thread2, the other thread should n