Xslt template mismatch

I could not really extract the values for Reference, Enquiry Type, Enquiry Sub-Type, Status and Sub-Status which should be
picked up from s5.
Is it because template match is set to <xsl:template match="/s4:ServiceRequest_Status_UpdateWithFullResponseResponse">
how can I rewrite the xslt so that s5 values are pulled out and assigned to Reference, Enquiry Type, Enquiry Sub-Type, Status and Sub-Status
xml:
<?xml version="1.0" encoding="UTF-16"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var"
    exclude-result-prefixes="msxsl var s2 s4 s3 s1 s0 s5"
    version="1.0"
    xmlns:s0="http://schemas.microsoft.com/2003/10/Serialization/Arrays"
    xmlns:s1="http://schemas.datacontract.org/2004/07/Project.DataContracts"
    xmlns:ns0="http://esb.xyz.gov.uk/email/2011/01"
        xmlns:s5="http://schemas.xyz.gov.uk/Project/canonical/1"
    xmlns:s2="http://schemas.xyz.gov.uk/WCF/Project/2013-10/"
    xmlns:s3="http://schemas.xyz.gov.uk/WCF/Project/2013-10/"
    xmlns:xhtml="http://www.w3.org/1999/xhtml"
    xmlns:types="http://esb.xyz.gov.uk/email/types/2011/01"
    xmlns:s4="http://schemas.xyz.gov.uk/WCF/Project/2013-10"
    xmlns:ScriptNS0="http://schemas.microsoft.com/BizTalk/2003/ScriptNS0">
  <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
  <xsl:template match="/">
    <xsl:apply-templates select="/s4:ServiceRequest_Status_UpdateWithFullResponseResponse" />
  </xsl:template>
  <xsl:template match="/s4:ServiceRequest_Status_UpdateWithFullResponseResponse">
   <xsl:variable name="var:v1" select="ScriptNS0:Read(&quot;Project&quot; , &quot;SupportEmailAddress&quot;)"/>
   <xsl:variable name="var:v2" select="ScriptNS0:Read(&quot;Project&quot; , &quot;SupportEmailName&quot;)"/>
   <xsl:variable name="var:v5" select="ScriptNS0:Read(&quot;Project&quot; , &quot;BusinessOtherEmailAddress&quot;)"/>
   <xsl:variable name="var:v6" select="ScriptNS0:Read(&quot;Project&quot; , &quot;BusinessOtherEmailName&quot;)"/>
   <ns0:Plain>
    <types:Subject>
     <xsl:text>BizTalk Warning: A Project Service Request could not be updated</xsl:text>
    </types:Subject>
    <types:DeliveryReceipt>
     <xsl:text>0</xsl:text>
    </types:DeliveryReceipt>
    <types:ReadReceipt>
     <xsl:text>0</xsl:text>
    </types:ReadReceipt>
    <types:From>
     <types:EmailAddress>
      <xsl:value-of select="$var:v1"/>
     </types:EmailAddress>
     <types:DisplayName>
      <xsl:value-of select="$var:v2"/>
     </types:DisplayName>
     <types:EmailAddress>
      <xsl:value-of select="$var:v5"/>
     </types:EmailAddress>
     <types:DisplayName>
      <xsl:value-of select="$var:v6"/>
     </types:DisplayName>
    </types:From>
    <types:To>
     <types:EmailAddress>
      <xsl:variable name="var:v3" select="ScriptNS0:Read(&quot;Project&quot; , &quot;BusinessEmailAddress&quot;)"/>
      <xsl:value-of select="$var:v3"/>
     </types:EmailAddress>
     <types:DisplayName>
      <xsl:variable name="var:v4" select="ScriptNS0:Read(&quot;Project&quot; , &quot;BusinessEmailName&quot;)"/>
      <xsl:value-of select="$var:v4"/>
     </types:DisplayName>
    </types:To>
    <types:CC>
     <types:EmailAddress>
      <xsl:value-of select="$var:v1"/>
     </types:EmailAddress>
     <types:DisplayName>
      <xsl:value-of select="$var:v2"/>
     </types:DisplayName>
    </types:CC>
    <types:Line>BizTalk could not update a Project Service Request that corresponds to the CRM Enquiry below.</types:Line>
    <types:Line></types:Line>
    <types:Line>
Reference: <xsl:value-of select="s5:ServiceRequests/s5:ServiceRequest/s5:Id/text()" />
    </types:Line>
    <types:Line>
Enquiry Type: <xsl:value-of select="s5:ServiceRequests/s5:ServiceRequest/s5:Area/text()"/>
    </types:Line>
    <types:Line>
Enquiry Sub-Type: <xsl:value-of select="s5:ServiceRequests/s5:ServiceRequest/s5:Sub-Area/text()"/>
    </types:Line>
    <types:Line>
Status: <xsl:value-of select="s5:ServiceRequests/s5:ServiceRequest/s5:Status/text()"/>
    </types:Line>
    <types:Line>
Sub-Status: <xsl:value-of select="s5:ServiceRequests/s5:ServiceRequest/s5:Sub-Status/text()"/>
    </types:Line>
   </ns0:Plain>
  </xsl:template>
</xsl:stylesheet>

Could you post an example input file? Thx
Glenn Colpaert - MCTS BizTalk Server - Blog : http://blog.codit.eu

Similar Messages

  • HTML from XSLT template truncated in BIP 10.1.3.4, as in 10.1.3.3.2

    Just upgraded BI Publisher from version 10.1.3.3.2 to 10.1.3.4.0 because I have some huge report designs due and they're not working because of bugs in BI Publisher. I'm still having the same major problems, which are:
    1) It still times out when producing moderately large Excel Analyzer files. Of course it waits 20 minutes before creating a completely useless file.
    2) When producing HTML output from an XSLT template, it truncates the output when it's more than one or two dozen pages. No error issued or anything. It just presents the bad output as if it's totally acceptable to make 'most' of the report. I mean, 80% is a B, right?
    I've been working with BI Publisher for two years and all the company users still hate it, and so does this developer. When are you going to stop robbing your customers by selling them crap?
    Sincerely,
    Multiverse.
    Edited by: Multiverse on Apr 16, 2009 4:25 PM

    YES! Yes, yes yes! You are the man! It worked in my stand-alone BI Publisher with your corrections also. I'm ecstatic.
    To review your changes, here's the diff output between my XSL file and yours:
    < <xsl:transform version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fo="http://www.w3.org/1999/XSL/Format"
    xmlns:ora="http://www.oracle.com/XSL/Transform/java/"
    xmlns:xdofo="http://xmlns.oracle.com/oxp/fo/extensions"
    xmlns:xdoxslt="http://www.oracle.com/XSL/Transform/java/oracle.apps.xdo.template.rtf.XSLTFunctions"
    xmlns:xdoxliff="urn:oasis:names:tc:xliff:document:1.1"
    xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:foo="http://www.oracle.com/xml/2.0">
    I omitted the other edit, which was to remove the call to the upper-case() function, which is defined in detail on W3.org here:
    http://www.w3.org/TR/xquery-operators/#func-upper-case
    Why does BIP not suppor this function? (Minor point.)
    The more important point is that you included references to all these other namespaces: fo, ora, xdofo, xdoxslt, xdoxliff, xlink.
    So you've sent me a beautifully prepared fish entree, but now I would like to learn how to fish.
    Where can I found out exactly what all these namespaces offer me? What interesting functions can I use?
    Also, is there any way to see in BI Pubisher when I've used an XSLT element incorrectly? As I've said, there was no way for me to tell where my template was failing because oraxsl processed the data correctly, but BI Publisher would not, and there was no error message.

  • XSLT template rule matching   ?

    I have a need to match XML elements containing   I am using [this trick|http://www.xml.com/pub/a/2001/03/14/trxml10.html] to preserve   during transformation, but unfortunately this means that ' ' appearing inside a match rule gets expanded to the corresponding piece of <xsl:text .../>, which then constitutes an illegal match rule.
    Any clues? I'm not totally clear on how XML entities work ...

    The   entity that you want is only meaningful in the external representation of the document. As that article says, the parser will convert it to U+00A0 and that's how it appears in your document. The same is true for your XSLT, since it's an XML document too. So the way to refer to it in XSLT is &#x00a0; or &#160; -- see [this xsl-list message|http://www.biglist.com/lists/xsl-list/archives/200012/msg00056.html].

  • Inline XSLT Call Template within Scripting Functoid logic needed

    In my Scripting Functoid, Config Functoid Script, Script type is Inline XSLT Call Template code is as follows.
    <xsl:template name="CanadaInformation">
    <xsl:param name="CanadaClientCd" />
    <xsl:param name="CanadaStatCd" />
    <xsl:element name="CanadaStatus">
       <xsl:choose>
          <xsl:when test="string-length($CanadaStatCd) > 0">
               <xsl:value-of select="$CanadaStatCd"/>
           </xsl:when>
           <xsl:otherwise>
               <xsl:value-of select="$CanadaClientCd"/>
           </xsl:otherwise>
        </xsl:choose>
       </xsl:element>
    </xsl:template>
    In this test case I think the Scripting Functoid is expecting 2 Parameters as input and in most cases the 2 input parameters will have data coming in, but in negative testing I have a case where the 2nd parameter is not passing any data (Value Mapping is
    coming from a Table lookup and the the input is blank, so the table lookup is not executed).
    Instead of trying to test for the length of the string of Parm 2 (which in the negative case there is no value for Parm2), I was wondering if there was a way to count the actual number of Parms being read into the XSLT. In the cases with my positive test,
    the number will be 2 and in the negative case, the number will be one.
    Or is there a way to confirm that there is something in the 2nd Parm.
    Thank you!

    I don't think there is a way count the number of parameter in XSLT (or even in any programing language's procedural calls). Where would execute the code/XSLT to check the count-With in your above "CanadaInformation" template?. What your looking for
    is something at engine level, i.e. is count the number of parameters being read and pass the control based on the number of parameters being read/passed.
    Or close option for this if you have something like overloaded functions/template. In XSLT we don't have anything like overloaded functions/templates.
    If you don't pass/link two parameter, you would error as "The number of inputs to the scripting functoid does not match with the number of inputs expected by the xsl:call-template"
    Your above code shall do the check for value of the parameter. Your code shall handle if "CanadaStatCd" is passed in or not. If you're considering other ways, you have some as follows:
    You can have "<xsl:when test="not($CanadaStatCd)">"- Which is same as parameter not being passed. So your code can be something like:
    <xsl:template name="CanadaInformation">
    <xsl:param name="CanadaClientCd" />
    <xsl:param name="CanadaStatCd" />
    <xsl:element name="CanadaStatus">
    <xsl:choose>
    <xsl:when test="not($CanadaStatCd)"> <!-- parameter has not been supplied -->
    <xsl:value-of select="$CanadaClientCd"/>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$CanadaStatCd"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:element>
    </xsl:template>
    Have a default values to your parameter and check whether the values are differernt from default values if values are passed in otherwise if the value are still default value, then no value are passed in. Something like:
    <xsl:template name="CanadaInformation">
    <xsl:param name="CanadaClientCd" />
    <xsl:param name="CanadaStatCd" select="'SomeDefaultValue'" /> <!-- SET default -->
    <xsl:element name="CanadaStatus">
    <xsl:choose>
    <xsl:when test="$prefix != 'default-value'">
    <xsl:value-of select="$CanadaStatCd"/>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$CanadaClientCd"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:element>
    </xsl:template>
    Have another scripting fuctiod before you call the above XSLT-template. Do the check at this scripting function and call the template based on the validation you do at this scripting functiod.
    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.

  • XSLT stylesheet template for Endeca Records

    Endeca Forge provides a Record Adapter which can load XML data, transformed (if required) to Endeca's XML record format by an XML Stylesheet Template (XSLT). This provides a way of getting XML into Endeca with a minimum of fuss, for data analysis, PoCs and for modest amounts of XML data in production applications.
    There was an XSLT template posted to Endeca Eden prior to the acquisition. The thread is still available at:
    http://eden.endeca.com/web/eden/forums/message_boards/message/99120
    Does anyone have a copy of the template?
    TG

    Hi TG,
    Template XSLT below. Its main feature is that it attempts to be XSLT-agnostic, other than identification of the start-record element/x-path. It could be optimized for specific XML structures, or modified to support more complex XML data.
    Note also the remarks about XSLT and larger XML data - as your XML source data gets larger, XSLT will become less attractive, and you'll want to implement a streaming or pull-parser approach (SAX, StAX).
    Best
    Brett
    <?xml version="1.0" encoding="utf-8"?>
    <!-- Copyright 2012 Oracle, Inc. All Rights Reserved. -->
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:output method="xml" indent="yes" doctype-system="records.dtd" />
         <!--
              ========== About this stylesheet ==========
              This is a generic stylesheet for transforming an XML file into the XML record format accepted by Endeca Forge.
              The stylesheet is designed to be reasonably agnostic about the source XML format: the main configuration required is to identify
              one or more repeating record elements in the source XML.  The stylesheet creates the root RECORDS element, enclosing one RECORD element for each
              repeating element.
              Each RECORD element is then assigned any number of PROP name-value pairs created for each property, with each PROP containing
              a NAME attribute and a PVAL.  The stylesheet effectively "flattens" the XML into a RECORD, recursively fetching sub-elements and creating
              properties named according to the hierarchical path (think XPath).
              ========== Stylesheet configuration ==========
              Add your base source repeating elements as an xpath selector at ADD RECORD SELECTORS HERE below.
              The default example in the template is "item", which suites an RSS 2.0 feed.
              By default, the template will use full path property names.  To change to simple property names, change the variable
              use-simple-prop-names below to true().
              You can also change the path dividers used in full property names - see path-divider and attribute-divider variables below.
              ========== Examples ==========
              The first example used is an RSS 2.0 feed (note that there are other Endeca adapters for this type of data).
              Using full property names, this will produce records with the following properties:
              rss_channel_item_title
              rss_channel_item_description
              rss_channel_item_link
              rss_channel_item_guid_@isPermaLink
              and so on.  With simple prop names, only the last part of the name is used (after the last _ or @).
              The second example (sample.xml and sample_records.xml) shows how nested repeating elements within a record are folded-down to
              a multi-value property.
         -->
         <!-- change select to true() to use simple prop names -->
         <xsl:variable name="use-simple-prop-names" select="false()" />
         <xsl:variable name="path-divider">
              <xsl:text>_</xsl:text>
         </xsl:variable>
         <xsl:variable name="attribute-divider">
              <xsl:text>_@</xsl:text>
         </xsl:variable>
         <xsl:template match="/">
              <xsl:element name="RECORDS">
                   <!-- apply templates for each "repeating element" representing a single record -->
                   <!-- ADD RECORD SELECTORS HERE -->
                   <xsl:apply-templates select="//item" />
              </xsl:element>
         </xsl:template>
         <!-- one template with RECORD element for each template type applied above -->
         <xsl:template match="item">
              <xsl:element name="RECORD">
                   <xsl:call-template name="leaves-auto-subpaths" />
              </xsl:element>
         </xsl:template>
        <!-- calls the prop template for each leaf -->
        <xsl:template name="leaves-auto-subpaths">
            <!-- select all attributes-->
            <xsl:for-each select="@*">
                <xsl:call-template name="prop" />
            </xsl:for-each>
            <!-- select all leaf nodes -->
            <xsl:for-each select="*[not(*) and . != '']">
                <xsl:call-template name="prop" />
            </xsl:for-each>
            <!-- auto recurse subpaths -->
            <xsl:for-each select="*[*]|*[@*]">
                <xsl:call-template name="leaves-auto-subpaths" />
            </xsl:for-each>
        </xsl:template>
        <!-- creates the PROP element and calls prop-name and prop-pval -->
        <xsl:template name="prop">
            <xsl:element name="PROP">
                 <xsl:if test="$use-simple-prop-names">
                      <xsl:call-template name="prop-name-simple" />
                 </xsl:if>
                 <xsl:if test="not($use-simple-prop-names)">
                      <xsl:call-template name="prop-name-full" />
                 </xsl:if>
                <xsl:call-template name="prop-pval" />                 
            </xsl:element>
        </xsl:template>
        <!-- creates the NAME element -->
        <xsl:template name="prop-name-simple">
            <xsl:attribute name="NAME">
                <xsl:value-of select="name()" />
            </xsl:attribute>
        </xsl:template>
        <!-- creates the NAME attribute -->
        <xsl:template name="prop-name-full">
            <xsl:attribute name="NAME">
                 <!-- walk from root to current node, print name and underscore  -->
                <xsl:for-each select="ancestor-or-self::*">
                    <xsl:value-of select="name()" />
                    <xsl:if test="position() != last()">
                        <xsl:value-of select="$path-divider" />
                    </xsl:if>
                </xsl:for-each>
                <!-- pick up attributes -->
                <xsl:if test="not(namespace::*)">
                    <xsl:value-of select="$attribute-divider" />
                    <xsl:value-of select="name()" />
                </xsl:if>
            </xsl:attribute>
        </xsl:template>
        <!-- creates the PVAL element -->  
        <xsl:template name="prop-pval">
            <xsl:element name="PVAL">
                <xsl:value-of select="." />
            </xsl:element>
        </xsl:template>
    </xsl:stylesheet>

  • Question about JSP, XSLT and JDOM

    hi, folks. Let's say within page1.jsp, i have <jsp:include page="page2.jsp" flush="true"> On the other hand, i have a servlet helper class which queries the database, then converts the ResultSet object into a JDOM Document object. My question is i want to make the transformed output of the JDOM Document and XSLT template to be a partial content of the page2.jsp page. How can i get this done properly? I have no problem of doing the transformation, but just dont know how to concatenate the output with the rest content of page2.jsp. Hope i clearly explained the question. Any advice is greatly appreciated.
    //code fragment on page2.jsp
    <td valign="top" width="788">
        <font size="3"><br>  
            <p>
           //i want put the transformed results here
           </p>
         </font>
    </td>

    this is a fragment of my testing program, which transform direct to response output stream. but i dont want put this bounch of java code within page2.jsp. do i some other way around to get it done?
    Document myDocument = createDocument();
                   TransformerFactory tFactory = TransformerFactory.newInstance();
                // Make the input sources for the XML and XSLT documents
                org.jdom.output.DOMOutputter outputter = new org.jdom.output.DOMOutputter();
                org.w3c.dom.Document domDocument = outputter.output(myDocument);
                javax.xml.transform.Source xmlSource = new javax.xml.transform.dom.DOMSource(domDocument);
                StreamSource xsltSource = new StreamSource(new FileInputStream("d:/tomcat/webapps/project/car.xsl"));
            //Make the output result for the finished document
                StreamResult xmlResult = new StreamResult(response.getOutputStream());
                //StreamResult xmlResult = new StreamResult(System.out);
            //Get a XSLT transformer
            Transformer transformer = tFactory.newTransformer(xsltSource);
            //do the transform
                transformer.transform(xmlSource, xmlResult);

  • XSLT Transform in XML Signature: Exception

    Hello,
    I have following problem with an XSLT tranform in my XML signature. Here is the code I use to add XSLT to signature:
    main() {
    DOMStructure stylesheet = new DOMStructure( getStylesheet() );
    XSLTTransformParameterSpec spec = new XSLTTransformParameterSpec( stylesheet );
    transforms.add( fac.newTransform( Transform.XSLT, spec ) );
    private Element getStylesheet() throws Exception {
         String stylesheet = //"<?xml version=\"1.0\"?>" +
                        "<xslt:stylesheet version=\"1.0\" xmlns:xslt=\"http://www.w3.org/1999/XSL/Transform\">\n" +
                        " <xsl:include href=\"http://extern XSLT\" />\n" +
                        " <xslt:template match=\"/\">" +
                        " <xsl:apply-imports />" +
                        " </xslt:template>" +
                        "</xslt:stylesheet>\n";
         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         //dbf.setValidating( true );
         return dbf.newDocumentBuilder().parse( new ByteArrayInputStream( stylesheet.getBytes() ) ).getDocumentElement();
    I get following exception:
    javax.xml.crypto.dsig.XMLSignatureException: javax.xml.crypto.dsig.TransformException: com.sun.org.apache.xml.internal.security.transforms.TransformationException: Cannot find xslt:stylesheet in Transform
    Original Exception was com.sun.org.apache.xml.internal.security.transforms.TransformationException: Cannot find xslt:stylesheet in Transform
         at org.jcp.xml.dsig.internal.dom.DOMReference.transform(Unknown Source)
         at org.jcp.xml.dsig.internal.dom.DOMReference.digest(Unknown Source)
         at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.digestReference(Unknown Source)
         at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.sign(Unknown Source)
    In google I cannot find any details what can be wrong.
    Any suggestions?
    Thanks in advance,
    errno

    Thanks for your response. Sorry - I tried both versions with xslt and xsl - doesn't worked -> the error in my post is actually caused through the multiple changes of this part of code. Here once again:
    private Element getStylesheet() throws Exception {
              String stylesheet = //"<?xml version=\"1.0\"?>" +
                                       "<xslt:stylesheet version=\"1.0\" xmlns:xslt=\"http://www.w3.org/1999/XSL/Transform\">\n" +
                                       " <xslt:include href=\"external XSLTl\" />\n" +
                                       " <xslt:template match=\"/\">" +
                                       " <xslt:apply-imports />" +
                                       " </xslt:template>" +
                                       "</xslt:stylesheet>\n";
              DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
              //dbf.setValidating( true );
              return dbf.newDocumentBuilder().parse( new ByteArrayInputStream( stylesheet.getBytes() ) ).getDocumentElement();
    Thanks,
    errno

  • Counter in XSLT processing

    Is there anyway to keep an incremental counter in an XSLT stylesheet? I would like to append this counter to several element names to maintain uniqueness.
    Thanks
    Kathy

    I can generated the number I want using xsl:number. However, I don't know how to include it as part of the element name I am trying to generate.
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    For example:
    <xsl:template match="DownlinkCellID_member">
    <xsl:number level="single" count="DownlinkCellID_member"/>
    <xsl:element name="DownlinkCellID{@index}">
    <xsl:value-of select="@value"/>
    </xsl:element >
    </xsl:template>
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    "index" is an attribute I included in the original XML file that I read and append to the element name. I would like to remove "index" from the original XML file and replace it's using in the xslt template with the output from xsl:number. How can I do this? Will it work if I create a variable?
    Thanks :-)

  • JAXP XSLT transformation UTF-8 issue

    Hi all,
    I have XML file generated from Java app. File is valid and is in UTF-8.
    I have XSLT template created with Altova StyleVision. Template is to produce RTF output file from above XML.
    I Java app there are two variant for XSLT transformation - with and without Saxon. I have simplified the code and it is almost the same in two variants.
    File outputFile = new File("path");
    *if (saxonToBeUsed) {*
    ClassLoader saxonClassLoader = SaxonLoader.getInstance(saxonPath);
    TransformerFactory transFact = TransformerFactory.newInstance("net.sf.saxon.TransformerFactoryImpl", saxonClassLoader); //$NON-NLS-1$
    Transformer trans = transFact.newTransformer(xsltSource);
    trans.setOutputProperty("encoding", "UTF-8"); //$NON-NLS-1$
    StreamResult res = new StreamResult(outputFile);
    trans.transform(xmlSource, res);
    *} else {*
    TransformerFactory transFact = TransformerFactory.newInstance();
    Transformer trans = transFact.newTransformer(xsltSource);
    trans.setOutputProperty("encoding", "UTF-8"); //$NON-NLS-1$
    StreamResult res = new StreamResult(outputFile);
    *// Same result -> StreamResult res = new StreamResult(new OutputStreamWriter(new FileOutputStream(outputFile), "UTF-8"));*
    *// Same result -> StreamResult res = new StreamResult(new PrintWriter(new OutputStreamWriter(new FileOutputStream(outputFile), "UTF-8")));*
    trans.transform(xmlSource, res);
    XML file contains Arabic or Chinese text. RTF is generated.
    When RTF and XML are opened with text editor or web browser Arabic/Chinese whatever text is readable.
    The issue is that when RTF is opened with MSWord/WordPad/Open Office Writer :
    - Saxon generation -> RTF file can be opened and Arabic/Chinese text is normal i.e readable. English language is readable too.
    - JAXP generation -> RTF file can be opened but Arabic/Chinese is scrabmbled, messed up. English language is readable.
    All three files (XML,XSLT,RTF) are in UTF-8
    I have installed Chinese and Arabic true type fonts. When I create manual MSWord doc i can write some of their symbols.
    Please suggest some solution.
    Thanks

    Hi jtahlborn,
    I found the difference between two RTFs. This is one table cell containing random Arabic text
    XSLT 1.0 generated:
    {\*\bkmkstart محمود_شمام_لرويترز:_القذافي_قتل_في_هجوم_للمجلس_الانتقالي}{\fs16 محمود شمام لرويترز: القذافي قتل في هجوم للمجلس الانتقالي}
    XLST2.0 generated:
    {\*\bkmkstart محمود_شمام_لرويترز:_القذافي_قتل_في_هجوم_للمجلس_الانتقالي} {\fs16\u1605?\u1581?\u1605?\u1608?\u1583?\u32?\u1588?\u1605?\u1575?\u1605?\u32?\u1604?\u1585?\u1608?\u1610?\u1578?\u1585?\u1586?\u58?\u32?\u1575?\u1604?\u1602?\u1584?\u1575?\u1601?\u1610?\u32?\u1602?\u1578?\u1604?\u32?\u1601?\u1610?\u32?\u1607?\u1580?\u1608?\u1605?\u32?\u1604?\u1604?\u1605?\u1580?\u1604?\u1587?\u32?\u1575?\u1604?\u1575?\u1606?\u1578?\u1602?\u1575?\u1604?\u1610?}
    But I don't know how to fix it. Both files are generated with Saxon, same Java code, only XSLTs are different.
    Any ideas ?

  • Xslt map in biztalk

    I am trying to use XSLT in map. I am struggling there as not much familiar .
    I created .xslt in visual studio and write required logic. Now I am trying to call it as xslt template . But when I try to do got error "There is not xsl:template node as root node". That is true in my case 
    I have it like this
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" exclude-result-prefixes="msxsl var s0 ScriptNS0
    ScriptNS1 userCSharp" version="1.0" xmlns:ns0="http://Zones._870.Internal870" xmlns:s0="http://schemas.microsoft.com/BizTalk/EDI/X12/2006" xmlns:ScriptNS0="http://schemas.microsoft.com/BizTalk/2003/ScriptNS0" xmlns:ScriptNS1="http://schemas.microsoft.com/BizTalk/2003/ScriptNS1"
    xmlns:userCSharp="http://schemas.microsoft.com/BizTalk/2003/userCSharp">
    <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
    <xsl:template match="/">
    <xsl:apply-templates select="/s0:X12_00401_870" />
    </xsl:template>
    <xsl:template match="/s0:X12_00401_870">
    If I try to male xslt:tempate as root node I got compile errors for namespace. Can somebody help me how I can call this in map?

    First, yourexample is incomplete, there appears to be no closing <xsl:stylesheet> element.  If this is just a sample, no problem.
    I you intendto use an entire Stylesheet in place of a designer generated Map, which appears to be the case, you do not call it as a Template with the Scripting Functoid.
    Instead, you set the Custom XSLT Path property of the Map (click on the designer surface) and point to the .xslt file. Then, you custom style sheet will be used instead of a generated stylesheet.

  • XSLT recursion changed direction from JDK1.4 to JDK1.5?

    We make use of XSLT template recursion, and when we tried to test our code with JDK 1.5, the recursion "changed direction". I believe some sort of optimization is taking place that's inappropriately switching around the order or something.
    Here's a test case:
    test-data.xml:
    <?xml version="1.0" encoding="utf-8"?>
    <rating>3</rating>test-temp.xml:
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet
        version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html"/>
    <xsl:template match="/">
    <html>
    <body>
    <xsl:call-template name="showRating">
    <xsl:with-param name="num" select="'1'"/>
    </xsl:call-template>
    </body>
    </html>
    </xsl:template>
    <!-- SHOW RATED STARS -->
    <xsl:template name="showRating">
       <xsl:param name="num"/>
        <xsl:if test="$num <= rating">
        <img border="0" src="yellow_star.gif" valign="absmiddle"/>
        </xsl:if>
        <xsl:if test="$num > rating">
        <img border="0" src="white_star.gif" valign="absmiddle"/>
        </xsl:if>
    <xsl:if test="$num <= '4'">
    <xsl:text>
    </xsl:text>  <!-- CRLF -->
    <xsl:call-template name="showRating">
    <xsl:with-param name="num" select="$num + 1" />
    </xsl:call-template>
    </xsl:if>
    </xsl:template>
    </xsl:stylesheet>testxslt.java:
    import java.io.*;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.*;
    public class testxslt {
      public static void main(String[] args) {
        try {
          new testxslt();
        catch(Throwable t) {
          System.err.println(t + ": " + t.getMessage());
          t.printStackTrace();
      private testxslt() throws Exception {
        String stylesheet = readFile("test-temp.xml");
        String data = readFile("test-data.xml");
        String out = transform(stylesheet, data);
        System.out.println(out);
      private String readFile(String filename) throws IOException {
        StringBuffer out = new StringBuffer();
        Reader r = new FileReader(filename);
        int count;
        char buf[] = new char[1024];
        while((count = r.read(buf)) > 0)
          out.append(buf, 0, count);
        r.close();
        return out.toString();
      private String transform(String stylesheet, String data) throws Exception {
        ByteArrayOutputStream resultStream = new ByteArrayOutputStream();
        StreamResult transStreamResult = new StreamResult(resultStream);
        Source xmlData = new StreamSource(new StringReader(data));
        StreamSource styleSource = new StreamSource(new StringReader(stylesheet));
        TransformerFactory tf = TransformerFactory.newInstance();
        Templates t = tf.newTemplates(styleSource);
        Transformer trans = t.newTransformer();
        trans.transform(xmlData, transStreamResult);
        return resultStream.toString();
    }If you run it with jdk1.4, the yellow stars will (correctly) print first. If you run it with JDK 1.5, the white stars will print first.
    WTF?

    More info: I downloaded xalan from xml.apache.org, and by adding xalan.jar to the classpath, I can get JDK1.5 to output the stars in the right order. So this appears to be some issue having directly to do with the XSLTC transformer.

  • Whether XI (3.0 /7.0)  Supports the XSLT 2.0 Version

    Hi,
        I  tried  to do the converting the Date Format using the XSLT (2.0 version) functions like  (MonthFromDate,YearFromDate,DayFromDate),but I am getting the Transformation Exception Error in the Interface Mapping.(i.e.  <b>javax.xml.transform.TransformerException: com.sap.engine.lib.xml.util.NestedException: -> com.sap.engine.lib.xml.util.NestedException: Function with name 'month-from-date' not found in context library</b>).
    In Stylus Studio that XSLT Mapping Program is Working Fine,but iam getting the error while testing the Interface mapping using that XSLT mapping program.
    Can you please give your valuable suggestions,
    Thanks and Rgss,
    Kamal Kumar

    XI XSLT processor doesn't support XSLT 2.0.
    You'll have to stick to XSLT 1.0 or implement your functionallity in a XSLT template or Java function and use it in XSLT with java enhancement.
    http://help.sap.com/saphelp_nw70/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/frameset.htm
    Regards,
    Henrique.

  • XSU XSLT and using xsl:include href=""

    I'm runing XDK 9.2 on an 8.1.7.4 database. I'm trying to transform the output of the XSU into a flat text file using a set of XSLT files. The main xslt includes the other xslt template files and then calls their templates by name as needed for different types of data in the XSU output.
    I have the main xslt in a table of BFILEs that I read from and pass to the DBMS_XMLQUERY.SETXSLT procedure as a CLOB. I get the following errors when I run the main procedure to generate the flat text file:
    oracle.xml.sql.OracleXMLSQLException: <Line 41, Column 35>: XSL-1002: (Error) Error while processing include XSL file (header.xslt).
    at oracle.xml.sql.query.OracleXMLQuery.setXSLT(OracleXMLQuery.java:818)
    at oracle.xml.sql.query.OracleXMLStaticQuery.setXSLT(OracleXMLStaticQuery.java:481)
    "header.xslt" is one of the included xslts. Is there some way to specify the other xslts? I have tried loading them into the BFILE table, but it still doesn't work.

    Hi I have tried out the code i.e. transforming a node and getting out a string representation. Following is code that works using JAXP apis.
    import javax.xml.parsers.*;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.*;
    import javax.xml.transform.dom.*;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    import java.io.*;
    public class XMLString {
    public void xmlInString(Document document) throws Exception{
    TransformerFactory tf = TransformerFactory.newInstance();
    Transformer transformer =
                   tf.newTransformer();
    StringWriter stWriter = new StringWriter();
    transformer.transform(new DOMSource(document), new StreamResult(stWriter));
    String strDOM = stWriter.toString();
    System.out.println("String dom");
    StringReader strIn = new StringReader(strDOM);
    BufferedReader buffIn = new BufferedReader(strIn);
    BufferedWriter bufOut = new BufferedWriter(new FileWriter("out.txt"));
    String out = null;
    while((out=buffIn.readLine()) != null){
    bufOut.write(out, 0, out.length());
    bufOut.flush();
    bufOut.close();
    public static void main(String args[]){
    try{
    XMLString strXML = new XMLString();
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    InputSource inputSource = new InputSource("input.xml");
    Document doc = db.parse(inputSource);
    strXML.xmlInString(doc);
    }catch(Exception e){
    System.out.println(e.getMessage());
    e.printStackTrace();
    I am using the xalan and xerces versions that come with the Java XML Winter pack from sun's website. The problem could lie with the underlying transformation processor you are using. It may not support transforming to a string or it could have a bug. So my advice is to find out what version transformation processor you are using. And look at the vendor's documentation to find any reference to this feature. Otherwise try using the Java XML Winter pack.

  • Unable to stack 3850, platform mismatch

    Hi,
    When a few switches are stacked, during the boot one of them states an error:
    Switch X has a platform mismatch with the stack. Only on changing to a compatible bandwidth mode will the switch join
    When booted, show switch command output in master switch states that switch X is in waiting mode, that means that it doesn't participate in stack master election.
    The reason is that switches are in different booting mode, for example the first one is in bundle and another is in installed.
    When boot mode is changed to the same on both switches, stacking is successful.
    Anyone knows why?
    Vainius

    Hi,
    Take a look at this:
    Auto-Advise
    The auto-advise feature is triggered when:
    The auto-upgrade feature is disabled.
    The new switch is in bundle mode and the stack is in installed mode. Auto-advise displays syslog messages about using the software auto-upgrade privileged EXEC command to change the new switch to installed mode.
    The stack is in bundle mode. Auto-advise displays syslog messages about booting the new switch in bundle mode so that it can join the stack.
    An auto-upgrade attempt fails because the new switch is running incompatible software. After the switch stack performs compatibility checks with the new switch, auto-advise displays syslog messages about whether the new switch can be auto-upgraded.
    Auto-advise cannot be disabled. It does not give suggestions when the switch stack software and the software of the switch in version-mismatch (VM) mode do not contain the same license level. Examples of Auto-Advise Messages
    Examples of Auto-Advise Messages
    Auto-Upgrade Is Disabled and Incompatible Switch Attempting to Join: Example
    This sample auto-advise output shows the system messages displayed when the auto-upgrade feature is disabled and an incompatible switch 1 tries to join the switch stack:
    *Oct 18 08:36:19.379: %INSTALLER-6-AUTO_ADVISE_SW_INITIATED: 2 installer:  Auto advise initiated for switch 1
    *Oct 18 08:36:19.380: %INSTALLER-6-AUTO_ADVISE_SW: 2 installer:  Searching stack for software to upgrade switch 1
    *Oct 18 08:36:19.382: %INSTALLER-6-AUTO_ADVISE_SW: 2 installer:  Switch 1 with incompatible software has been
    *Oct 18 08:36:19.382: %INSTALLER-6-AUTO_ADVISE_SW: 2 installer:  added to the stack. The software running on
    *Oct 18 08:36:19.382: %INSTALLER-6-AUTO_ADVISE_SW: 2 installer:  all stack members was scanned and it has been
    *Oct 18 08:36:19.382: %INSTALLER-6-AUTO_ADVISE_SW: 2 installer:  determined that the 'software auto-upgrade'
    *Oct 18 08:36:19.382: %INSTALLER-6-AUTO_ADVISE_SW: 2 installer:  command can be used to install compatible
    *Oct 18 08:36:19.382: %INSTALLER-6-AUTO_ADVISE_SW: 2 installer:  software on switch 1.
    Auto-Upgrade is Disabled and New Switch is in Bundle Mode: Example
    This sample auto-advise output shows the system messages displayed when auto-upgrade is disabled and a switch running in bundle mode tries to join the stack that is running in installed mode:
    *Oct 18 11:09:47.005: %INSTALLER-6-AUTO_ADVISE_SW_INITIATED: 2 installer:  Auto advise initiated for switch 1
    *Oct 18 11:09:47.005: %INSTALLER-6-AUTO_ADVISE_SW: 2 installer:  Switch 1 running bundled software has been added
    *Oct 18 11:09:47.005: %INSTALLER-6-AUTO_ADVISE_SW: 2 installer:  to the stack that is running installed software.
    *Oct 18 11:09:47.005: %INSTALLER-6-AUTO_ADVISE_SW: 2 installer:  The 'software auto-upgrade' command can be used to
    *Oct 18 11:09:47.005: %INSTALLER-6-AUTO_ADVISE_SW: 2 installer:  convert switch 1 to the installed running mode by
    *Oct 18 11:09:47.005: %INSTALLER-6-AUTO_ADVISE_SW: 2 installer:  installing its running software.
    SDM Template Mismatch in Switch Stacks
    All stack members use the Switch Database Management (SDM) template configured on the active switch. When a new switch is added to a stack, the SDM configuration that is stored on theactive switch overrides the template configured on an individual switch.
    You can use the show switch privileged EXEC command to see if any stack members are in SDM-mismatch mode.
    Version-mismatch (VM) mode has priority over SDM-mismatch mode. If a VM-mode condition and an SDM-mismatch mode exist, the switch stack first attempts to resolve the VM-mode condition.
    http://www.cisco.com/en/US/partner/docs/switches/lan/catalyst3850/software/release/3se/consolidated_guide/configuration_guide/b_consolidated_3850_3se_cg_chapter_01101101.html#concept_9822D98C2D4F4A318E0799B7687218B2
    Hope this helps..!

  • How to replace one double quotes with two double quotes in XSLT

    How can I replace one double quote to a two double quote in a string in XSLT
    I am passing the parameter string to XSLT template contains the value as
    <xsl:variable name="Description">Hi! "How are you</xsl:variable>
    <xsl:variable name="VQuotes">""</xsl:variable>
    I nead the output as
    Hi! ""How are you.
    Tried with Translate function, but it did not work out
    <xsl:element name="DESCRIPTION_SHORT">
              <xsl:value-of select="translate($Description,'&quot;', VQuotes)" />
            </xsl:element>But it is giving the same result as Hi! "How are you
    When I tried with
    <xsl:element name="DESCRIPTION_SHORT">
              <xsl:value-of select="translate($Description,'&quot;', 'BB')" />
            </xsl:element>
    It gave the result as
    Hi! BHow are you.
    It is replacing only one character with one. how to make it for two characters.
    Am I doing anything wrong in syntax?
    Please help.
    Regards, Vignesh S

    Hi Vignesh,
    Try this.
    Its a two step process:
    Step1: Add the following template would be "called" to do the replacement as your want:
    <xsl:template name="string-replace-all">
    <xsl:param name="text" />
    <xsl:param name="replace" />
    <xsl:param name="by" />
    <xsl:choose>
    <xsl:when test="contains($text, $replace)">
    <xsl:value-of select="substring-before($text,$replace)" />
    <xsl:value-of select="$by" />
    <xsl:call-template name="string-replace-all">
    <xsl:with-param name="text"
    select="substring-after($text,$replace)" />
    <xsl:with-param name="replace" select="$replace" />
    <xsl:with-param name="by" select="$by" />
    </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$text" />
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    Step2: Call the above templeate in the place where you want to call, like this:
    <!--Define the variables-->
    <xsl:variable name="Description">Hi! "How are you</xsl:variable>
    <xsl:variable name="sQuotes">"</xsl:variable>
    <xsl:variable name="VQuotes">""</xsl:variable>
    <!--Following call the template which you have defined in step1-->
    <xsl:element name="DESCRIPTION_SHORT">
    <xsl:variable name="myVar">
    <xsl:call-template name="string-replace-all">
    <xsl:with-param name="text" select="$Description" />
    <xsl:with-param name="replace" select="$sQuotes" />
    <xsl:with-param name="by" select="$VQuotes" />
    </xsl:call-template>
    </xsl:variable>
    <xsl:value-of select="$myVar" />
    </xsl:element>
    I have tested this and works. And outputs as the following with two-double quote as you want.
    <DESCRIPTION_SHORT>Hi!
    ""How are you</DESCRIPTION_SHORT>
    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.

Maybe you are looking for

  • Some songs no longer exist on ipod, but do on itunes

    Hello, I don't know when it started (maybe 6 months), but my iPod doesn't syncronize as well as before. Now, some songs that I could see and listen before no longer exist. Of course, they still appear on iTunes. My albums are incomplete. I've tried t

  • Is it Possible to import an IDoc type from R/3 into APO system

    Hi Gurus , Could you please guide if we can import an IDoc type from R/3 system to APO system ?? If yes , can you please give the guidelines / step - by - step procedure for this. Thanks in advance , Roseline

  • Reader X, XI & Forms

    I currently have the following installed: * Adobe Reader X (10.1.3) * Adobe Acrobat Professional 8 I was given a PDF form to update which I've done so. If I open it in Adobe Reader X, I can fill in the form and save it, as show here: http://forums.ad

  • Check and fix

    Where possible, utilize Enterprise Manager Framework Security Functionality. Enterprise Manager Framework security employs secure communication between the various Enterprise Manager Components, i.e., HTTPS between management agents and management se

  • Brush Tool and Viewing the Feathering Outline in the Cursor

    Hello, I am finding that when I use the brush tool, for example when modifying a mask, that the cursor is NOT showing me the feathering outline of the brush. This is starkly different than the view of brushes in ACR and in Lightroom where I can see