XSLT file with process_data values

Hi there,
I have a process that takes in an XML file and some XSLT in another document variable and some process_data values from the main process.
Inside this process I would like to invoke the XSLT on the XML and use the process_data values inside the XSLT. This works fantastic if I use the "template" setting for the XSLT and add some XSLT code like: <xsl:apply-templates select="{$/process_data/variableA$}.
but if I copy the template and paste it in a xsl-file and tries to give this as input to the process I just get an "javax.xml.TransformerException: A location path was expected, but the following token was encountered: {".
I know what the exception means, but how do I avoid this, so I can just create my XSLT (with the references to process_data) and make it work with the XSLT file as an input?
I hope that someone has a take on this issue - as it is actually a general question on all services that can use a template...
Thanks in advance
Kim Christensen
Dafolo A/S
Denmark

That cannot be done because, your external XSLT file will not be resolved againts the XPATH expressions mentioned within it.
Alternatively you can update the XPATH content using SetValue activity.
Templates values are always resolved.
Nith

Similar Messages

  • Importing a text file with variable values into web reporting

    Hello,
    I'm looking for a possibility to import values from a text file into a variable selection in Web reporting.
    With BEx reporting in Excel this is possible, by clicking on the multiple selection button in the variable popup screen, and subsequently selecting the "Import from Text file" button.
    However, this function seems not to be available for web-reporting...
    It would be great if someone could help me out with this!
    Thanks & regards,
    Arvid

    Hi,
    we could resolve this issue, so i thought it may also be helpful for others:
    In our example we used a file with numbers for materials. This file is stored somewhere in a directory, to which SAP BI must have authorization to read.
    The file looks something like this:
    4711
    4712
    4713
    4714
    The file is named "import.txt" and lays in directory "/usr/sap/EC6/files/bi/"
    *&  Include           ZXRSRU01
    * global variables
    Data: intern_range LIKE LINE OF i_t_var_range,
          l_s_range    TYPE rsr_s_rangesid,
          line(100)    TYPE c,
          p_file(128)  TYPE c,
          length_rangelow  type i,
          tmp_rangelow     like l_s_range-low.
    * internal tables for selection-transfer from transaction
    * Data: BEGIN OF it_file occurs 0,
    *        it_p_file(128) TYPE c,
    *      END of it_file.
    IF i_step = 1.
    ** variables can be changed or set before pop-up appears
      CASE i_vnam.
    * take material from external file to selection-list
         WHEN 'ZSD_UPMA'.
    ** call of transaction, with which the path can be set
    *CALL TRANSACTION 'ZBW_VARIABLE' using it_file
    *MODE 'A'      " call should be visible, so that variable can be set
    *UPDATE 'S'.   " first transaction, then processing
    ** Der Pfad, der in dem Selektionsbild eingegeben wird, wird an die Variable übergeben
    ** Der Set-Parameter ist in Report ZSD_SELECT_VARIABLE
    *  get parameter id 'VAR' field p_file.
    p_file = '/usr/sap/EC6/files/bi/import.txt'.
    * further handling of variable in BI
          OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
          IF sy-subrc = 0.
            READ DATASET p_file INTO line.
            WHILE sy-subrc = 0.
              IF line(2) <> '//'.
                l_s_range-sign = 'I'.
                l_s_range-opt  = 'EQ'.
                l_s_range-low  = line.
    * fill with leading Zeros
    * in variable tmp_rangelow the value from l_s_range-low is taken
        tmp_rangelow    = l_s_range-low.
    * read the length
        length_rangelow = strlen( tmp_rangelow ).
    * in our case: material has 18 characters
        while length_rangelow lt 18.
          CONCATENATE '0' tmp_rangelow INTO tmp_rangelow.
          length_rangelow = length_rangelow + 1.
        endwhile.
    * initialize l_s_range-low
        clear l_s_range-low.
    * set with filled values
        l_s_range-low = tmp_rangelow.
    * transfer to structure
                APPEND l_s_range TO e_t_range.
              ENDIF.
              READ DATASET p_file INTO line.
            ENDWHILE.
          ENDIF.
          CLOSE DATASET p_file.
        ENDCASE.
    ELSEIF i_step = 2.
    ** in step 2 all variable values from pop-up input can be processed or
    ** User Exit variables can be derived
    * UserExit Ende.
    ENDIF.
    Hope i could help!
    Best regards,
    Tobias

  • TSV or CSV files with fraction values

    Hello
    In the Pages forum, an user asked about the behavior of fractions values.
    As every user know, the input parser try to decipher them as dates and if it can't, it try to reduce the fractions.
    When we enter values by hand, the workaround is to set the cells format to text before entering the values.
    The problem remains when the values are imported from a TSV or a CSV file.
    In such case, we can't define the cells formats before the import task.
    This is why I wrote two scripts, one for TSV and one for CSV.
    They read the contents of such a file and, when a value contains a slash, it add a single quote in front of this value.
    So, during the import process, Numbers will treat these values as text and will not try to convert them.
    --[SCRIPT insertsingle_quote_in_front_of_fractions_inCSV]
    Enregistrer le script en tant que Script : insertsingle_quote_in_front_of_fractions_inCSV.scpt
    déplacer le fichier ainsi créé dans le dossier
    <VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:
    Aller au menu Scripts , choisir insertsingle_quote_in_front_of_fractions_inCSV
    Naviguer jusqu'au fichier CSV à traiter.
    Le script placera une apostrophe devant toute valeur contenant un slash.
    Numbers traitera alors ces valeurs comme des chaînes de caractères et ne les convertira pas.
    On peut également enregistrer le script en tant qu'application.
    Glisser déposer un fichier CSV sur l'icône de l'application exécutera le script.
    --=====
    L'aide du Finder explique:
    L'Utilitaire AppleScript permet d'activer le Menu des scripts :
    Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case "Afficher le menu des scripts dans la barre de menus".
    Sous 10.6.x,
    aller dans le panneau "Général" du dialogue Préférences de l'Éditeur Applescript
    puis cocher la case "Afficher le menu des scripts dans la barre des menus".
    --=====
    Save the script as a Script: insertsingle_quote_in_front_of_fractions_inCSV.scpt
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:
    Go to the Scripts Menu, choose "insertsingle_quote_in_front_of_fractions_inCSV"
    Browse to the CSV file to treat.
    The script will put a single quote in front of every value containing a slash.
    So Numbers will no longer convert these values into dates.
    We may also save the script as an application.
    Drag and drop the CSV onto the application's icon will run the script.
    --=====
    The Finder's Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the "Show Script Menu in menu bar" checkbox.
    Under 10.6.x,
    go to the General panel of AppleScript Editor’s Preferences dialog box
    and check the “Show Script menu in menu bar” option.
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2010/11/08
    --=====
    on run
    my commun(choose file of type {"public.csv", "public.comma-separated-values-text"} without invisibles)
    end run
    --=====
    on open (sel)
    local csvFile, uti
    set csvFile to first item of sel
    tell application "System Events"
    set uti to type identifier of disk item ("" & csvFile)
    end tell
    if uti is not in {"public.csv", "public.comma-separated-values-text"} then
    if my parle_Anglais() then
    error "The file “" & csvFile & "” isn’t a CSV file !"
    else
    error "Le fichier « " & csvFile & " » n’est pas un fichier CSV !"
    end if
    end if
    my commun(csvFile)
    end open
    --=====
    on commun(le_fichier)
    local delim, deci, des_paragraphes, un_paragraphe, une_liste, i
    set {delim, deci} to my get2LocalizedDelimiters()
    set des_paragraphes to paragraphs of (read le_fichier)
    repeat with un_paragraphe in des_paragraphes
    set une_liste to my decoupe(contents of un_paragraphe, delim)
    repeat with i from 1 to count of une_liste
    if item i of une_liste contains "/" then set item i of une_liste to "'" & item i of une_liste
    end repeat -- i
    set contents of un_paragraphe to my recolle(une_liste, delim)
    end repeat -- with un_paragraphe
    set eof of le_fichier to 0
    write my recolle(des_paragraphes, return) to le_fichier
    end commun
    --=====
    on decoupe(t, d)
    local oTIDs, l
    set oTIDs to AppleScript's text item delimiters
    set AppleScript's text item delimiters to d
    set l to text items of t
    set AppleScript's text item delimiters to oTIDs
    return l
    end decoupe
    --=====
    on recolle(l, d)
    local oTIDs, t
    set oTIDs to AppleScript's text item delimiters
    set AppleScript's text item delimiters to d
    set t to l as text
    set AppleScript's text item delimiters to oTIDs
    return t
    end recolle
    --=====
    Set the parameter delimiters which must be used in Numbers formulas
    set {delim, deci} to my get2LocalizedDelimiters()
    on get2LocalizedDelimiters()
    if character 2 of (0.5 as text) is "." then
    return {",", "."}
    else
    return {";", ","}
    end if
    end get2LocalizedDelimiters
    --=====
    on parle_Anglais()
    return (do shell script "defaults read 'Apple Global Domain' AppleLocale") does not start with "fr_"
    end parle_Anglais
    --=====
    --[/SCRIPT]
    --[SCRIPT insertsingle_quote_in_front_of_fractions_inTSV]
    Enregistrer le script en tant que Script : insertsingle_quote_in_front_of_fractions_inTSV.scpt
    déplacer le fichier ainsi créé dans le dossier
    <VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:
    Aller au menu Scripts , choisir insertsingle_quote_in_front_of_fractions_inTSV
    Naviguer jusqu'au fichier TSV à traiter.
    Le script placera une apostrophe devant toute valeur contenant un slash.
    Numbers traitera alors ces valeurs comme des chaînes de caractères et ne les convertira pas.
    On peut également enregistrer le script en tant qu'application.
    Glisser déposer un fichier CSV sur l'icône de l'application exécutera le script.
    --=====
    L'aide du Finder explique:
    L'Utilitaire AppleScript permet d'activer le Menu des scripts :
    Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case "Afficher le menu des scripts dans la barre de menus".
    Sous 10.6.x,
    aller dans le panneau "Général" du dialogue Préférences de l'Éditeur Applescript
    puis cocher la case "Afficher le menu des scripts dans la barre des menus".
    --=====
    Save the script as a Script: insertsingle_quote_in_front_of_fractions_inTSV.scpt
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:
    Go to the Scripts Menu, choose "insertsingle_quote_in_front_of_fractions_inTSV"
    Browse to the TSV file to treat.
    The script will put a single quote in front of every value containing a slash.
    So Numbers will no longer convert these values into dates.
    We may also save the script as an application.
    Drag and drop the CSV onto the application's icon will run the script.
    --=====
    The Finder's Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the "Show Script Menu in menu bar" checkbox.
    Under 10.6.x,
    go to the General panel of AppleScript Editor’s Preferences dialog box
    and check the “Show Script menu in menu bar” option.
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2010/11/08
    --=====
    on run
    my commun(choose file of type {"public.plain-text"} without invisibles)
    end run
    --=====
    on open (sel)
    local tsvFile, uti
    set tsvFile to first item of sel
    tell application "System Events"
    set uti to type identifier of disk item ("" & tsvFile)
    end tell
    if uti is not in {"public.plain-text"} then my notatsvFile(tsvFile)
    my commun(tsvFile)
    end open
    --=====
    on commun(le_fichier)
    local le_texte, des_paragraphes, un_paragraphe, une_liste, i
    set le_texte to (read le_fichier)
    if le_texte contains tab then
    set des_paragraphes to paragraphs of le_texte
    repeat with un_paragraphe in des_paragraphes
    set une_liste to my decoupe(contents of un_paragraphe, tab)
    repeat with i from 1 to count of une_liste
    if item i of une_liste contains "/" then set item i of une_liste to "'" & item i of une_liste
    end repeat -- i
    set contents of un_paragraphe to my recolle(une_liste, tab)
    end repeat -- with un_paragraphe
    set eof of le_fichier to 0
    write my recolle(des_paragraphes, return) to le_fichier
    else
    my nota_tsvFile(lefichier)
    end if
    end commun
    --=====
    on nota_tsvFile(unfichier)
    if my parle_Anglais() then
    error "The file “" & un_fichier & "” isn’t a TSV file !"
    else
    error "Le fichier « " & un_fichier & " » n’est pas un fichier TSV !"
    end if
    end notatsvFile
    --=====
    on decoupe(t, d)
    local oTIDs, l
    set oTIDs to AppleScript's text item delimiters
    set AppleScript's text item delimiters to d
    set l to text items of t
    set AppleScript's text item delimiters to oTIDs
    return l
    end decoupe
    --=====
    on recolle(l, d)
    local oTIDs, t
    set oTIDs to AppleScript's text item delimiters
    set AppleScript's text item delimiters to d
    set t to l as text
    set AppleScript's text item delimiters to oTIDs
    return t
    end recolle
    --=====
    Set the parameter delimiters which must be used in Numbers formulas
    set {delim, deci} to my get2LocalizedDelimiters()
    on get2LocalizedDelimiters()
    if character 2 of (0.5 as text) is "." then
    return {",", "."}
    else
    return {";", ","}
    end if
    end get2LocalizedDelimiters
    --=====
    on parle_Anglais()
    return (do shell script "defaults read 'Apple Global Domain' AppleLocale") does not start with "fr_"
    end parle_Anglais
    --=====
    --[/SCRIPT]
    Yvan KOENIG (VALLAURIS, France) lundi 8 novembre 2010 11:30:20

    Hello Zahid,
    It is currently possible to create a relational multi-source universe with one data provider to an Excel document.
    for this to work for Web Intelligence the 62 bit drivers must be installed on the Webi Server for Excel.
    Here is a link to the kbase
    https://service.sap.com/sap/support/notes/1828466
    Also here is a link to the Information Design Tool Guide for how to create a multi-source universe:
    http://service.sap.com/sap/support/notes/1898185
    One of the new features in BI 4.0 is creating a list of values on a Table or custom SQL.
    also, here is the link to the available tutorials:
    Official Product Tutorials – SAP BusinessObjects Business Intelligence Platform 4.x
    Scroll down to the information design tool.
    Hope this helps!
    Jacqueline

  • Problem importing text file with null value

    I used the following codes to import a text file and it
    worked perfectly.
    However, it skipped the TAB (chr(9)) on the imported row when
    there is no data (empty string) in one of the columns.
    Can someone help? thanks!
    sample text file data:
    00001 desc1 12.00
    00002 25.00
    00003 desc2 15.00
    Code that I used:
    <cffile action="read" file="#FilePath#"
    variable="data">
    <cfset newLine = chr(13) & chr(10)>
    <cfset tabChar = chr(9)>
    <cfoutput>
    <cfloop list="#data#" index="row"
    delimiters="#newLine#">
    <cfset cols = listToArray(row, tabChar)>
    ID = #cols[1]#
    desc = #cols[2]#
    price = #cols[3]# <br>
    </cfloop>
    </cfoutput>

    There is no perfect way to handle this with out you writing
    more complicated code.
    A good compromise is to replace this line:
    <cfset cols = listToArray(row, tabChar)>
    with this:
    <cfset cols = listToArray (Replace (row, tabChar &
    tabChar, tabChar & "{empty}" & tabChar, "ALL"),
    tabChar)>

  • Firefox crashes when opens a large xslt file with has heavy javascript

    We have some pages designed by us in our company. That page is intended to add or edit the signatures created by us.
    When ever we click on add link firefox is getting crashed.
    We have around 300 or 400 links in our user interface, all the other links are working perfectly.
    Please help us in fixing this issue.

    And this links are working in previous version of mozilla as well as all version of IE.
    Issue is only with latest version.

  • Problem using Resource Bundle in XSLT File

    Hi All,
    I've been trying to use Resource Bundle on my XSLT file with no success for the last 2 weeks. So I would like some help to definitely end this problem.
    The fact is that i have a property file that i would like to read and it works fine when i use jsp or a servlet however when i try to call the same property file using my XSL i get the message below:
    java.util.MissingResourceException: Can't find bundle for base name thoth, locale en_US
    Follow the code from my Stylesheet that i'm calling the resource bundle:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:java="java.util.ResourceBundle" exclude-result-prefixes="java" version="1.0">
    <xsl:strip-space elements="*"/>
    <xsl:output method="html" indent="yes" version="4.0"/>
    <xsl:output encoding="ISO-8859-1"/>
    <xsl:template match="page">
    <html>
    <body>
    <xsl:apply-templates select="paragraph"/>
    <xsl:variable name="resources" select="java:getBundle('thoth')"/>
    <xsl:value-of select="java:getString($resources,'general.title')"/>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>
    Please someone could help me why this file cannot be located, I am 100% of sure the property file path is in my classpath since it works fine in a servlet. Should i have to put it some other place? Do i have some other way to read this file and show the information from the file?
    I would appreciate any help
    thanks in advance and Regards
    Fabio

    Please someone could help me why this file cannot be located, I am 100% of sure the property file path is in my classpath since it works fine in a servlet.
    Is the property file in your classpath? or whether the directory where the property file is residing is in your classpath. Please put only the directory where the property file is located in the classpath and try again.
    It may be working fine with the servlet because j2ee servlet containers put the classes and lib directory automatically in the classpath therefore resource bundle gets loaded even without putting it explicitly in the classpath. This doesn't happen when you try to test some component from the console.
    Let me know if this does not work.
    regards,
    Abhishek.

  • Help with xslt xml, "the value specified in the xslt file field is not an xslt file." ???

    when trying to attach an XSLT to an XML file I am getting this error message:
    "the value specified in the xslt file field is not an xslt file."
    this is the first time I am ever doing this and I dont have the faintest clue what might be wrong and how to go about fixing it...
    help?

    http://www.w3schools.com/xml/xml_xsl.asp
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web-design.blogspot.com/

  • Should not create any output file when transform with xslt file

    I have a xslt file, which I have make code to check the order status value.
    If OrderStatus != 'Reject' --> create attribute, element for output file
    Else OrderStatus = 'Reject' --> do not create attribute/element ==> output is the empty file.
    Requirement: if OrderStatus = 'Reject' --> do not create any output file.
    how to do with this requirement?
    any help will be appreciated!

    Do you mean the xslt file always return the output file?
    I have tested this xslt file following (only xslt file, not run in BizTalk project):
    Create a blank console application using visual studio and add attached xslt file to newly created console app. Next open the XSLT file and select input file and output files and start xslt debugging to create output file.
    I want to edit the xslt file how to cannot create output file in the case OrderStatus = Reject.
    I don't say in particualr xslt file, its actually your map as a whole that returns a output message on successful execution.
    since you are testing the xslt file as individual file, you are able to control it as per need.  i mean you can write incomplete code or any kind of output elements that are not present even in schema. But when you set the map properties to use external
    xslt , map completely relies on xslt and xslt has to produce output that matches the output schema structure.
    So you better test your xslt by  setting it to your map. Once you set map properties to use xslt, you can test your map by right clicking on map and choosing test map.
    Please mark the post as answer if this answers your question. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Help with Reading values from static table in a .pdf file

    Hi guys,
    Pls try to clear this doubt of mine.
    I basically have 2 files. Both are .pdf extension and they have tables in them. I need to compare certain values in one file with the corresponding values in the other table in the second file.
    I need to do this programatically in c# . net
    I have tried using packages like pdfbox and stuff which convert the pdf file into text. But cant I get the table as an object or something using which I can access the required rows and columns?
    Also, these tables are static information. They are not a part of a form or anything like that.
    Please help me with this.
    Thanks.

    The document is corrupt. Try a backup.

  • Create XML file with worksheet's dynamically assigned through XSLT

    Hi all
    I have a requirement to create a xml file with worksheets dynamically created based on a field value in the internal table .
    I have all my values in internal table,  and am calling the transformation from bsp application.
    Say the internal table has field dataxyz, for every change in value in this field dataxyz  i need to create separate worksheet and populate that sheet with some corresponding values .
    please guide me how to create worksheet dynamically.
    thanks in advance.
    Bharathy
    Edited by: elam.bharathy on May 16, 2011 6:51 AM

    Can you use a schema when we compose XML doc from Database tables?
    Actually, I'm using SQL Server (sorry, wrong forum). But, I thought a Java tool would have a solution for me.

  • Create xml file with values from context

    Hi experts!
    I am trying to implement a WD application that will have some input fields, the value of those input fields will be used to create an xml file with a certain format and then sent to a certain application.
    Apart from this i want to read an xml file back from the application and then fill some other context nodes with values from the xml file.
    Is there any standard used code to do this??
    If not how can i do this???
    Thanx in advance!!!
    P.S. Points will be rewarded to all usefull answers.
    Edited by: Armin Reichert on Jun 30, 2008 6:12 PM
    Please stop this P.S. nonsense!

    Hi,
    you need to create three util class for that:-
    XMLHandler
    XMLParser
    XMLBuilder
    for example in my XML two tag item will be there e.g. Title and Organizer,and from ur WebDynpro view you need to pass value for the XML tag.
    And u need to call buildXML()function of builder class to generate XML, in that i have passed bean object to get the values of tags. you need to set the value in bean from the view ui context.
    Code for XMLBuilder:-
    Created on Apr 4, 2006
    Author-Anish
    This class is to created for having function for to build XML
    and to get EncodedXML
      and to get formated date
    package com.idb.events.util;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import com.idb.events.Event;
    public class XMLBuilder {
    This attribute represents the XML version
         private static final double VERSION_NUMBER = 1.0;
    This attribute represents the encoding
         private static final String ENCODING_TYPE = "UTF-16";
         /*Begin of Function to buildXML
    return: String
    input: Event
         public String buildXML(Event event) {
              StringBuffer xmlBuilder = new StringBuffer("<?xml version=\"");
              xmlBuilder.append(VERSION_NUMBER);
              xmlBuilder.append("\" encoding=\"");
              xmlBuilder.append(ENCODING_TYPE);
              xmlBuilder.append("\" ?>");
              xmlBuilder.append("<event>");
              xmlBuilder.append(getEncodedXML(event.getTitle(), "title"));
              xmlBuilder.append(getEncodedXML(event.getOrganizer(), "organizer"));
              xmlBuilder.append("</event>");
              return xmlBuilder.toString();
         /End of Function to buildXML/
         /*Begin of Function to get EncodedXML
    return: String
    input: String,String
         public String getEncodedXML(String xmlString, String tag) {
              StringBuffer begin = new StringBuffer("");
              if ((tag != null) || (!tag.equalsIgnoreCase("null"))) {
                   begin.append("<").append(tag).append(">");
                   begin.append("<![CDATA[");
                   begin.append(xmlString).append("]]>").append("</").append(
                        tag).append(
                        ">");
              return begin.toString();
         /End of Function to get EncodedXML/
         /*Begin of Function to get formated date
    return: String
    input: Date
         private final String formatDate(Date inputDateStr) {
              String date;
              try {
                   SimpleDateFormat simpleDateFormat =
                        new SimpleDateFormat("yyyy-MM-dd");
                   date = simpleDateFormat.format(inputDateStr);
              } catch (Exception e) {
                   return "";
              return date;
         /End of Function to get formated date/
    Code for XMLParser:-
    Created on Apr 12, 2006
    Author-Anish
    This is a parser class
    package com.idb.events.util;
    import java.io.ByteArrayInputStream;
    import java.io.IOException;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.xml.sax.XMLReader;
    import com.idb.events.Event;
    import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
    public class XMLParser {
    Enables namespace functionality in parser
         private final boolean isNameSpaceAware = true;
    Enables validation in parser
         private final boolean isValidating = true;
    The SAX parser used to parse the xml
         private SAXParser parser;
    The XML reader used by the SAX parser
         private XMLReader reader;
    This method creates the parser to parse the user details xml.
         private void createParser()
              throws SAXException, ParserConfigurationException {
              // Create a JAXP SAXParserFactory and configure it
              SAXParserFactory saxFactory = SAXParserFactory.newInstance();
              saxFactory.setNamespaceAware(isNameSpaceAware);
              saxFactory.setValidating(isValidating);
              // Create a JAXP SAXParser
              parser = saxFactory.newSAXParser();
              // Get the encapsulated SAX XMLReader
              reader = parser.getXMLReader();
              // Set the ErrorHandler
    This method is used to collect the user details.
         public Event getEvent(
              String newsXML,
              XMLHandler xmlHandler,
              IWDMessageManager mgr)
              throws SAXException, ParserConfigurationException, IOException {
              //create the parser, if not already done
              if (parser == null) {
                   this.createParser();
              //set the parser handler to extract the
              reader.setErrorHandler(xmlHandler);
              reader.setContentHandler(xmlHandler);
              InputSource source =
                   new InputSource(new ByteArrayInputStream(newsXML.getBytes()));
              reader.parse(source);
              //return the results of the parse           
              return xmlHandler.getEvent(mgr);
    Code for XMLHandler:-
    Created on Apr 12, 2006
    Author-Anish
    This is a parser class
    package com.idb.events.util;
    import java.io.ByteArrayInputStream;
    import java.io.IOException;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.xml.sax.XMLReader;
    import com.idb.events.Event;
    Created on Apr 12, 2006
    Author-Anish
    *This handler class is created to have constant value for variables and function for get events,
        character values for bean variable,
        parsing thr date ......etc
    package com.idb.events.util;
    import java.sql.Timestamp;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import java.util.Locale;
    import org.xml.sax.Attributes;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import org.xml.sax.helpers.DefaultHandler;
    import java.util.*;
    import com.idb.events.Event;
    import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
    public class XMLHandler extends DefaultHandler {
         private static final String TITLE = "title";
         private static final String ORGANIZER = "organizer";
         IWDMessageManager manager;
         private Event events;
         private String tagName;
         public void setManager(IWDMessageManager mgr) {
              manager = mgr;
    This function is created to get events
         public Event getEvent(IWDMessageManager mgr) {
              manager = mgr;
              return this.events;
    This function is created to get character for setting values through event's bean setter method
         public void characters(char[] charArray, int startVal, int length)
              throws SAXException {
              String tagValue = new String(charArray, startVal, length);
              if (TITLE.equals(this.tagName)) {
                   this.events.setTitle(tagValue);
              if (ORGANIZER.equals(this.tagName)) {
                   String orgName = tagValue;
                   try {
                        orgName = getOrgName(orgName);
                   } catch (Exception ex) {
                   this.events.setOrganizer(orgName);
    This function is created to parse boolean.
         private final boolean parseBoolean(String inputBooleanStr) {
              boolean b;
              if (inputBooleanStr.equals("true")) {
                   b = true;
              } else {
                   b = false;
              return b;
    This function is used to call the super constructor.
         public void endElement(String uri, String localName, String qName)
              throws SAXException {
              super.endElement(uri, localName, qName);
         /* (non-Javadoc)
    @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
    This function is used to call the super constructor.
         public void fatalError(SAXParseException e) throws SAXException {
              super.fatalError(e);
    This function is created to set the elements base on the tag name.
         public void startElement(
              String uri,
              String localName,
              String qName,
              Attributes attributes)
              throws SAXException {
              this.tagName = localName;
              if (ROOT.equals(tagName)) {
                   this.events = new Event();
         public static void main(String a[]) {
              String cntry = "Nigeria";
              XMLHandler xml = new XMLHandler();
              ArrayList engList = new ArrayList();
              engList = xml.getCountries();
              ArrayList arList = xml.getArabicCountries();
              int engIndex = engList.indexOf(cntry);
              System.out.println("engIndex  :: " + engIndex);
              String arCntryName = (String) arList.get(engIndex);
              System.out.println(
                   ">>>>>>>>>>>>>>>>>>>>" + xml.getArabicCountryName(cntry));
    Hope that may help you.
    If need any help , you are most welcome.
    Regards,
    Deepak

  • Populating a PDF file with Database Field values - URGENT PLEASE REPLY

    I have a requirement where in I hae PDF files as templates. The data for these templates is the database.
    Example : a.pdf
    Name :
    Database table : name varchar(20)
    What I want to do is read this PDF template and populate the Name with the value in the table.
    Any Ideas on how to do this. Pointers/Source code would be appreciated. Hve been scrambling my head for quite a while without any luck

    not a portal question..
    u will need some pdf library / api - such as itext, etc

  • Camparing file name with a value of the field in the source

    Hi All,
    I have a file sender. I need to compare the file name with the value of a field in the source and then map to the target.
    For example:
    <Record>
         <Date>20071103></Date>
         <name>abcd</name>
    </Record>
    the name of the file would be 20071103. i need to check this file name with value in 'date' field , if its true then we need to map it to target
    please suggest some way to meet the reqirement
    thanks
    jhansi

    Hi,
    Here is the reason i need to do this:
    The data is loaded by DTP in process chain. Overlaping requests are deleted. But, iIn some cases requests with the same selection options  need not to be deleted. My idea was to change selection options in Manage(infocube) with Abap program without changing selection options in DTP filter,  so that the system would not recognize requests as "overlaping requests".
    So, where is the information about shown in the field Selection Options is stored? In which tables?
    Thanks
    Tigr_Z

  • How to read a file with value of RAW data type? Please help

    Hi Experts,
       I  have a file with RAW data like DE864E48833BFFF1B805001CC4EF4BFA
       I am using GUI_UPLOAD.
       But this FM is throwing error.
       I tried by giving FILETYPE as ASC. The output internal table for this FM contains a field of type c size 32.
       Now it is able to read the file but I want to assign this value to a RAW data type variable.
       This it is unable to do. How to convert the char value to RAW data type?
    Please help!
    Thanks
    Gopal

    Hi,
    The documentation for the function module contains an example for RAW upload.
                begin of itab,
                      raw(255) type x,
                end of itab occurs 0.
               CALL FUNCTION 'GUI_UPLOAD'
               exporting
                  filetype =  'BIN'
                  filename = 'C:\DOWNLOAD.BIN'
               tables
                 data_tab = itab.

  • XSLT output file with date

    Is there a way to change the Output settings for the Run Configuration of an XSLT file so that the output file contains a date/time string in its name?

    From the W3C recommendation:
    If the indent attribute has the value yes, then the html output method may add or remove whitespace as it outputs the result tree, so long as it does not change how an HTML user agent would render the output. The default value is yes.
    as you see, you won't see a different between indent="yes" and no indent attribute, as the default is "yes". have you tried "no" to see if it does anything at all?
    moreover the word may in the above sentence means the parser will do it or not...

Maybe you are looking for

  • Error 0xE0000235 when trying to download a driver onto Windows SBS 2008 64-bit Standard FE.

    Unfortunately, Error 0xE0000235 occurs when trying to download a driver onto Windows SBS 2008 64-bit Standard FE. I am installing the GV 800 GeoVision 32/64Bit 16CH Video Capture Card onto the server. Please urgently assist. Answer in clear English.

  • How to remove SOAP namespaces declarations in body content?

    Hi! I'm calling a WS with WS-Security without problems but when I extract the content the SOAP message's Body(the "business" part), the namespace declarations of the SOAP part (envelope, security, etc.) are present in the root element. However, any o

  • Can i Recover my file?

    I accidentally caused a crash in Flash pro 8, by choosing to payback the animation, and slecting the zoom menu... It's currently open, but not responding, and i was wondering if there is any way of getting the work ive done on it... as ive (rather st

  • Security Dept Statistical posting from SD invoice to Contract accout

    Dear Friends, Could some one help me, How the Security Dept Statistically posted from SD invoice to Contract accout level. Because, the Security Dept amount should not directly post into any G/L account while creation of SD invoice. Thanks in advance

  • GREP - negative look behind

    I should be able to do this, but I am not. I want to change the formatting of negative numbers in tables from - to (). Fine I can do that (thanks to help from this Forum). First I do a Grep find/replace "-(?=.+)" to "(" Then "\A\(.+\Z" to "$0)" Happy