Embedding xsl template

Hello guys,
I wrote a little app that will turn an xml file into one with a different format, using an xsl template.
Is it possible to embed this template in the code of the app?
I think it would be easier to distribute this way.
How can I achieve this?

Okay, thanks, I think I managed to include the file in the jar file.
However the app doesn't seem to be working anymore.
I reference the xsl template in the source code like this:
Templates template = factory.newTemplates(new StreamSource(new FileInputStream(xslFilename)));This won't work anymore when included
how should i be referencing it when included in the jar?
Edited by: vampke on Mar 3, 2008 2:14 AM

Similar Messages

  • Embedding XSL in XML document

    Hi
    I am new to this particular forum. I had some query regarding embedding XSL .
    Can we embedd the XSL stylesheet in the XML document itself.
    I searched this forum and got some similar queries but the output isn't working. Can anyone put a working example.
    I have got the following XSL stylesheet:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <body>
    <table border="1" width="100%" cellpadding="1">
    <tr bgcolor="#FFFF99">
    <th style="font-family:arial unicode ms;font-size:100%" align="center">Serial number </th>
    <th style="font-family:arial unicode ms;font-size:100%" align="center">Site number </th>
    </tr>
    <xsl:for-each select="Master/RECORD">
    <xsl:if test="SR_NO &gt; 0">
    <tr>
    <td style="font-family:arial unicode ms;font-size:80%" align="right"><xsl:value-of select="SR_NO"/></td>
    <td style="font-family:arial unicode ms;font-size:80%" align="right"><xsl:value-of select="ACR_SNO"/></td>
    </tr>
    </xsl:if>
    </xsl:for-each>
    </table>
    </body>
    </xsl:template>
    </xsl:stylesheet>
    The XML document is as below:
    <?xml version="1.0" encoding="utf-8"?>
    <?xml-stylesheet type="text/xsl" href="archivingmaster.xsl"?>
    <Master>
    <RECORD>
    <SR_NO>1</SR_NO>
    <ACRSNO>1</ACR_SNO>
    </RECORD>
    <RECORD>
    <SR_NO>2</SR_NO>
    <ACRSNO>2</ACR_SNO>
    </RECORD>
    </Master>
    Thanks in advance
    Ameya.

    I have already gone through that link and searched for this on the net. But it doesn't seem to work on my Mozilla Firefox browser.
    Can anybody put a working example if possible.
    Thanks
    Ameya.

  • Anyone can help?Trying to know the name of a Contract Terms xsl template

    I am trying to change some of the data fields in a Contract. It is not in the Contract Terms part, but in the first page, when I view the Contract via 'Purchase Order' Form > Terms > View Contract Terms and then select Preview Contract. There appears to be three parts, the first page that has the Contractors name, address, tele and email, then the PO on the next page then the Contract Terms on the following pages. It is the address data on the first page (which is taken from the 'Bill-To' on the PO) that I am trying to get from another data source (the DFF on the PO).
    1) What is the name of the xsl template for this first page?
    2) In order to customise this first page, to bring further data into the XML, how is this possible? I understand that the XML is created 'on the fly' and its not possible to obtain this, but is there any way of customising the fields that are put into this XML?
    prasanna
    Edited by: prasamb on Jul 27, 2009 7:58 AM

    xsl template is PO_STANDARD_XSLFO.xsl
    u must know how to code in xsl also
    u can not modify seeded xsl ,so you need to create new xsl-fo template
    Thanks
    Rahul

  • Problem with xsl:template and call-template

    Hi
    in XSQL i am getting one row like this
    <REASON_FOR_REJECTION>1.Overhead line is not existing in front of the premises,2.The distance from the pole to the serice is more than 30 meters.,3.Another service is existing in the same premises with arrears.</REASON_FOR_REJECTION>
    In the above String for every comma i want to put <br>
    the output should come like this:
    1.Overhead line is not existing in front of the premises
    2.The distance from the pole to the serice is more than 30 meters.
    3.Another service is existing in the same premises with arrears
    i have written xsl like this;i am getting this error;
    XSQL-011: Error processing XSLT stylesheet: ../xsl/CMS48_RejectionLetter1.xsl
    (Error) Template 'ROWSET/ROW/REASON_FOR_REJECTION' invoked but not defined.
    wat's wrong with this code?
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:java="http://xml.apache.org/xslt/java" exclude-result-prefixes="java" version="1.0">
    <xsl:template match="/">
    <html>
    <body Class='Ecrm_Body'>
    <xsl:apply-templates/>
    </body>
    </html>
    </xsl:template>
    <xsl:template match="ROW">
    <p>
    <xsl:apply-templates select="REASON_FOR_REJECTION"/>
    </p>
    </xsl:template>
    <xsl:template match="REASON_FOR_REJECTION">
         <xsl:param name="REASON_FOR_REJECTION"/>
    <xsl:variable name="year"
    select="substring-before(.,',')"/>
    <xsl:choose>
    <xsl:when test="string-length($year) > 0">
    <td><xsl:value-of select="$year"/></td>
         <xsl:call-template name="ROWSET/ROW/REASON_FOR_REJECTION">
    <xsl:with-param name="REASON_FOR_REJECTION">
              <xsl:value-of select="substring-after($REASON_FOR_REJECTION,',')"/>
    </xsl:with-param>
    </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
    <td><xsl:value-of select="$REASON_FOR_REJECTION"/></td>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    </xsl:stylesheet>

    <xsl:call-template name="ROWSET/ROW/REASON_FOR_REJECTION">
    This looks for a template defined like this:
    <xsl:template name="ROWSET/ROW/REASON_FOR_REJECTION">
    not one defined like this:
    <xsl:template match="ROWSET/ROW/REASON_FOR_REJECTION">

  • Problem with xsl:template

    Hi
    in XSQL i am getting one row like this
    <REASON_FOR_REJECTION>1.Overhead line is not existing in front of the premises,2.The distance from the pole to the serice is more than 30 meters.,3.Another service is existing in the same premises with arrears.</REASON_FOR_REJECTION>
    In the above String for every comma i want to put <br>
    the output should come like this:
    1.Overhead line is not existing in front of the premises
    2.The distance from the pole to the serice is more than 30 meters.
    3.Another service is existing in the same premises with arrears
    i have written xsl like this;i am getting this error;
    XSQL-011: Error processing XSLT stylesheet: ../xsl/CMS48_RejectionLetter1.xsl
    (Error) Template 'ROWSET/ROW/REASON_FOR_REJECTION' invoked but not defined.
    wat's wrong with this code?
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:java="http://xml.apache.org/xslt/java" exclude-result-prefixes="java" version="1.0">
    <xsl:template match="/">
    <html>
    <body Class='Ecrm_Body'>
    <xsl:apply-templates/>
    </body>
    </html>
    </xsl:template>
    <xsl:template match="ROW">
    <p>
    <xsl:apply-templates select="REASON_FOR_REJECTION"/>
    </p>
    </xsl:template>
    <xsl:template match="REASON_FOR_REJECTION">
         <xsl:param name="REASON_FOR_REJECTION"/>
    <xsl:variable name="year"
    select="substring-before(.,',')"/>
    <xsl:choose>
    <xsl:when test="string-length($year) > 0">
    <td><xsl:value-of select="$year"/></td>
         <xsl:call-template name="ROWSET/ROW/REASON_FOR_REJECTION">
    <xsl:with-param name="REASON_FOR_REJECTION">
              <xsl:value-of select="substring-after($REASON_FOR_REJECTION,',')"/>
    </xsl:with-param>
    </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
    <td><xsl:value-of select="$REASON_FOR_REJECTION"/></td>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    </xsl:stylesheet>

    i made this change <xsl:call-template name="ROWSET/ROW/REASON_FOR_REJECTION"> to <xsl:call-template name="REASON_FOR_REJECTION"> and
    <xsl:template match="ROWSET/ROW/REASON_FOR_REJECTION"> to
    <xsl:template name="ROWSET/ROW/REASON_FOR_REJECTION"> ;
    but it is not going into 2nd template whyy??

  • Xsl:template in insert-request

    Hi all
    I try to use <xsl:call-template >
    in the transform page that is being call from <xsql:insert-request> but I get an error
    <xsql-error action="xsql:insert-request"><message>XSL-1049: Template '' invoked but not defined.</message></xsql-error>
    i need to call template because I need to run on a string and tokenize it, so I have use to template with recursion
    does anyone has a clue
    null

    hi Jinyu
    the xsl is
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <ROWSET xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0">
    <xsl:choose>
    <xsl:when test="string-length(STORIES/STORY/TICKER) >0">
    <xsl:message> before call</xsl:message>
    <xsl:call-template select="tokinze"/>
    <xsl:message> AFTER call</xsl:message>
    </xsl:when>
    </xsl:choose>
    <xsl:template name="tokinze">
    <xsl:message> In Tokinze</xsl:message>
    <ROW>
    <REPOSITORY_ID><xsl:value-of select="concat('reuters','$thedate',../@repository_id)"/></REPOSITORY_ID>
    <SEQ><xsl:value-of select="position()"/></SEQ>
    <RSM_ATTRIBUTE>ticker</RSM_ATTRIBUTE>
    <RSM_VALUE1><xsl:value-of select="../TICKER"/></RSM_VALUE1>
    <RSM_PUBLISH>0</RSM_PUBLISH>
    </ROW>
    </xsl:template>
    </ROWSET>
    and what i need to do is to token the string
    that i get in the TICKER field thats' why i need to use
    recursion
    thanks

  • xsl:template match="UL/LI|ul/li" has extra space line

    <xsl:template match="UL/LI|ul/li">
    <fo:list-item>
    <fo:list-item-label end-indent="label-end()">
    <fo:block>&#x2022;</fo:block>
    </fo:list-item-label>
    <fo:list-item-body start-indent="body-start()">
    <fo:block>
    <xsl:apply-templates select="*|text()"/>
    </fo:block>
    </fo:list-item-body>
    </fo:list-item>
    </xsl:template>
    how to delete the extra space line at the end of list?

    <xsl:template match="UL/LI|ul/li">
    <fo:list-item>
    <fo:list-item-label end-indent="label-end()">
    <fo:block>&#x2022;</fo:block>
    </fo:list-item-label>
    <fo:list-item-body start-indent="body-start()">
    <fo:block>
    <xsl:apply-templates select="*|text()"/>
    </fo:block>
    </fo:list-item-body>
    </fo:list-item>
    </xsl:template>
    how to delete the extra space line at the end of list?

  • Xml file with embedded xsl reports unknow error: An unknown error has occurred (805303f4)

    Hi,
    I have an xml file with embedded xsl link like below :
    XML :
    <pre><nowiki><?xml version="1.0" encoding="ISO-8859-1"?>
    <?xml-stylesheet type="text/xsl" href="http://abc.com/x.xsl"?>
    <catalog>
    <cd>
    <title>Empire Burlesque</title>
    <artist>Bob Dylan</artist>
    <country>USA</country>
    <company>Columbia</company>
    <price>10.90</price>
    <year>1985</year>
    </cd>
    </catalog></nowiki></pre>
    When opening xml file on IE, opera, safary ... it works ok. But when opening it on FireFox, i have an error like :
    Error loading stylesheet: An unknown error has occurred (805303f4)
    http://abc.com/x.xsl
    How could i solve this problem ?

    A good place to ask questions and advice about web development is at the mozillaZine Web Development/Standards Evangelism forum.
    The helpers at that forum are more knowledgeable about web development issues.
    You need to register at the mozillaZine forum site in order to post at that forum.
    See http://forums.mozillazine.org/viewforum.php?f=25

  • Problem exporting to excel when using embedded web templates through WAD

    Using web templates designed with WAD, we are experiencing an issue when trying to export excel when using embedded web templates. 
    We have set up tabstrips within our templates that load other templates (embedded into the global template). 
    Upon right clicking on any query and choosing "Export to Excel", any query that is in one of the tabs using the embedded web template item does not show up.  Any queries in natively in the global web template will export and show up fine.
    Any thoughts on how to enable something like this, or workarounds to make this work?  We decided to split up these templates for performance reasons and can't go back from that decision.  Also let me know if you need a better explanation of what we're trying to do.
    Thanks in advance!
    Jonathan

    Hi SDBI,
    Is this in place of loading a new template per tab?  We are using container layouts in all of our templates so we can link things into tabstrips as well, we have just split up some templates to be embedded into tabs for performance reasons and data locking.
    Also when exporting, we are looking for all of the items displayed at that time to be exported, however only the items from the global template show up, not all of the displayed queries.  For example, anything outside of the tabstrip will export perfectly, but since the query embedded into the template the tabstrip is loading is not part of the native web template, it does not show up.
    Seems like a tool limitation to me when embedding templates?
    Thanks,
    Jon

  • Diff. bet. xsl template and rtf template!

    Hi,
    I need to know the difference between xsl template and rtf template.
    Thank you,
    Regards,
    Vishnu

    Hi,
    My 2 cents:
    You can easily customize a new infoobject created from a template.
    An IO created as a reference to the other IO is not customizable at all. It has no its own properties and master data. It uses the referenced infoobject's properties and master data. It means that you cannot even load master data for this new referenced IO.
    Best regards,
    Eugene

  • Problem applying XSL template for Hash calculation.

    Hi,
    This may not be exactly a Java problem,
    I got a problem removing whitespaces in XML via XSL.
    My XSL:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:ns1="http://www.serverurl.inf/patterns/dss/schemas">
         <xsl:output method = "text" indent="no" encoding="ISO-8859-1"/>
         <xsl:strip-space elements="*"/>
    <xsl:template match="/"><xsl:value-of select="normalize-space(/ns1:messageDSS/ns1:header)"/>
    <xsl:value-of select="normalize-space(/ns1:messageDSS/ns1:body)"/>
    </xsl:template>
    </xsl:stylesheet>This XSL woks fine until I got Strings with duplicate spaces within, like:
    <!-- xml fragment -->
       <ns1:tagA>Aaa Aaa</ns1:tagA>     <ns1:tabB>Bb Bbb</ns1:tagB>
       <!-- will be transformed to:  Aaa AaaBb Bbb -->
       <ns1:tagC>Cc  ccc</ns1:tagC>   <ns1:tagD>Ddd    DD</ns1:tagD>
       <!-- will be transformed to: Cc cccDdd DD -->
       <!-- but should be transformed to: Cc  cccDdd    DD -->
       <!-- the within string repeating spaces are removed, and this is not what I want. -->Thanks for any help.

    I don't think XSLT/XPath 1.0 has any built-in or easily accessible way to trim the strings the way you want. With XSLT/XPath 2.0 you can use replace(foo, '^\s+|\s+$', ''). With XSLT/XPath 1.0 you will need to check whether an extension function supported by your XSLT processor allows a similar regular expression based replacement or you will need to write your own template trimming the spaces.

  • Error in processing XSL template

    Hi I am trying to build an report by using XSL template in BI Publisher 10g integrated with siebel. When i uploaded the template to run the report I am getting the following error
    Caused by: oracle.xdo.parser.v2.XPathException: variable not defined: ' _XDONFSEPERATORS'
    at oracle.xdo.parser.v2.XSLStylesheet.flushErrors(XSLStylesheet.java:1534)
    at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:521)
    at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:489)
    at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:271)
    at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:155)
    at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:192)
    ... 49 more
    Please help me out with this issue
    Thanks

    Do not enter the line number and also do not enter the doc total on the header.  B1 will calculate this based on line totals.
    RecordKey--DocEntry--CardCode-DocDate--DocNum-DocTotal--
    DocType
    1--C000120090610-10--
    dDocument_Service
    For Document_Lines
    RecordKey-----LineNumAccountCode--TaxCode--
    LineTotal
    1--1010101001V4--
    10000

  • How to create a excel files  XSL templates

    Hello,
    I want to create a excel file, and i started doing it using POI library, but that it's very hard, and I want a way to create excell files using xsl templates.
    I think that you can do it using apache cocoon, but i don't know how do it. Anyone has done it?
    Thanks

    Check out SsTemplates Spreadsheet Templates for Excel. We release this software a couple months ago based on work that we have done at Carbon Five. It has made working with POI to produce Excel documents in a Java environment an easy part of our development process.
    SsTemplates builds upon the Jakarta POI/HSSF libraries for writing Microsoft Office documents by providing a simple XML templating language for creating Excel documents similar to creating HTML pages with JSP and CSS.
    It's open source and available for download from SourceForge. You can read all about it at http://carbonfive.sourceforge.net/sstemplates/.

  • Strange XSLT Behavior: xsl:template match

    Hello I found the following strange XSLT behavior when using xsl:template. I only want to read the content of the element /Source/Surname/Details. Therefore I match this path using xsl:template match.
    What is strange that in the target message also the value of the Element LastName is written at the end. Please see example below. This is just a short example to point out the problem. I have a bigger message structure where I have to match a similar path. How can I avoid the the value of the FullDetails is just written at the end (not even beeing in an element)? I would have expected that the path is only matched once and the instructions then executed without <LastName> beeing even touched.I used XML Spy for this test.
    Here is an example:
    Source message:
    <?xml version="1.0" encoding="UTF-8"?>
    <Source>
         <Surname>
              <Details>MyFirstName</Details>
         </Surname>
         <LastName>
              <FullDetails> MyLastName </FullDetails>
         </LastName>
    </Source>
    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">
    <xsl:template match="/Source/Surname">
    <PORR>
    <Name><xsl:value-of select="Details"/></Name>
    </PORR>
    </xsl:template>
    </xsl:stylesheet>
    Target Message
    <?xml version="1.0" encoding="UTF-8"?>
    <PORR xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <Name>MyFirstName</Name></PORR>MyLastName
    Edited by: Florian Guppenberger on Oct 8, 2009 4:35 AM
    Edited by: Florian Guppenberger on Oct 8, 2009 4:36 AM
    Edited by: Florian Guppenberger on Oct 8, 2009 4:36 AM
    Edited by: Florian Guppenberger on Oct 8, 2009 4:37 AM

    Hi,
    I am not sure why your XSLT behaving like that,please try this XSL,what i did chnages is Templete match /*,I given exact path in Value of select,.
    <?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">
    <xsl:template match="/*">
    <PORR>
    <Name><xsl:value-of select="/Source/Surname/Details"/></Name>
    </PORR>
    </xsl:template>
    </xsl:stylesheet>
    Regards,
    Raj

  • What is     xsl:template match="/TxTemplate" used for?

    I have the following lines of code from the beginning of my html.
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html" />
    <xsl:template match="/TxTemplate">
    Does anyone know what <xsl:template match="/TxTemplate"> does or how template match is used?

    If my XML data instance is like this:
    <?xml version="1.0"?>
    <records>
    <record id="1">
    <column name="X">data goes in here</column>
    <column number="Y">more data goes here</column>
    </record>
    <!-- More records go here -->
    </records>
    I might make a XML stylesheet like this:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html" />
    <xsl:template match="records">
    <xsl:apply-templates/>
    </xsl:template>
    <xsl:template match="record">
    <xsl:apply-templates/>
    </xsl:template>
    <xsl:template match="columns">
    <!-- XSL processing stuff goes here; possible HTML conversion -->
    </xsl:template>
    The XSL template element (e.g. <xsl:template match="record">) is used to match XML elements in the instance and execute processing.

Maybe you are looking for

  • Apps wont open, need 2 install CD

    ohhh wise one, when a system is unstable and even finder wont start (due to Magnfique app for example which is not compatible with SL) how do i *force my mac mini to open and run directy from the installation cd* inserted in orderto re-install SL and

  • Biztalk custom send pipeline Using memory stream

    Hi friends, I developing the custom send pipeline,I am calling the custom helper class.The helper class I am using the Memory stream. The helper class method is looks like: public MemoryStream UpdateProcess(MemoryStream ms) In the pipeline i need to

  • How do I make elements 10 recognize my email program

    I use Postbox Express for emails in Windows7. elements won't recognize it when I try to send an email from within elements. I submited a test email and received a verification code but it still doesn't work.

  • LSMW, to upload material sales long text , MM02

    Hi I have not been able to upload long the long text of the material master record related to view Sales text (see tcode MM02). The upload should use the tcode LSMW, below is the steps that I used to create my LSMW codes: Step 1: Maintain Object attr

  • How can I view live videos supported with adobe flash on my IPad2?

    Need help viewing live videos supported with adobe flash.