Break in XML

I'm doing a transformation from an XML document, and want to display rows, but break on a particular column (i.e. List employees by department, but only show the department one time). I have experimented with all sorts of combinations using <xsl:variable> to compare the last department value to the current one, but for some reason, when I assign a value to the last variable, it gets lost. Here is the XSL fragment. Any suggestions would be greatly appreciated!
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:variable name="LD" select="'NONE'"/>
<xsl:apply-templates select="HEADER"/>
<table border="1" bgcolor="lightblue" cellpadding="0" cellspacing="2">
<tr>
<th>Department</th>
<th>Line Name</th>
<th>PTD Actual</th>
<th>PTD Budget</th>
<th>PTD Variance</th>
<th>PTD Variance Pct</th>
</tr>
<xsl:apply-templates select="ROW"/>
</table>
</xsl:template>
<xsl:template match="ROW">
<tr bgcolor="white">
<xsl:variable name="CD" select="DEPARTMENT_DESC"/>
<xsl:choose>
<xsl:when test="$LD!=$CD">
<td><xsl:value-of select="$LD"/></td>
<td><xsl:value-of select="DEPARTMENT_DESC"/></td>
<xsl:variable name="LD" select="$CD"/>
<td><xsl:value-of select="$LD"/></td>
<td><xsl:value-of select="$CD"/></td>
</xsl:when>
<xsl:otherwise>
<td><xsl:value-of select="' '"/></td>
</xsl:otherwise>
</xsl:choose>
<td><xsl:value-of select="LINE_NAME"/></td>
<td align="right">$<xsl:value-of select="format-number(PTD_ACTUAL,'#,###,##0.00')"/></td>
<td align="right">$<xsl:value-of select="format-number(PTD_BUDGET,'#,###,##0.00')"/></td>
<td align="right">$<xsl:value-of select="format-number(PTD_VARIANCE,'#,###,##0.00')"/></td>
<td align="right"><xsl:value-of select="format-number(PTD_VARIANCE_PCT,'#,###,##0.00')"/>%</td>
</tr>
</xsl:template>
</xsl:stylesheet>
null

hi, just thought I'd let you know that I'm trying to do the same thing you are. I'm looking into XPath as the solution to this but its still out of my reach at the moment. I'll let you know If I figure anything out, please post back here if you manage to solve this problem. Also see my other post with subject:
sqlplus BREAK ON functionality through xslt
Good Luck.
Originally posted by Larry Scheurich ([email protected]):
I'm doing a transformation from an XML document, and want to display rows, but break on a particular column (i.e. List employees by department, but only show the department one time). I have experimented with all sorts of combinations using <xsl:variable> to compare the last department value to the current one, but for some reason, when I assign a value to the last variable, it gets lost. Here is the XSL fragment. Any suggestions would be greatly appreciated

Similar Messages

  • Page Break In XML Publisher RTF Templates Are Not Working

    Please refer to the Metalink Doc below:
    Subject:      Page Break In XML Publisher RTF Templates Are Not Working.
    Doc ID:      559111.1      
    Type:      PROBLEM
    Modified Date:      24-MAR-2008      
    Status:      MODERATED
    In this Document
    Symptoms
    Cause
    Solution
    References
    This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process, and therefore has not been subject to an independent technical review.
    Applies to:
    Oracle XML Publisher - Version: 5.6.3
    This problem can occur on any platform.
    Symptoms
    Using XML Publisher version 5.6.3 in 11.5.10.
    Find <?split-by-page-break:?> syntax is ignored.
    EXPECTED BEHAVIOR
    Expect page breaks to occur at point set by "split-by-page-break:" code.
    STEPS
    The issue can be reproduced at will with the following steps:
    1. Create a template.
    2. Call split-by-page-break: inside a loop.
    3. Output is not formatted correctly, page break call is ignored,
    Cause
    Unpublished BUG 5011628 SPLIT-BY-PAGE-BREAK NOT WORKING IF ADDED SORT WITHIN DYNAMIC GROUP
    Unpublished BUG 5011628 matches the client issue as it is a call to split-by-page-break inside a loop.
    Fix is in ScalableStringList.java version 115.4.
    This is delivered in <Bug 6165466> XDOFX:CHR(N) FUNCTION FAILING.
    Solution
    To implement the solution, please execute the following steps:
    1. Apply Patch 6165466 when it is released.
    2. Test your report.
    References
    Bug 6165466 - XDOFX:CHR(N) FUNCTION FAILING
    Keywords
    XML~PUBLISHER; LOOP; DYNAMIC~GROUP; PAGE~BREAK;
    Help us improve our service. Please email us your comments for this document. .

    Hi JDev,
    Check this out:
    http://oracle.anilpassi.com/xml-publisher-developing-reports-printed-on-pre-printed-stationary-2.html
    Hope this might help.
    Thanks

  • XI have to break/split XML-File into N times a XML Message

    Hello,
    Can anyone help with this one. I guess this is not an easy exercise but I need to solve it urgently.
    XI gets a XML-file from a system.
    This file has N times a element <XBT>.
    Every time XI gets such a file the number of <XBT> is different.
    XI haves to break this xml into N xml messages according to element ><XBT> in order to send them to Sap sequentially.
    For example the following XML file have to split up into 2 xml files (the elements XBT occurs 2 times)
    How can this be done?
    <mt_BubaBestand>
    <b><XBT></b>
      <Algemeen>
         <Verkooporganisatie>5000</Verkooporganisatie>
         <Distributiekanaal>50</Distributiekanaal>
         <Productgroep>50</Productgroep>
         <Ordernummer>123123</Ordernummer>
         <Verkoopgroep/>
         <Documentdatum>20061207</Documentdatum>
         <Medewerker_nr>e60217</Medewerker_nr>
         <Medewerker_naam>Hermans</Medewerker_naam>
         <CRM_nr/>
         <CIFDedicated/>
         <Klantgroep/>
      </Algemeen>
    <b></XBT></b>
    <b><XBT></b>
      <Algemeen>
         <Verkooporganisatie>5000</Verkooporganisatie>
         <Distributiekanaal>50</Distributiekanaal>
         <Productgroep>50</Productgroep>
         <Ordernummer>123123</Ordernummer>
         <Verkoopgroep/>
         <Documentdatum>20061207</Documentdatum>
         <Medewerker_nr>e60217</Medewerker_nr>
         <Medewerker_naam>Hermans</Medewerker_naam>
         <CRM_nr/>
         <CIFDedicated/>
         <Klantgroep/>
      </Algemeen>
    <b></XBT></b>
    </mt_BubaBestand>

    This is pretty standard procedure if you are posting these messages to R/3.  As was pointed out in the weblogs above, when using IDocs you don't need to do any tricky configuration.  Just make sure that your XML structure is set correctly (ie:  1 to unbounded, etc) to the limits that you want, and XI will automatically loop the mapping process for each instance of the <XBT> item that it detects in the source message.  You mentioned:
    <i>For example the following XML file have to split up into 2 xml files (the elements XBT occurs 2 times)</i>
    Well, you don't actually split it into two XML files per say, XI just processes the source message straight to multiple IDocs using the IDoc adapter.

  • Breaking up xml configurations?

    Hi,
    I'm wondering if there's an easy way to break up xml cache configurations into different (partial) xml files so that they can be easily included into other (master) xml files. That way one can easily reuse definitions without requiring to apply a single change to several files. Here's my current need:
    I want to have several nodes that ultimately need to work/share a single distributed map. However there are two types of node participants:
    WRITE-type nodes which can only do puts to the map
    READ-type nodes which can only do reads
    On top of this the storage is only enabled on the READ-type nodes (that's fine since I can do it using the init-param tags based on passed properties.)
    Now, the key here is that I want the WRITE-type to use a distributed scheme and READ-type nodes to have a nead cache configuration with a back-scheme coinciding with the WRITE-type map. In both cases the real distributed cache is the same.
    I don't seem to get away with this config unless I have 2 different config files for READ and WRITE types.
    Am I missing anything? I would really like to avoid coding this into the application.
    Also I was thinking that maybe I could use the include capabilities of xml, but either Coherence does not follow the XML standard or I've messed up something..
    Anybody has had a similar problem? Am I the only one that wants to access a distributed map from different cache configurations?

    Hi,
    You can use, for example, property name to override scheme name:
    <code>
    <cache-mapping>
    <cache-name>someCacheName</cache-name>
    <scheme-name system-property="some.property">default-scheme-name</scheme-name>
    </cache-mapping>
    </code>
    That will allow you to use a single configuration file and specify an actual scheme by using -Dsome.property=name override.
    Regards,
    Dimitri

  • Line Break in XML?

    When I use "<br>" within my XML database, I get this
    error:
    "Expected end of tag 'br'(9,43)"
    I have tried <br>, </br>, <br></br>
    and searched... but haven't yet found a solution.
    Should I be using some kind of hex code?
    Thanks in advance for the assistance!
    Dan

    I spent a whole bloody day trying to solve this one!  Thanks for the advice here guys....
    Here's the "How to..." instructions I made for myself (I will need this later as a function of age)....
    Inserting <br /> line breaks in XML content:
    It's necessary to add a line of code directly after the dataset at the top of the (spry) htm page that sets the columnType:
    var dsRegInfoElem = new Spry.Data.XMLDataSet("regisinfo.xml", "sites/level1/site",{distinctOnLoad:true});
    dsRegInfoElem.setColumnType('datetime','html');<!--This line is necessary for the line breaks in the xml CDATA sections to work-->
    Make sure the xml tag that will contain the CDATA wrap is identified (here it's the <datetime> tag).
    Then, in the XML file, add the CDATA wrap just inside the tag like this:
    <datetime><![CDATA[texttexttexttext]]></datetime>
    Now just insert the <br /> where I need it!
    <datetime><![CDATA[texttext<br />texttext]]></datetime>

  • How to give Page break in XML

    Can we give an page break instructions through XML file.
    I have an xml file which i am importing and generating pdf.Is there any tag or paragrapg style that can be applied to xml element to indicate page break.

    Hi Nishatry,
    You cannot add the Page break as a symbol in XML. Instead you can add element or attribute as "PageBreak".
    In InDesign scripting you can find the "PageBreak" elements and insert the pagebreaks by using the following code.
    var myDoc = app.activeDocument;
    PageBreaking(myDoc);
    alert("Page Break Inserted");
    function PageBreaking(elm){
        for (var i = 0; i < elm.xmlElements.length; i++){
            try{
                XMLelementName=elm.xmlElements[i].markupTag.name.toString();
                elm.xmlElements[i].select();
                if(XMLelementName=="PageBreak"){
                    elm.xmlElements[i].contents = SpecialCharacters.frameBreak;
            }catch(e){}
            PageBreaking(elm.xmlElements[i]);
    I think this is usefull for your requirement.
    Regards,
    Ramkumar .P

  • Line Break for XML File

    All,
    I am able to generate xml file from an internal table. The problem is, if I open the file in IE everything looks good. When I open it in notepad or notepad++, everything is in one line. Can you tell me how to generate a line break after each tags.
    Please find the following code used by me for reference.
    LOOP AT lt_ohd INTO ls_ohd.
        ls_temp_ohd = ls_ohd.
        AT FIRST.
          l_ixml = cl_ixml=>create( ).
          l_document = l_ixml->create_document( ).
          l_element_ohd  = l_document->create_simple_element(
                      name = 'OHD'
                      parent = l_document ).
        ENDAT.
        AT NEW cc.
          CLEAR : lv_inhaltskom, lv_text.
          lv_inhaltskom = ls_temp_ohd-cc.
          CALL FUNCTION 'ISM_SELECT_TEXT_JJTIKO'
            EXPORTING
              pv_inhaltskom = lv_inhaltskom
            CHANGING
              pv_langtext   = lv_text.
          TRANSLATE lv_text TO UPPER CASE.
          l_value = lv_text.
          l_element_county  = l_document->create_simple_element(
                      name   = 'city_county'
                      value  = l_value
                      parent = l_element_ohd  ).
        ENDAT.
        AT NEW order.
          l_element_neighborhood  = l_document->create_simple_element(
                      name    = 'entry'
                      parent  = l_element_county  ).
        ENDAT.
        l_value = ls_temp_ohd-neighborhood.
        l_element_address  = l_document->create_simple_element(
                    name   = 'neighborhood'
                    value  = l_value
                    parent = l_element_neighborhood ).
        l_value = ls_temp_ohd-address_detail.
        l_element_address  = l_document->create_simple_element(
                    name   = 'address_detail'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-order.
        l_element_address  = l_document->create_simple_element(
                    name   = 'order'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-item.
        l_element_address  = l_document->create_simple_element(
                    name   = 'item'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-cc.
        l_element_address  = l_document->create_simple_element(
                    name   = 'cc'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-address.
        l_element_address  = l_document->create_simple_element(
                    name   = 'address'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-price.
        l_element_address  = l_document->create_simple_element(
                    name   = 'price'
                    value  = l_value
                    parent = l_element_neighborhood ).
        l_value = ls_temp_ohd-bed.
        l_element_address  = l_document->create_simple_element(
                    name   = 'bed'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-bath.
        l_element_address  = l_document->create_simple_element(
                    name   = 'bath'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-opentime.
        l_element_address  = l_document->create_simple_element(
                    name   = 'opentime'
                    value  = l_value
                    parent = l_element_neighborhood  ).
        l_value = ls_temp_ohd-state.
        l_element_address  = l_document->create_simple_element(
                    name   = 'state'
                    value  = l_value
                    parent = l_element_neighborhood ).
        l_value = ls_temp_ohd-zip.
        l_element_address  = l_document->create_simple_element(
                    name   = 'zip'
                    value  = l_value
                    parent = l_element_neighborhood ).
        l_streamfactory = l_ixml->create_stream_factory( ).
        l_ostream = l_streamfactory->create_ostream_itable( table = lt_xml_table ).
        l_renderer = l_ixml->create_renderer( ostream  = l_ostream
                                              document = l_document ).
        l_rc = l_renderer->render( ).
        l_xml_size = l_ostream->get_num_written_raw( ).
      ENDLOOP.
    Regards,
    Salil
    Edited by: salil vaidya on Jan 18, 2011 2:34 PM

    Thanks.
    But now, I have a syntax error.
    BEGIN OF xml_line,
              data(256) TYPE x
    END OF xml_line.
    DATA: lt_xml_table      TYPE TABLE OF xml_line,
          ls_xml_table      TYPE xml_line.
    LOOP AT lt_xml_table INTO ls_xml_table.
        CONCATENATE ls_string cl_abap_char_utilities=>cr_lf INTO ls_string.
        MODIFY lt_xml_table FROM ls_xml_table INDEX sy-tabix.
        CLEAR : ls_xml_table, ls_string.
      ENDLOOP.

  • Breaking BIG XML files in to 4 different XML Files

    Hi:
    What will be a problem if I break the BIG XML file in to a number of different XML FILES?
    My main reason is to create XMLVIEW.
    Please help
    ALI_2

    Would Suite Spot Studios "AA Translator" achieve this?  If you navigate to his web site you can test the app by submitting a test project to him and he/they will attempt to "convert" it for you.  (Only one of you, you or your buddy, would need to buy and have the app installed).
    I realise this is something of a "long shot" since "suitespot" does not use a Mac and this "new" session format (.sesx) may not be readable by his app.
    Jeff

  • & in url breaks server.xml

    I need to enter this url as my jdbc url in a <value> tag:-
    jdbc:mysql://localhost/mydatabase?autoReconnect=true&autoReconnectForPools=true
    but the & in the url breaks the server parsing the xml file.
    How can I add this ?
    tomcat 5.0.16

    Not only that, you are really supposed to escape the & character when you put that URL into an HTML file as well. The only difference is that XML doesn't allow malformed input whereas HTML accepts anything and tries to make something useful out of it.

  • Air plugin for dreamweaver breaks application.xml file

    the air plugin for  dreamweaver breaks the application.xml file when the version is  changed from 2.0 to 2.7
    How to fix this?

    Hi Roberto,
    I'm sorry I don't know the answer to this one, but I'll ask around.  Have you checked out the dreamweaver forum?
    Chris

  • Creating a line break in xml?

    Using dreamweaver cs3 I have created a spry table that is connected to a spry accordian with a detailregion where the accordian shows additional data pulled from a mutual xml file.  Everything works very well.   The problem I have is that some of the text in the xml file is 2 separate paragraphs and I can't find a way to insert a paragraph break in the xml. It all comes out as one paragraph of text.  ugh  I got it to print <p> using escape characters &lt: etc but it would actually print out the <P> and not respond to the html tag.  lol  There must be a way to insert a simple paragraph break but I can't find anything that shows how to do that. Any help would be very much appreciated.
    Thanks
    mrtom

    Thanks very much Donald.  I fear I am a newbie and still a bit confused.  I tried the CDATA solution
    and that ended  up simply printing the html on the accordian page in the same way it did when I used the escape
    characters.  The other solution listed on the page you linked says:
    "To fix this, we have to entity decode the "description" column value  of each row so that when Spry re-generates the spry:region, it inserts  the entity decoded version of the HTML markup. The result of this  pre-processing allows the HTML markup to appear properly:"
    When they say "description" column what are they referring to?  Sounds like they are referring to a database row but my data is from a simple and small hand-written xml file.  I'm not sure what I need to do here?   Thanks for any guidance you might offer.
    Tom

  • JDBC URL can break config.xml

    Entering a JDBC URL of jdbc:mysql://foo.com/db?user=joe&password=smith
    will result in config.xml not being parsible after it is saved. The
    problem is that the ampersand needs to be translated into a character
    entity (&). I suppose other nasty character entities such as <
    should be translated too.
    Ben

    This problem has been acknowledged and engg is working on this issue.
    Thanks.
    Kumar
    Ben Eng wrote:
    Entering a JDBC URL of jdbc:mysql://foo.com/db?user=joe&password=smith
    will result in config.xml not being parsible after it is saved. The
    problem is that the ampersand needs to be translated into a character
    entity (&). I suppose other nasty character entities such as <
    should be translated too.
    Ben

  • SAP PI 7.3.1 XML line break within node

    Good Morning All,
    I've an issue with link breaks in XML. Basically, the scenario is IDoc (SAP) to File (XML 3rd Party System).
    I've mapped a text field from the IDoc to the XML node (<comments>) .  The text data comes across with a delimiter !$! to indicate where a line break should occur within the <comment>  node in the XML
    For example the text line comes across in the IDoc as  line 1!$!This is Line 2!$! this one is line 3!$!  and within the xml file I need to the <comment> node to look like  <comment>line 1
                                       This is line 2
                                       this one is line 3</comment>
    We need this for formatting in the 3rd party system. I've tried various replaces etc. but the new line never seems to get recognized. 
    Any help with this would be very much appreciated.
    Thanks
    G

    Use OS specific new line character by using System.getProperty("line.separator"):
    Here is complete code:
    UDF with Context option
    Parameters:String var[], ResultList result)
    String temp[] = var[0].split("!$!");
    for(int i = 0; i < temp.length; i++)
         result.addValue(temp[i] + System.getProperty("line.separator"));
    Check it should work, I have not tested...
    --Divyesh

  • 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

  • Call transformation XSLT and long note string in XML

    Hi
    Using call transformation (XSLT scheme) to convert XML file to html the problem is that line breaks in xml are ignored when passing the call tranformation.
    <b>Note in xml look like:</b>
    <com:Note><![CDATA[
    Serie 87% 0,000000
    Amount in this period 01-01-2006 - 01-07-2006 - 180 days
    Currency 16.267.117,38 DKK
    Loan DKK 14.332.700,00
    Debt 7.358.534,23
    Indexsfactor 226,230
    ]]></com:Note>
    <b>When HTML displayed in sap, - note is just a long string which continue out of the screen. Note looks like:</b>
    Serie 87% 0,000000Amount in this period 01-01-2006 - 01-07-2006 - 180 daysCurrency 16.267.117,38 DKKDebt 7.358.534,23Indexsfactor 226,230
    <i>What to do ? Any ideas ?</i>

    Hi Jon,
    What is the XSLT program that you're using to transform the XML?
    Can you try modifying the XSLT stylesheet and add or modify the following attribute.
    <xsl:output indent="yes"/>
    Regards,
    Erwin

Maybe you are looking for

  • How can I remove my card details from my iPad3

    I want to take my card off as I am going to close the account and have no money in it. What's happening is that when I go to iTunes and app part in the settings, click my apple I'd and go on to account details it's saying that the billing information

  • Error during creation of push button on selection screen

    Hi, I wanted to create push buttons on selection screen, Code: DATA DB1 TYPE VBAP-WERKS. DATA DB2 TYPE MARA-MATNR. SELECT-OPTIONS : SPLANT FOR DB1,                                 SCLASS FOR DB2. SELECTION-SCREEN:  FUNCTION KEY 1,                    

  • Use of Bind Variable in the Query of view object giving null pointer excep

    I am using this code in the backing bean of my page to set the value of the bind variable 'cmdID' in the view object. String AM = "model.UnixCommandsAppMod"; String CF = "UnixCommandsAppModLocal"; ApplicationModule am = Configuration.createRootApplic

  • Passing output of one iView as input to another iView using Visual Composer

    Hi I need urgent help. Is it possible to pass data from one iView to another using the Visual Composer tool. If it is how? Does anyone have an example or know where I can find one. Here is my example: I have created one Page with two iViews on the pa

  • Replace SY-UNAME when calling a Transaction

    The following function module creates an invoice automatically: CALL FUNCTION 'CREATE_DELIV' IN BACKGROUND TASK      EXPORTING          i_order = vbak-vbeln. Inside this FM CREATE_DELIV, VF01 transaction is called.      CALL TRANSACTION 'VF01' USING