XML Transformation - Dynamic tags?

Hi All,
I am trying to dynamically generate an xml tag based on a parameter.
I.e.   <tt:root name="V_TYPE"/>    where V_TYPE = MyTag
I am trying to generate the following from the transformation.
<MyTag>.... </MyTag>
Any help would be much appreciated.
Regards,
Jason

Hi Rafael,
Well its actually a call transformation from an event within table maintenance.
The table is generic such that the tag names and values are specified by fields in the table.  Ie. 3 fields.
1) Block
2) Tag
3) Value
I want to generate XML that looks like.
<Block>
  <Tag>Value</Tag>
</Block>
Regards,
Jason

Similar Messages

  • ABAP to XML Transformation Dynamic Element Generation

    Hi all,
    I have created a deep structure and used simple transformation in XSLT Tool to create XML file. But I would like to generate some elements dynamically. Desired XML output is in the attachments.
    There is a way to do that if had used XSLT Program instead of simple transformation (dynamic xml nodes using xslt - Stack Overflow) but XSLT Program does not create fields from structures automatically like simple transformation.
    So, is there any way to do that using simple transformation ?
    Thanks.

    The error is related to your web browser software or release, because it can't support utf-16 xml file (for example, IE 6 doesn't support it).
    Your output file contains <?xml version="1.0" encoding="utf-16"?> in your ECC 6 system because your SAP system is Unicode, and you used a variable of character type behind RESULT XML. When it's character, SAP converts the XML into SAP code page. If you use a byte type behind RESULT XML, SAP doesn't convert, and you'll get the XML data in the encoding of the transformation (defined here: <xsl:output encoding="ISO-8859-1" ...).
    I guess you have choosen ISO-8859-1 because your 4.7 system issued a file with that encoding.
    So, the only thing you have to do, in the call transformation statement, is to store the result into a table of X255 (instead of table of CHAR2048).
    Edited by: Sandra Rossi on Jul 6, 2010 4:14 PM CET:
    You must also download using filetype = 'BIN'

  • Dynamic TAG - Simple Transformation

    Hi All,
    I need work with dynamic TAGS (Elements) on Simple Transformation?
    The tag should be <Invoice> or <DebitNote> depending on a Variable.
    How can I achieve this?
    Thanks and Regards,

    We work with Microsoft Outlook, but I'm sure this could work with any email system.
    This error only came from external emails - what we did in the end is to get the third party to email a particular email (email1) in our company.  This is set up as a regular email account.  On this email put a forward rule to email2 for a particular sender/subject.  email2 is set up as POP3 so that XD1 can poll it - we also block any emails except from email1.
    Doing this accomplishes a couple of things:
    1)  We get around the error because XI polls email2 (which has adapter settings of IMAP4 so we can see MAIL adapter attributes ie. sender, subject etc...When we originally had as POP3 we were not able to see these - but setting as IMAP4 causes the error for external emailers)
    2) We have a SPAM filter - the XI email is clean from SPAM and the adapter will not have errors, as it only receives valid emails to process
    3) We have a central email (email1) which is used to archive all XI emails - we use this for all email scenarios (as we also save to folder and forward in the rule)
    Hope this helps your situation.

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

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

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

  • How to create a dynamic tag in MII

    Hi  ,
    I want to repeat this item tag for different segments and for each segment the <SEGNAM> will be changing and <SDATA> i am fetching from DB. Is there any way to make this item tag a dynamic tag. so that i will use the same item tag for different segments.
    <SEGNAM> I am inputting the value manually for each segment.
    <item>
    <SEGNAM>Name1</SEGNAM>
    <MANDT/>
    <DOCNUM/>
    <SEGNUM/>
    <PSGNUM/>
    <HLEVEL/>
    <SDATA>11111</SDATA>
    </item>
    Thanks ,
    Duvvurus

    Sounds as if you are using link type Assign XML. Please check the [link type|http://help.sap.com/saphelp_mii121/helpdata/en/43/e80b59ad40719ae10000000a1553f6/frameset.htm]. To append a node, you can either use Append XML or Append After XML.
    Michael

  • Urgent, creating xml files dynamically, request dispatcher problem

    hi all,
    Problem 1:
    There is a problem we are facing, while request dispatching.
    The files CBECBC.XML & CBECBC_Envelop.XML,
    both xml files. These files are created on request from the user, dynamically, and displayed on the browser,
    by including them in a jsp page.
    Here we face a problem when they are to be included into the jsp page.
    The error is the following :
    //////// Error ////////
    Could not find request dispatcher for the url CBECBC.xml
    Could not find request dispatcher for the url CBECBC_Envelop.xml
    The created files are stored in the "d:\pstudio35\desks\bank\BankWeb\".
    We are using " <jsp:include page="...."/> " (dynamic jsp include tag), to include the xml files.
    Problem 2:
    And could you just let me know how to include a xml file in a jsp file,
    so that the xml file is displayed in the exact format of xml(with the tags).
    I am using Pramati Studio 3.5
    Its urgent!!!
    Regards,
    Deepa Datar

    problem 2:
    either translate all < en > into < and > or display the XML in a textarea

  • XML transform using XSL

    Hi,
    I am new to the javax technology.
    I have a xml that has data in this format
    <?xml version="1.0" encoding="UTF-8"?>
    <emps>
    <emp>
    <empName>Me</empName>
    <empAge>23</empAge>
    </emp>
    <emp>
    <empName>You</empName>
    <empAge>23</empAge>
    </emp>
    </emps>Can i convert this to an XML that has tags and data like
    <employees>
    <employee>
    <name>me</name>
    <age>23</age>
    </employee>
    <employee>
    <name>you</name>
    <age>23</age>
    </employee>
    </employees>using a XSLT?
    thanks,
    Dilip

    So the only change is changing the element names? Sure you can. Or at least I can. Here's a template that changes an emps element into an employees element and preserves its children:<xsl:template match="emps">
    <employees><xsl:apply-templates/></employees>
    </xsl:template>Use an identity transformation and put in one of these for each element whose name you want to change.

  • XML Transformation error (ABAP -- XML)

    Hi,
    I'm getting the foll. error while doing a XML Transformation, Can anyone help me in this regard..
      <FIN_WT>56.0</FIN_WT>
      <FIN_WT_UNIT>KG</FIN_WT_UNIT>
      <ZZQMNUM />
      <ZZHOLD />
      <ZZDUMATNR
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    The following tags were not closed: asx:abap, asx:values, OUTPUT, item. Error processing resource 'file:///C:/Documents and...
    > />
      <PSP_NR>U5/0626-HT-193-1-36-344</PSP_NR>
      <ZZCRTNAME>ALFI</ZZCRTNAME>
      <ZZAPPNAME>ALFI</ZZAPPNAME>
    Regards
    Jiku

    are you trying to transform XML to itab?
    is the xml well formed one - you can check this by running the xml file in webbrowser, if it doesnt display, then it means the xml is not well formed.
    Regards
    Raja

  • Export to Excel: XML transformation

    Hi,
    I have to export the result set on the Grid in an Excel file( fancy report..:) ). The result set has to be modified based on the other tables before downloading. The resulting file has to have the various formatting like color, bold, font size, etc..
    As OLE is slow so I am thinking to go for the XML transformation.
    Issue:
    1. The table had around 100 columns, so is there any way to dynamically read the number of columns being displayed? (The user can change the layout).
    Kindly suggest.
    Regards
    s@k

    Code for Transformation
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
      <tt:root name="excelMeta"/>
      <tt:root name="excelDataTab"/>
      <tt:template>
        <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o=
    "urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40" tt:extensible="deep-static">
          <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
            <Author>
              <tt:value ref="excelMeta.DocumentProperties.Author"/>
            </Author>
          </DocumentProperties>
          <tt:serialize>
            <Styles>
              <Style ss:ID="Default" ss:Name="Normal">
              </Style>
              <tt:loop name="Styles" ref=".excelMeta.Styles">
                <Style>
                  <tt:attribute name="ss:ID" value-ref="$Styles.ID"/>
                  <Font>
                    <tt:attribute name="x:Family" value-ref="$Styles.Font.Family"/>
                  </Font>
                  <Alignment ss:Vertical="Bottom" ss:WrapText="1"/>
                </Style>
              </tt:loop>
            </Styles>
          </tt:serialize>
          <Worksheet>
            <tt:attribute name="ss:Name" value-ref="excelMeta.Worksheet.Name"/>
            <Table>
              <tt:loop name="line" ref=".excelDataTab">
                <Row>
                  <tt:loop name="Cell" ref="$line.Cells">
                    <Cell>
                      <tt:cond>
                        <tt:attribute name="ss:StyleID" value-ref="$Cell.StyleID"/>
                      </tt:cond>
                      <tt:cond>
                        <Data>
                          <tt:attribute name="ss:Type" value-ref="$Cell.Type"/>
                          <tt:value ref="$Cell.cell_content"/>
                        </Data>
                      </tt:cond>
                    </Cell>
                  </tt:loop>
                </Row>
              </tt:loop>
            </Table>
        </Workbook>
      </tt:template>
    </tt:transform>

  • Binding XML file Dynamically

    Can I bind a xml file dynamically to a form? say, bind to a different xml file after user select a value from a drop down list in the form?how to do it? Thanks.

    I think it's best to create different XPD files for each language and add an XML tag <language>countryCode</language> to your XML dataset and XSD file. this way you could tell the workbench to use a different xpd file for generating the PDF file.
    Anyway if you want to load an XML file from your local filesystem you should check out this URL: http://www.c-point.com/JavaScript/articles/file_access_with_JavaScript.htm it shows you how to read & write files using javascript.
    The problem you'll be facing is editing the binding and reading + validating the given XML file. Especially validating the XML vs the XSD file used in the designer will probably cause a few errors, yet this is highly recommended in order to make sure you're not modifying your PDF with the wrong (or even malicious) data.
    Security-wise i would not implement it your way but make a different XPD file for each language. In the LiveCycle Workbench you can select the correct XPD file based on the data you provide. Then it's just the user who needs to specify his/her language and your pdf is always build correctly. Yet I do not know if this is applicable to your situation and/or needs.

  • How to creat XML file dynamically

    i want to create a XML file where tags will be dynamically created based on the backend table feild name.After creating this table i want to insert this XML file into a table as a feild.

    Here is some pseudo to output a database contents to file.
      Writer.write("<Root>")
    //for each database d
      Writer.write("<" + d.getName() + ">")
       // for each table t in d
           Writer.write("<" + t.getName() + ">")
          //for each row r in t
              Writer.write("<Row>")
             //for each column c in r
               Writer.write("<" + c.getName() + " >" + c.getValue() + "</" + c.getName() + ">");
             //end for
            Writer.write("</Row>")
           //end for
         Writer.write("</" + t.getName() + ">")
       //end for
    Writer.write("</" + d.getName() + ">")     
      Writer.write("</Root>")

  • Inspector Property: Dynamic tags

    Hi,
    I am working on an extension for Dreamweaver, currently on an
    Inspector. So what I understand is, that if you use the following
    tag:
    <!-- tag:mytag,priority:9,selection:exact,vline,hline
    -->
    It will recognize any tags that look like <mytag>, and
    the js function will be called. But what if I have dynamic tags,
    e.g. take this: <%email_a%> <%email_b%>
    So the word before the underline "email" tells me, what kind
    of Property I have, and a or b are defining an array of values,
    that are going to be saved in an xml file.
    What I am looking for is some sort of function that will
    allow me to use regular expression to decide which Property
    inspector should be called.
    (everthing with %email_ in the beginning should call the
    email inspector, everthing with %address_ the address inspector
    etc.)
    Thanks for any help in advance, I hope its possible to this.
    Regards
    David

    "nyDavid" <[email protected]> wrote in
    message
    news:gd7hpa$jmi$[email protected]..
    > What I am looking for is some sort of function that will
    allow me to use
    > regular expression to decide which Property inspector
    should be called.
    > (everthing with %email_ in the beginning should call the
    email inspector,
    > everthing with %address_ the address inspector etc.)
    >
    > Thanks for any help in advance, I hope its possible to
    this.
    Have you checked the docs for canInspectSelection()?
    Massimo Foti, web-programmer for hire
    Tools for ColdFusion, JavaScript and Dreamweaver:
    http://www.massimocorner.com

  • Data from two tables in the same row in XML transformation

    Hi,
        I am using XML transformation for generating excel file which is to besent as email attachment.
        Here  I want to display the data from two internal tables in the same row in the excel. .I am using   <tt:loop ref=".<table name>"> ...  </tt:loop> for looping through the table. Can I loop two table simultaneously ? In that case how will I specify the fields in each table . Some of the fields in two tables are of same name and type.
    Please help...
    Thanks,
    Jissa

    Hello Brian,
    Thank you for your answer. It is approach I will use, I think. However let me ask: Would it be possible to have a Version in this layout, too? I mean to see, which value comes from Version A and which comes from Version B? Something like this:
    Calendar Month Version Sales Amount
    2011.01  B  200
    2011.02  B  300
    2011.03  A  260
    2011.04  A  230
    2011.05  A  200
    A

  • XML Transformation Problem in JDeveloper 10.1.3

    I am trying to transform an XML using an XSL, by a Java program, which uses javax.xml.transform.Transformer.
    I have a Java project which has the above said program, where when i run the program, the xml transformation is done successfully.
    But I have a Web project created, where i have the java project's jar in the WEB-INF/lib. And, when i tried to access the same java program from inside the web project, I am getting the following error:
    XML-22000: (Fatal Error) Error while parsing XSL file (unknown protocol: c).
    Please help in resolving this error.

    This is from Metalink:
    Cause
    This is caused by a conflict between the Oracle XML parser installed by default in OC4J and the
    Xerces parser that the application was developed with. Under 10.1.3 OC4J it is possible to tell OC4J not to use the default XML parser for the application at deployment time.
    Solution
    1. Undeploy the existing application using AS Console.
    2. Start a new deployment of the application in AS Console. Click deploy
    3. On the Deploy: Select Archive screen, browse to your deployment war file. Click Next
    4. On the Deploy: Application Attributes give the application a name and click next
    5. On the Deploy: Deployment Settings screen, click the pencil "Go To Task" Icon for the Configure Class Loading option.
    6. Locate the shared library called "oracle.xml" (You may need to click "next 10" one or many times depending on the number of shared libraries you have) . For this row, UNCHECK the box for the column "IMPORT". Click OK
    7. Click deploy, then test you application.

  • What is default value of the javax.xml.transform.Transformer sys property?

    Hi all
    In my other thread "javax.xml.transform." last replied to on 17/04/05, I described that having & in my xml was causing TransformerExceptions when I attempted to apply a stylesheet to the xml.
    I've now deployed exactly the same xml, xsl and java on a completely different environment and have found that the error does NOT occur.
    This completely baffled me at first, but then I read the following in the API documentation for TransformerFactory: -
    "A TransformerFactory instance can be used to create Transformer and Templates objects.
    The system property that determines which Factory implementation to create is named "javax.xml.transform.TransformerFactory". This property names a concrete subclass of the TransformerFactory abstract class. If the property is not defined, a platform default is be used.
    I think that the key must lie in the system property "javax.xml.transform.TransformerFactory". The two environments must be using a different value for this - one representing a class that objects to & and one that doesn't. In neither case do I actually set this property, so my main question is what does it default to and how can I find out what each environment is using for this?
    I'm really baffled here guys, any help would be massively appreciated.
    Thank you
    Jon

    javax.xml.transform.TransformerFactory is a real class implemented by someone. It looks at the system property to figure out what actual implementation to use. It the property doesn't exist, it uses the class that came bundled with the javax.xml.transform.TransformerFactory class you are using.
    Here, for instance, is the javax.xml.transform.TransformerFactory that comes with jdk1.4.2
        public static TransformerFactory newInstance()
            throws TransformerFactoryConfigurationError
            try {
                return (TransformerFactory) FactoryFinder.find(
                    /* The default property name according to the JAXP spec */
                    "javax.xml.transform.TransformerFactory",
                    /* The fallback implementation class name */
                    "org.apache.xalan.processor.TransformerFactoryImpl");
            } catch (FactoryFinder.ConfigurationError e) {
                throw new TransformerFactoryConfigurationError(e.getException(),
                                                               e.getMessage());
        }

Maybe you are looking for