Transform xml datas

Hi,
I'm a real newbie in XML and Java. But I must use Java for this.
But all I want to do is the following:
I generate a XML file like this:
<day atday=12><hour athour=10><minute atminute=10>
<second atsecond=20>value1</second>
<second atsecond=21>value2</second>
<second atsecond=22>value3</second>
</minute></hour>
<hour athour=11><minute atminute=10>
<second atsecond=10>value4</second>
<second atsecond=11>value5</second>
</minute></hour></day>
Now I want to transform this to csv. Such that there is for every value in row2 the suitable date in row1.
Something like that:
12 10 10 20, value1
12 10 10 21, value2
12 10 10 22, value3
12 11 10 22, value4
If you have some similar code...please send it.
I need code which I can modify.
Thx

please refering jasperreports project in www.sourceforge.com.

Similar Messages

  • Transforming XML Data with XSLT in a servlet

    Trying to transform XML data using XSLT. The following code works fine outside of a servlet. But in a servlet it gives the following error :
    * Transformer Factory error
    javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: org.xml.sax.SAXException: Namespace not supported by SAXParser
    javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: org.xml.sax.SAXException: Namespace not supported by SAXParser
         at org.apache.xml.utils.DefaultErrorHandler.fatalError(DefaultErrorHandler.java:257)
         at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:813)
         at TransformationApp.XSLTTransformServlet.MyTransform(XSLTTransformServlet.java:79)
         at TransformationApp.XSLTTransformServlet.doGet(XSLTTransformServlet.java:39)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
         at org.apache.tomcat.core.Handler.service(Handler.java:287)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
         at java.lang.Thread.run(Thread.java:484)
    Several articles hinted at setting the factory namespace attribute to TRUE. I have tried that but same results. Here is the code :
    static Document document;
    DocumentBuilderFactory factory =
    DocumentBuilderFactory.newInstance();
    //factory.setNamespaceAware(true);
    //factory.setValidating(true);
    try {
    File stylesheet = new File(argv[0]);
    File datafile = new File(argv[1]);
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse(datafile);
    // Use a Transformer for output
    TransformerFactory tFactory =
    TransformerFactory.newInstance();
    StreamSource stylesource = new StreamSource(stylesheet);
    Transformer transformer = tFactory.newTransformer(stylesource);
    DOMSource source = new DOMSource(document);
    StreamResult result = new StreamResult(System.out);
    transformer.transform(source, result);
    } catch (TransformerConfigurationException tce) {
    // Error generated by the parser
    System.out.println ("\n** Transformer Factory error");
    System.out.println(" " + tce.getMessage() );
    // Use the contained exception, if any
    Throwable x = tce;
    if (tce.getException() != null)
    x = tce.getException();
    x.printStackTrace();
    } catch (TransformerException te) {
    // Error generated by the parser
    System.out.println ("\n** Transformation error");
    System.out.println(" " + te.getMessage() );
    // Use the contained exception, if any
    Throwable x = te;
    if (te.getException() != null)
    x = te.getException();
    x.printStackTrace();
    } catch (SAXException sxe) {
    // Error generated by this application
    // (or a parser-initialization error)
    Exception x = sxe;
    if (sxe.getException() != null)
    x = sxe.getException();
    x.printStackTrace();
    } catch (ParserConfigurationException pce) {
    // Parser with specified options can't be built
    pce.printStackTrace();
    } catch (IOException ioe) {
    // I/O error
    ioe.printStackTrace();
    Any help would be greatly appreciated.

    I don't know that this is true, but i think the problem is the classpath.
    The runtime has his own parser. This parser is befor your xalan.lib in the classpath and the
    parser from the runntime don't support namespace.
    Try Tomcat 4.
    Regard Dietmar

  • Problem in transforming xml data to HTML

    Hai all,
    I am new to J developer, I have generated XML data to transform to HTML.
    Below is my xsql file with the name 'simpleqry.xsql'
    <?xml version='1.0' ?>
    <page xmlns:xsql="urn:oracle-xsql" connection="java:comp/env/jdbc/testDS">
    <xsql:query max-rows="-1" tag-case="lower" null-indicator="no">SELECT EMPNO,ENAME,SAL FROM EMP WHERE SAL &gt;= 5000</xsql:query>
    </page>
    it is producing the XML datas
    Further I need to convert it into HTML
    so I generated xsl stylesheet in under META-INF with the name 'EmpDetails.xsl'
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output encoding="ISO-8859-1" method="text/html" />
    <xsl:template match="/page">
    <html>
    <head>
    <title>Employee Results</title>
    </head>
    <body>
    <H2> EMPLOYEE QUERY RESULTS</H2>
    <h5><em> Following demonstrates XSQL query</em></h5>
    <table border="1" cellspacing="1" align="center">
    <tr bgcolor=" #F9F0C1">
    <th>EMP ID</th>
    <th>EMPLOYEE NAME</th>
    <th>SALARY</th>
    </tr>
    <xsl:for-each select="ROWSET/ROW">
    <tr>
    <td><xsl:value-of select="EMPNO"/></td>
    <td><xsl:value-of select="ENAME"/></td>
    <td><xsl:value-of select="SAL"/></td>
    </tr>
    </xsl:for-each>
    </table>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>
    next I have added the following to simpleqry.xsql
    <?xml-stylesheet type="text/xsl" href="EmpResults.xsl" ?>
    so my simpleqry.xsql file look like this
    <?xml version='1.0' ?>
    <?xml-stylesheet type="text/xsl" href="C:\JDeveloper\mywork\Application1\querysql\public_html\WEB-INF\EmpDetails.xsl" ?>
    <page xmlns:xsql="urn:oracle-xsql" connection="java:comp/env/jdbc/testDS">
    <xsql:query max-rows="-1" tag-case="lower" null-indicator="no">SELECT EMPNO,ENAME,SAL FROM EMP WHERE SAL &gt;= 5000</xsql:query>
    </page>
    when I rerun my simpleqry.xsql file it not generating the output .
    My J developer version is 'Oracle IDE 11.1.2.0.38.60.17'
    I know I made it lengthy. I made it clear so that you can understand my problem clearly. Please explain me how to solve the above mentioned problem(To generate HTML from XML data)
    Thanks in advance.
    Regards,
    Uraja

    next I have added the following to simpleqry.xsql
    +<?xml-stylesheet type="text/xsl" href="EmpResults.xsl" ?>+
    so my simpleqry.xsql file look like this
    +<?xml version='1.0' ?>+
    +<?xml-stylesheet type="text/xsl" href="C:\JDeveloper\mywork\Application1\querysql\public_html\WEB-INF\EmpDetails.xsl" ?>+
    What is added is different from what is listed in the XSQL, the xsl is different, the path to xsl is different.
    Specify relative path for xsl.

  • Transforming XML data into SVG line charts using XSLT

    Hi
    I am trying to transform revenue data from an XML file into an SVG line chart. The problem is that I am quite new to XPath and XSLT and whereas I can draw the grid for my chart I struggle drawing the lines using the data from the XML doc.
    The XML look something like the one below, and I would like to have one chart for each product and in each chart having the time on the x-axis and chart the revenue by regions.
    Any help on this is much appreciated.
    Thanks
    Peter
    <?xml version="1.0"?>
    <revenue>
    <caption>
    <heading>My title</heading>
    </caption>
    <date name="01/01/2003">
    <region name="Asia">
    <product_a>30</product_a>
    <product_b>12</product_b>
    <product_c>301</product_c>
    </region>
    </date>
    <date name="02/01/2003">
    <region name="Asia">
    <product_a>32</product_a>
    <product_b>12</product_b>
    <product_c>301</product_c>
    </region>
    <region name="America">
    <product_a>57</product_a>
    <product_b>31</product_b>
    <product_c>457</product_c>
    </region>
    </date>
    <date name="03/01/2003">
    <region name="Asia">
    <product_a>38</product_a>
    <product_b>12</product_b>
    <product_c>301</product_c>
    </region>
    <region name="America">
    <product_a>31</product_a>
    <product_b>9</product_b>
    <product_c>357</product_c>
    </region>
    </date>
    <date name="04/01/2003">
    <region name="Asia">
    <product_a>33</product_a>
    <product_b>12</product_b>
    <product_c>301</product_c>
    </region>
    <region name="America">
    <product_a>43</product_a>
    <product_b>16</product_b>
    <product_c>430</product_c>
    </region>
    </date>
    <date name="05/01/2003">
    <region name="Asia">
    <product_a>36</product_a>
    <product_b>12</product_b>
    <product_c>301</product_c>
    </region>
    <region name="America">
    <product_a>54</product_a>
    <product_b>1</product_b>
    <product_c>561</product_c>
    </region>
    </date>
    </revenue>

    You could try Jeni's XSLT utilities for SVG :
    http://www.jenitennison.com/xslt/utilities/svg-utils.html
    Specifically, the sample code provided, when a couple of SVG charts are being generated from XML data :
    http://www.jenitennison.com/xslt/utilities/svg-example.html
    Hope that helps.

  • Transforming XML data into SVG line charts

    Hi
    I am trying to transform revenue data from an XML file into an SVG line chart. The problem is that I am quite new to XPath and XSLT and whereas I can draw the grid for my chart I struggle drawing the lines using the data from the XML doc.
    The XML look something like the one below, and I would like to have one chart for each product and in each chart having the time on the x-axis and chart the revenue by regions.
    Any help on this is much appreciated.
    Thanks
    Peter
    <?xml version="1.0"?>
    <revenue>
    <caption>
    <heading>My title</heading>
    </caption>
    <date name="01/01/2003">
    <region name="Asia">
    <product_a>30</product_a>
    <product_b>12</product_b>
    <product_c>301</product_c>
    </region>
    </date>
    <date name="02/01/2003">
    <region name="Asia">
    <product_a>32</product_a>
    <product_b>12</product_b>
    <product_c>301</product_c>
    </region>
    <region name="America">
    <product_a>57</product_a>
    <product_b>31</product_b>
    <product_c>457</product_c>
    </region>
    </date>
    <date name="03/01/2003">
    <region name="Asia">
    <product_a>38</product_a>
    <product_b>12</product_b>Long postings are being truncated to ~1 kB at this time.

    Instead of using SVG charting can I suggest that you look into digital charts. This service creates charts on the fly and is very easy to integrate with web applications.
    Christopher
    www.billboard.net

  • Transforming xml data to cross tab in rtf template

    Hi everyone,
    Here is my requirement, I need the following output
    -------------------------------------------Date
    Territory-------District------Office---1/3/2011----1/10/2011---1/17/2011------Grand Total(Header row)
    Central ----------Chicago---Buffalo-- 100.0---------99.0-----------100.0-------------299.0
    ----------------------------------arora-----100.0---------100.0----------100.0-------------300.0
    -------------------chicago total---------200.0----------199.0----------200.0-------------599.0
    --------------------Dallas------arlington-100.0----------99.0-----------100.0-------------299.0
    ---------------------------------irving------100.0----------100.0----------100.0-------------300.0
    -------------------Dallas total-------------200.0----------199.0----------200.0-------------599.0
    Teritory total----------------------------400.0-----------398.0---------400.0--------------1198.0
    the values under dates are the sum of Item_Count field for each office for that date
    and below is my xml
    <ROWSET>
    <ROW>
    <ITEM_COUNT>50</ITEM_COUNT>
    <DATE>01/03/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Chicago</DISTRICT_NAME>
    <OFFICE_NAME>Buffalo</OFFICE_NAME>
    </ROW>
    <ROW>
    <ITEM_COUNT>50</ITEM_COUNT>
    <DATE>01/03/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Chicago</DISTRICT_NAME>
    <OFFICE_NAME>Buffalo</OFFICE_NAME>
    </ROW>
    <ROW>
    <ITEM_COUNT>50</ITEM_COUNT>
    <DATE>01/10/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Chicago</DISTRICT_NAME>
    <OFFICE_NAME>Buffalo</OFFICE_NAME>
    </ROW>
    <ROW>
    <ITEM_COUNT>49</ITEM_COUNT>
    <DATE>01/10/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Chicago</DISTRICT_NAME>
    <OFFICE_NAME>Buffalo</OFFICE_NAME>
    </ROW>
    <ROW>
    <ITEM_COUNT>50</ITEM_COUNT>
    <DATE>01/17/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Chicago</DISTRICT_NAME>
    <OFFICE_NAME>arora</OFFICE_NAME>
    </ROW>
    <ROW>
    <ITEM_COUNT>50</ITEM_COUNT>
    <DATE>01/17/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Chicago</DISTRICT_NAME>
    <OFFICE_NAME>arora</OFFICE_NAME>
    </ROW>
    <ROW>
    <ITEM_COUNT>50</ITEM_COUNT>
    <DATE>01/03/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Chicago</DISTRICT_NAME>
    <OFFICE_NAME>arora</OFFICE_NAME>
    </ROW>
    <ROW>
    <ITEM_COUNT>50</ITEM_COUNT>
    <DATE>01/03/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Chicago</DISTRICT_NAME>
    <OFFICE_NAME>arora</OFFICE_NAME>
    </ROW>
    <ROW>
    <ITEM_COUNT>50</ITEM_COUNT>
    <DATE>01/10/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Chicago</DISTRICT_NAME>
    <OFFICE_NAME>arora</OFFICE_NAME>
    </ROW>
    <ROW>
    <ITEM_COUNT>49</ITEM_COUNT>
    <DATE>01/10/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Chicago</DISTRICT_NAME>
    <OFFICE_NAME>arora</OFFICE_NAME>
    </ROW>
    <ROW>
    <ITEM_COUNT>50</ITEM_COUNT>
    <DATE>01/17/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Chicago</DISTRICT_NAME>
    <OFFICE_NAME>arora</OFFICE_NAME>
    </ROW>
    <ROW>
    <ITEM_COUNT>50</ITEM_COUNT>
    <DATE>01/17/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Chicago</DISTRICT_NAME>
    <OFFICE_NAME>arora</OFFICE_NAME>
    </ROW>
    <ROW>
    <ITEM_COUNT>50</ITEM_COUNT>
    <DATE>01/03/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Dallas</DISTRICT_NAME>
    <OFFICE_NAME>arlington</OFFICE_NAME>
    </ROW>
    <ROW>
    <ITEM_COUNT>50</ITEM_COUNT>
    <DATE>01/03/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Dallas</DISTRICT_NAME>
    <OFFICE_NAME>arlington</OFFICE_NAME>
    </ROW>
    <ROW>
    <ITEM_COUNT>50</ITEM_COUNT>
    <DATE>01/10/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Dallas</DISTRICT_NAME>
    <OFFICE_NAME>arlington</OFFICE_NAME>
    </ROW>
    <ROW>
    <ITEM_COUNT>49</ITEM_COUNT>
    <DATE>01/10/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Dallas</DISTRICT_NAME>
    <OFFICE_NAME>arlington</OFFICE_NAME>
    </ROW>
    <ROW>
    <ITEM_COUNT>50</ITEM_COUNT>
    <DATE>01/17/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Dallas</DISTRICT_NAME>
    <OFFICE_NAME>arlington</OFFICE_NAME>
    </ROW>
    <ROW>
    <ITEM_COUNT>50</ITEM_COUNT>
    <DATE>01/17/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Dallas</DISTRICT_NAME>
    <OFFICE_NAME>arlington</OFFICE_NAME>
    </ROW>
    <ITEM_COUNT>50</ITEM_COUNT>
    <DATE>01/03/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Dallas</DISTRICT_NAME>
    <OFFICE_NAME>irving</OFFICE_NAME>
    </ROW>
    <ROW>
    <ITEM_COUNT>50</ITEM_COUNT>
    <DATE>01/03/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Dallas</DISTRICT_NAME>
    <OFFICE_NAME>irving</OFFICE_NAME>
    </ROW>
    <ROW>
    <ITEM_COUNT>50</ITEM_COUNT>
    <DATE>01/10/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Dallas</DISTRICT_NAME>
    <OFFICE_NAME>irving</OFFICE_NAME>
    </ROW>
    <ROW>
    <ITEM_COUNT>49</ITEM_COUNT>
    <DATE>01/10/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Dallas</DISTRICT_NAME>
    <OFFICE_NAME>irving</OFFICE_NAME>
    </ROW>
    <ROW>
    <ITEM_COUNT>50</ITEM_COUNT>
    <DATE>01/17/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Dallas</DISTRICT_NAME>
    <OFFICE_NAME>irving</OFFICE_NAME>
    </ROW>
    <ROW>
    <ITEM_COUNT>50</ITEM_COUNT>
    <DATE>01/17/2011</DATE>
    <TERRITORY>CENTRAL</TERRITORY>
    <DISTRICT_NAME>Dallas</DISTRICT_NAME>
    <OFFICE_NAME>irving</OFFICE_NAME>
    </ROW>
    </ROWSET>
    Greatly apprciate any help
    Thanks in Advance

    Have you tried creating a Pivot Table and tweaking the table to get the desired output?
    I can send you the RTF if you provide me an email address or send me an email at [email protected]
    Thanks!
    I have sent you the template based on your email. Take a look.
    Edited by: BIPuser on Jan 21, 2011 1:52 PM

  • Transforming XML source to (X)HTML StreamResult outputs long comment

    Hi,
    I'm using javax.xml.transform.* to transform XML data into an XHTML page. The XML data represents a document (contains information about headers, paragraphs, related pages, etc.) and an XSL file is used to properly transform that data into an XHTML compatible file. All transformations go just as they should, however, the XHTML output contains a very lenthy comment about elements and attributes concerning HTML. Obviously, I do not want this comment in my final output. As a side note: I'm using a StreamSource(File) for the XML data source, a StreamSource(File) for the XSL file and a StreamResult(HttpServletResponse.getOutputStream()) for the HTML output. I'm not sure wether the problem is with using a StreamResult directly (rather than a SAXResult), or because I'm outputting directly to the servlet output stream. All input and output is in UTF-8, and the HttpServletResponse has been configured using setCharacterEncoding("UTF-8") and setContentType("text/html").
    Everything works fine, except I get this stinkin' long comment, which I want gone.
    Thanks,
    Yuthura

    I get the following result.html file (properly transformed and displayed in my browser, except for the comment):
    <!--================== Imported Names ====================================-->
    <!-- media type, as per [RFC2045] -->
    <!-- comma-separated list of media types, as per [RFC2045] -->
    <!-- a character encoding, as per [RFC2045] -->
    <!-- a space separated list of character encodings, as per [RFC2045] -->
    <!-- a language code, as per [RFC3066] -->
    <!-- a single character, as per section 2.2 of [XML] -->
    <!-- one or more digits -->
    <!-- space-separated list of link types -->
    <!-- single or comma-separated list of media descriptors -->
    <!-- a Uniform Resource Identifier, see [RFC2396] -->
    <!-- a space separated list of Uniform Resource Identifiers -->
    <!-- date and time information. ISO date format -->
    <!-- script expression -->
    <!-- style sheet data -->
    <!-- used for titles etc. -->
    <!-- nn for pixels or nn% for percentage length -->
    <!-- pixel, percentage, or relative -->
    <!-- integer representing length in pixels -->
    <!-- these are used for image maps -->
    <!-- comma separated list of lengths -->
    <!--=================== Generic Attributes ===============================-->
    <!-- core attributes common to most elements
    id document-wide unique id
    class space separated list of classes
    style associated style info
    title advisory title/amplification
    -->
    <!-- internationalization attributes
    lang language code (backwards compatible)
    xml:lang language code (as per XML 1.0 spec)
    dir direction for weak/neutral text
    -->
    <!-- attributes for common UI events
    onclick a pointer button was clicked
    ondblclick a pointer button was double clicked
    onmousedown a pointer button was pressed down
    onmouseup a pointer button was released
    onmousemove a pointer was moved onto the element
    onmouseout a pointer was moved away from the element
    onkeypress a key was pressed and released
    onkeydown a key was pressed down
    onkeyup a key was released
    -->
    <!-- attributes for elements that can get the focus
    accesskey accessibility key character
    tabindex position in tabbing order
    onfocus the element got the focus
    onblur the element lost the focus
    -->
    <!--=================== Text Elements ====================================-->
    <!-- these can occur at block or inline level -->
    <!-- these can only occur at block level -->
    <!-- %Inline; covers inline or "text-level" elements -->
    <!--================== Block level elements ==============================-->
    <!-- %Flow; mixes block and inline and is used for list items etc. -->
    <!--================== Content models for exclusions =====================-->
    <!-- a elements use %Inline; excluding a -->
    <!-- pre uses %Inline excluding big, small, sup or sup -->
    <!-- form uses %Block; excluding form -->
    <!-- button uses %Flow; but excludes a, form and form controls -->
    <!--================ Document Structure ==================================-->
    <!-- the namespace URI designates the document profile -->
    <!--================ Document Head =======================================-->
    <!-- content model is %head.misc; combined with a single
    title and an optional base element in any order -->
    <!-- The title element is not considered part of the flow of text.
    It should be displayed, for example as the page header or
    window title. Exactly one title is required per document.
    -->
    <!-- document base URI -->
    <!-- generic metainformation -->
    <!--
    Relationship values can be used in principle:
    a) for document specific toolbars/menus when used
    with the link element in document head e.g.
    start, contents, previous, next, index, end, help
    b) to link to a separate style sheet (rel="stylesheet")
    c) to make a link to a script (rel="script")
    d) by stylesheets to control how collections of
    html nodes are rendered into printed documents
    e) to make a link to a printable version of this document
    e.g. a PostScript or PDF version (rel="alternate" media="print")
    -->
    <!-- style info, which may include CDATA sections -->
    <!-- script statements, which may include CDATA sections -->
    <!-- alternate content container for non script-based rendering -->
    <!--=================== Document Body ====================================-->
    <!-- generic language/style container -->
    <!--=================== Paragraphs =======================================-->
    <!--=================== Headings =========================================-->
    <!--
    There are six levels of headings from h1 (the most important)
    to h6 (the least important).
    --> ... (more to come)

  • BI Admin Tool and XSLT transformation for XML data source - How it works ?

    Hello,
    There is a possibility to import data from XML data source using BI Admin Tool.
    In the import window we can point XSLT file. What is the purpose of that XSLT field?
    Why I am asking ?
    I thought it is smth like XSLT processor, but simply it doesnt work.
    What I did:
    - I pointed XML data source file
    - I pointed XSLT transformation file
    - Click OK, and still get the message that the XML file structure is not supported
    After that I transformed that XML file with some desktop XSLT processor using the same XSLT file, and I tried to connect that file directly using BI Admin tool.Then it works. So it means that the transformation is ok.
    So basically one question comes to my mind in that situation:
    What is the purpose of XSLT field in BI Admin Tool when it comes to XML data source ?
    (it doesnt look like XSLT processor)
    Greetings
    /Michal

    Hi Mariano
    Why you need to use XSLT for transforming XML file into ABAP table
    Code is a part of some ABAP report. Looks like it is reading a file from file system and updating table after transformation
    If you have requirement like you need to read XML file and then insert the data into a SAP table
    You can use
    File to RFC
    File to Proxy scenario using SAP PI.
    Please provide more inputs on requirement to help
    Thanks
    Gaurav

  • Complex transformation inserting xml data to oracle database.

    Hi,
    I Have one small Problem While loading xml data to a oracle database.
    In the XSD i have the Columns Like this.
    <Data>
    <Type_Trs>
    <T1>
    <T2>
    </Data>
    My Database contains only two columns
    For Example:
    Type_Trs
    Corr_Data.
    Now My problem is Based on Type_Trs Value i need to take values of T1 and T2 should be loaded in Corr_Data column.
    How to write Xsl transformation for this using <xsl:choose>.
    For Clearing the Question I am giving the Example.
    Case : 1
    <Data>
    <type_Trs>BO</Type_Trs>
    <T1>1</T1>
    <T2>2</T2>
    </Data>
    In the Example my type_trs is value 'BO', so the Data in table should be
    Type_Trs Corr_Data
    ======= =======
    BO 1
    Case : 2
    <Data>
    <type_Trs>CP</Type_Trs>
    <T1>1</T1>
    <T2>2</T2>
    </Data>
    In the Example my type_trs is value 'CP', so the Data in table should be
    Type_Trs Corr_Data
    ======= =======
    CP 2
    For doing this How can i write my XSL transformation based on the condition?
    Thanks in advances
    Regards
    GSR

    Why do you need a XSL transformation for this? Can you not get the results based on this select:
    SQL> SELECT DISTINCT EXTRACTVALUE (t2.COLUMN_VALUE, 'Type_Trs') type_trs,
                    CASE EXTRACTVALUE (t2.COLUMN_VALUE, 'Type_Trs')
                       WHEN 'BO'
                          THEN EXTRACTVALUE (t3.COLUMN_VALUE, 'T1')
                       WHEN 'CP'
                          THEN EXTRACTVALUE (t4.COLUMN_VALUE, 'T2')
                    END corr_data
               FROM TABLE
                       (XMLSEQUENCE
                           (EXTRACT
                               (XMLTYPE
                                   ('<Data>
                          <Type_Trs>BO</Type_Trs>
                          <T1>1</T1>
                          <T2>2</T2>
                          <Type_Trs>CP</Type_Trs>
                          <T1>1</T1>
                          <T2>2</T2>
                        </Data>'
                                '/Data'
                       ) t1,
                    TABLE (XMLSEQUENCE (EXTRACT (t1.COLUMN_VALUE,
                                                 '/Data/Type_Trs')
                          ) t2,
                    TABLE (XMLSEQUENCE (EXTRACT (t1.COLUMN_VALUE, '/Data/T1'))) t3,
                    TABLE (XMLSEQUENCE (EXTRACT (t1.COLUMN_VALUE, '/Data/T2'))) t4
    TYPE_TRS   CORR_DATA
    CP         2        
    BO         1        

  • XSL transform question from XML date datatype to SQL date datatype

    Just to give an idea, I am reading some employee information in a CSV format and I have created the fileadapter to read it and parse it into coherent information where each comma separated value corresponds to a column in an employee table. One of the columns is of the date object in the database.
    So my my variable is created with a list of employees and then fed into the invoke that calls a dbadapter that does the insert. I am using a transformation to get the values from one variable into the other simply because of namespace conflicts. However the xml date will not match the sql date object as to be expected...but how do I work around it? I have a few ideas but I am not sure they are worth mentioning.
    Any suggestions?

    @@Version : ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Microsoft SQL Server 2012 - 11.0.5058.0 (X64)
        May 14 2014 18:34:29
        Copyright (c) Microsoft Corporation
        Developer Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: ) (Hypervisor)
    (1 row(s) affected)
    Compatibility level is set to 110 .
    One of the limitation states - XML columns with a depth of more than 128 nested nodes
    How do i verify this ? Thanks .
    Rajkumar Yelugu

  • Xml data into non-xml database.. solution anyone?

    Hi,
    My current project requires me to store the client's data on our servers. We're using Oracle9i. Daily, I will download the client's data for that day and load it into our database. My problem is that the data file is not a flat file so I can't use sql*loader to load the data. Instead, the data file is an xml file. What is the best way to load xml data into a non-xml database? Are there any tools similar to sql*Loader that will load xml data into non-xml database? Is it the best solution for the client to give me an XML dump of their data to load into our database, or should I request a flat file? My last resort would be to write some sort of a script to parse the xml data into a flat file, and then run it through sql*loader. Is this the best solution? One thing to note is that these files could be very large.
    Thanks in advance.
    -PV

    I assume that just putting the XML file into an
    extremely large VARCHAR field is not what you want.
    Instead, you want to extract data elements from the
    XML and write them to columns in a table in your
    database. Right?Yes. Your assumption is correct.
    It sounds like you already have a script that loads a
    flat file into your database. In that case I would
    write an XSL transformation that converts the client's
    XML into a correctly-formatted flat file.Thank you. I'll look into that. Other suggestions are welcome.

  • Xml data into internal table

    Hi Friends,
    See the followong code which converts xml data into itab.
    *& Report  ZTEST_XML1                                                  *
    REPORT  ZTEST_XML1                              .
    *PURPOSE: This program transfers XML data into SAP internal table format
    *The nodes in DOM can be stored as fields in SAP Internal table
    type pool definitions
    TYPE-POOLS: ixml. "iXML Library Types
    type definitions
    TYPES: BEGIN OF t_xml_line, "Structure for holding XML data
    data(256) TYPE x,
    END OF t_xml_line.
    DATA: l_ixml TYPE REF TO if_ixml,
    l_streamfactory TYPE REF TO if_ixml_stream_factory,
    l_parser TYPE REF TO if_ixml_parser,
    l_istream TYPE REF TO if_ixml_istream,
    l_document TYPE REF TO if_ixml_document,
    l_node TYPE REF TO if_ixml_node,
    l_xmldata TYPE string.
    DATA: l_elem TYPE REF TO if_ixml_element,
    l_root_node TYPE REF TO if_ixml_node,
    l_next_node TYPE REF TO if_ixml_node,
    l_name TYPE string,
    l_iterator TYPE REF TO if_ixml_node_iterator.
    DATA: l_xml_table TYPE TABLE OF t_xml_line, " XML Table of the structure
    *t_xml_line
    l_xml_line TYPE t_xml_line, " Record of structure t_xml_line
    l_xml_table_size TYPE i. " XML table size
    DATA: l_filename TYPE string. " String to hold filename
    data: begin of i_final occurs 0,
          pnumber(20),
          pname(50),
          pdes(70),
          end of i_final.
    PARAMETERS: pa_file TYPE char1024 DEFAULT 'C:\product.xml'.
    Validation of XML file: Only DTD included in XML document is supported
    PARAMETERS: pa_val TYPE char1 AS CHECKBOX.
    start of selection
    START-OF-SELECTION.
    Creating the main iXML factory
    l_ixml = cl_ixml=>create( ).
    Creating a stream factory
    l_streamfactory = l_ixml->create_stream_factory( ).
    PERFORM get_xml_table CHANGING l_xml_table_size l_xml_table.
    Wrap the table containing the file into a stream.
    l_istream = l_streamfactory->create_istream_itable( table = l_xml_table
    size = l_xml_table_size ).
    Creating a document
    l_document = l_ixml->create_document( ).
    Creating a Parser
    l_parser = l_ixml->create_parser( stream_factory = l_streamfactory
    istream = l_istream
    document = l_document ).
    Validate a document
    IF pa_val = 'X'.
    l_parser->set_validating( mode = if_ixml_parser=>co_validate ).
    ENDIF.
    Parse the stream
    IF l_parser->parse( ) <> 0.
    IF l_parser->num_errors( ) <> 0.
    DATA: parseerror TYPE REF TO if_ixml_parse_error,
    str TYPE string,
    i TYPE i,
    count TYPE i,
    index TYPE i.
    count = l_parser->num_errors( ).
    WRITE: count, ' parse errors have occured:'.
    index = 0.
    WHILE index < count.
    parseerror = l_parser->get_error( index = index ).
    i = parseerror->get_line( ).
    WRITE: 'line: ', i.
    i = parseerror->get_column( ).
    WRITE: 'column: ', i.
    str = parseerror->get_reason( ).
    WRITE: str.
    index = index + 1.
    ENDWHILE.
    ENDIF.
    ENDIF.
    Process the document
    IF l_parser->is_dom_generating( ) EQ 'X'.
    PERFORM process_dom USING l_document.
    ENDIF.
    *& Form get_xml_table
    text
    <--P_L_XML_TABLE_SIZE text
    <--P_L_XML_TABLE text
    FORM get_xml_table CHANGING p_l_xml_table_size
    p_l_xml_table.
    Local variable declarations
    DATA: l_len TYPE i,
    l_len2 TYPE i,
    l_tab TYPE tsfixml,
    l_content TYPE string,
    l_str1 TYPE string,
    c_conv TYPE REF TO cl_abap_conv_in_ce,
    l_itab TYPE TABLE OF string.
    l_filename = pa_file.
    Upload file from the client's workstation
    CALL METHOD cl_gui_frontend_services=>gui_upload
    EXPORTING
    filename = l_filename
    filetype = 'BIN'
    IMPORTING
    filelength = l_xml_table_size
    CHANGING
    data_tab = l_xml_table
    EXCEPTIONS
    OTHERS = 19.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Writing the XML document to the screen
    CLEAR l_str1.
    LOOP AT l_xml_table INTO l_xml_line.
    c_conv = cl_abap_conv_in_ce=>create( input = l_xml_line-data replacement
    = space ).
    c_conv->read( IMPORTING data = l_content len = l_len ).
    CONCATENATE l_str1 l_content INTO l_str1.
    ENDLOOP.
    l_str1 = l_str1+0(l_xml_table_size).
    SPLIT l_str1 AT cl_abap_char_utilities=>cr_lf INTO TABLE l_itab.
    WRITE: /.
    WRITE: /' XML File'.
    WRITE: /.
    LOOP AT l_itab INTO l_str1.
    REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>horizontal_tab IN
    l_str1 WITH space.
    WRITE: / l_str1.
    ENDLOOP.
    WRITE: /.
    ENDFORM. " get_xml_table
    *& Form process_dom
    text
    -->P_L_DOCUMENT text
    FORM process_dom USING document TYPE REF TO if_ixml_document.
    DATA: node TYPE REF TO if_ixml_node,
    iterator TYPE REF TO if_ixml_node_iterator,
    nodemap TYPE REF TO if_ixml_named_node_map,
    attr TYPE REF TO if_ixml_node,
    name TYPE string,
    prefix TYPE string,
    value TYPE string,
    indent TYPE i,
    count TYPE i,
    index TYPE i.
    node ?= document.
    CHECK NOT node IS INITIAL.
    ULINE.
    WRITE:/.
    WRITE: /' DOM-TREE'.
    WRITE: /.
    IF node IS INITIAL.
    EXIT.
    ENDIF.
    Create a node iterator
    iterator = node->create_iterator( ).
    Get current node
    node = iterator->get_next( ).
    Loop over all nodes
    WHILE NOT node IS INITIAL.
    indent = node->get_height( ) * 2.
    indent = indent + 20.
    CASE node->get_type( ).
    WHEN if_ixml_node=>co_node_element.
    element node
    name = node->get_name( ).
    nodemap = node->get_attributes( ).
    WRITE: / 'ELEMENT :'.
    WRITE: AT indent name COLOR COL_POSITIVE INVERSE.
    IF NOT nodemap IS INITIAL.
    attributes
    count = nodemap->get_length( ).
    DO count TIMES.
    index = sy-index - 1.
    attr = nodemap->get_item( index ).
    name = attr->get_name( ).
    prefix = attr->get_namespace_prefix( ).
    value = attr->get_value( ).
    WRITE: / 'ATTRIBUTE:'.
    WRITE: AT indent name COLOR COL_HEADING INVERSE, '=',
    value COLOR COL_TOTAL INVERSE.
    ENDDO.
    ENDIF.
    WHEN if_ixml_node=>co_node_text OR
    if_ixml_node=>co_node_cdata_section.
    text node
    value = node->get_value( ).
    WRITE: / 'VALUE :'.
    WRITE: AT indent value COLOR COL_GROUP INVERSE.
    ENDCASE.
    Advance to next node
    node = iterator->get_next( ).
    ENDWHILE.
    *delete adjacent duplicates from  i_final.
    *loop at i_final.
    *write:/ i_final-pnumber,i_final-pname,i_final-pdes.
    *endloop.
    *if not i_final[] is initial.
    *modify ztestproduct from table i_final.
    *endif.
    ENDFORM. " process_dom
    in the above code at line no: 268 there is a method:
    value = node->get_value( ).in which actual data from XML file is coming.
    So the varibale "Value" contains the data.
    see line no: 270:
    WRITE: AT indent value COLOR COL_GROUP INVERSE.
    what ever values i am getting here i want to append to a Internal table ...
    Can any body tell me how to do that?
    i am sure of reward points.

    Hai Ravi
    REPORT abc.
    DATA
    DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.
    DATA : BEGIN OF itab OCCURS 0,
    a(100) TYPE c,
    END OF itab.
    DATA: xml_out TYPE string .
    DATA : BEGIN OF upl OCCURS 0,
    f(255) TYPE c,
    END OF upl.
    DATA: xmlupl TYPE string .
    FIRST PHASE
    FIRST PHASE
    FIRST PHASE
    Fetch Data
    SELECT * FROM t001 INTO TABLE t001.
    XML
    CALL TRANSFORMATION ('ID')
    SOURCE tab = t001[]
    RESULT XML xml_out.
    Convert to TABLE
    CALL FUNCTION 'HR_EFI_CONVERT_STRING_TO_TABLE'
    EXPORTING
    i_string = xml_out
    i_tabline_length = 100
    TABLES
    et_table = itab.
    Download
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    filetype = 'BIN'
    filename = 'd:\xx.xml'
    TABLES
    data_tab = itab.
    SECOND PHASE
    SECOND PHASE
    SECOND PHASE
    BREAK-POINT.
    REFRESH t001.
    CLEAR t001.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = 'D:\XX.XML'
    filetype = 'BIN'
    TABLES
    data_tab = upl.
    LOOP AT upl.
    CONCATENATE xmlupl upl-f INTO xmlupl.
    ENDLOOP.
    XML
    CALL TRANSFORMATION ('ID')
    SOURCE XML xmlupl
    RESULT tab = t001[].
    Regards
    Sreeni

  • XML Data Load into releational structures

    Hi,
    I am very unexperienced in using XML and have the problem
    to import very large XML data files into existing reletional structures.
    In our production DB we don't use the java engine, so
    that PL/SQL an the SQL Loader are the only available ways to import the data.
    At the moment we get flat files and use the SQL Loader utility. But an interface to a new system send XML data now and I have to fill the same old releational structure with the new data.
    Can anybody give me a hint about the best technic for an high performance import. Are there any existing tools for the relational mapping?
    Regards Ralph

    Thank you for your reply.
    You are right. We only want to break the XML to fill our relational structures. We don't need the XML data further on. But we have to load the data in temporary structures, because we have to transform the data in our own format. (The system which delivers the XML data is external and uses another data model)
    Is there no more elegant way with use of databse built in technics? The XML data we get can be validated against a XML schema.
    So I thought, it could be a way to load the XML in the XDB and register the schema in the database. After that store the XML data in the default generated object relational structures and then programm the data transformation and the data flow between these default structures to our target data structures with PL/SQL.
    I don't know if this way is performant enough.
    If I use an external tool i have to code the relational mapping outside the database and insert the data with use of ODBC in temporary structures which i have to create manualy.
    So I hoped to find a way to load the data in any relational structure using the advantages of XML and XML schema and code the neccasary logic inside the DB.
    Do you have any further hints for my problem?
    Regards Ralph

  • Reading XML Data from ABAP Program?

    Hi,
    How do I read XML Data from an ABAP Program? For example if I have the below basic XML Code-
    <xml>
    <Name> Thiru </Name>
    <Age> 24 </Age>
    <City> chennai </Chennai>
    </xml>
    How do i read the data within the Name,Age, and City tags into variables in the ABAP Program?
    Regards,
    Thiru

    if you decide to do in XSLT, I have a sample list here:
    XML file like this:
    <?xml version="1.0" encoding="UTF-16"?>
    <F>
    <P1>
    <t_1>value1</t_1>
    <t_2>testvalue</t_2>
    </P1>
    <P2>
    </P2>
    </F>
    XSLT file like this:
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sapxsl="http://www.sap.com/sapxsl" version="1.0">
    <xsl:strip-space elements="*"/>
    <xsl:template match="F">
    <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
    <asx:values>
    <<b>DOCUMENT</b>>
    <xsl:apply-templates/>
    </<b>DOCUMENT</b>>
    </asx:values>
    </asx:abap>
    </xsl:template>
    <xsl:template match="P1">
    <ENTRY>
    <<b>T_1</b>><xsl:value-of select="t_1"/></T_1>
    <<b>T_2</b>><xsl:value-of select="t_2"/></T_2>
    </ENTRY>
    </xsl:template>
    </xsl:transform>
    ABAP program like this:
    DATA: BEGIN OF wa_upload,
    text(255) TYPE c,
    END OF wa_upload,
    itab_upload LIKE TABLE OF wa_upload,
    BEGIN OF wa_document,
    t_1 TYPE string,
    t_2 TYPE string,
    END OF wa_document,
    itab_document LIKE TABLE OF wa_document.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = 'XXXXX'
    filetype = 'ASC'
    TABLES
    data_tab = itab_upload.
    CALL TRANSFORMATION zrappel_xml_test
    SOURCE XML itab_upload
    RESULT <b>document</b> = itab_document.
    You should pay attention to the bold words.
    hope it will be helpful
    thanks

  • Best method to load XML data into Oracle

    Hi,
    I have to load XML data into Oracle tables. I tried using different options and have run into a dead end in each of those. I do not have knowledge of java and hence have restricted myself to PL/SQL solutions. I tried the following options.
    1. Using DBMS_XMLSave package : Expects the ROWSET and ROW tags. Connot change format of the incoming XML file (Gives error oracle.xml.sql.OracleXMLSQLException: Start of root element expected).
    2. Using the XMLPARSER and XMLDOM PL/SQL APIs : Works fine for small files. Run into memory problems for large files (Gives error java.lang.OutOfMemoryError). Have tried increasing the JAVA_POOL_SIZE but does not work. I am not sure whether I am changing the correct parameter.
    I have read that the SAX API does not hog memory resources since it does not build the entire DOM tree structure. But the problem is that it does not have a PL/SQL implementation.
    Can anyone PLEASE guide me in the right direction, as to the best way to achieve this through PL/SQL ??? I have not designed the tables so am flexible on using purely relational or object-relational design. Although would prefer to keep a purely relational design. (Had tried used object-relational for 1. and purely relational for 2. above)
    The XML files are in the following format, (EXAMINEEs with single DEMOGRAPHIC and multiple TESTs)
    <?xml version="1.0"?>
    <Root_Element>
    <Examinee>
    <MACode>A</MACode>
    <TestingJID>TN</TestingJID>
    <ExamineeID>100001</ExamineeID>
    <CreateDate>20020221</CreateDate>
    <Demographic>
    <InfoDate>20020221</InfoDate>
    <FirstTime>1</FirstTime>
    <LastName>JANE</LastName>
    <FirstName>DOE</FirstName>
    <MiddleInitial>C</MiddleInitial>
    <LithoNumber>73</LithoNumber>
    <StreetAddress>SomeAddress</StreetAddress>
    <City>SomeCity</City>
    <StateCode>TN</StateCode>
    <ZipCode>37000</ZipCode>
    <PassStatus>1</PassStatus>
    </Demographic>
    <Test>
    <TestDate>20020221</TestDate>
    <TestNbr>1</TestNbr>
    <SrlNbr>13773784</SrlNbr>
    </Test>
    <Test>
    <TestDate>20020221</TestDate>
    <TestNbr>2</TestNbr>
    <SrlNbr>13773784</SrlNbr>
    </Test>
    </Examinee>
    </Root_Element>
    Thanks for the help.

    Please refer to the XSU(XML SQL Utility) or TransX Utility(for Multi-language Document) if you want to load data in XML format into database.
    Both of them require special XML formats, please first refer to the following docs:
    http://otn.oracle.com/docs/tech/xml/xdk_java/doc_library/Production9i/doc/java/xsu/xsu_userguide.html
    http://otn.oracle.com/docs/tech/xml/xdk_java/doc_library/Production9i/doc/java/transx/readme.html
    You can use XSLT to transform your document to the required format.
    If you document is large, you can use SAX method to insert data into database. But you need to write the code.
    The following sample may be useful:
    http://otn.oracle.com/tech/xml/xdk_sample/xdksample_040602i.html

Maybe you are looking for

  • Java files open in SQL Developer instead of JDeveloper

    JDEV 10.1.3 Windows XP When I double click a java file, it opens in SQL Developer instead of JDeveloper. When I right click a java file, and select 'Open With'->jdeveloper, the java file always opens in SQL Developer instead of JDeveloper. I've tried

  • E 63 WLAN - No gateway reply

    Hello All I bought Nokia E63 recently.  I bought it in India.  In India i was able to use the WLAN (Open network) in my house.  After a month i moved to Amsterdam.  In the house we have THOMSON SpeedTouch 780. Wireless router provided by KPN.  This h

  • Nokia Search cannot find the items on my phone

    The Nokia Search function seems to fail to find items on my phone. This happens to Contacts, Email, Calendar, Notes. And the failure is consistent. Is there some indexing process I have to go through before the Search function would know how to searc

  • My last attempt to get a real answer or help...

    I had no help from the store.  When I bought the Gamecom 780 Headset I was asked if I wanted a 2 year warranty.  I said yes.  The reason I bought it was because the headset was 79.99.  I wanted to make sure I got my money's worth.  Bought it beginnin

  • Sales order search enhancement

    Hi, I am new to web ui. My requirement is to add a custom field to the sales order search criteria. Please provide any documents which helps me in solving the requirement . Thanks, Srinivas. Moderator message: Please review rules of engagement in ask