How to make an explicit closing tag in XML(e4x).

I'm working with some XML data and I'm having trouble forcing the way my closing tags are generated.
I want the long hand form, such as:
var xmlData:XML =
<code>
   <codeSnippet>
   </codeSnppet>
</code>;
But when I try to insert nodes within the codeSnippet node as child nodes(<snippet />, etc.), and then write to a file, it
makes the codeSnippet node look like <codeSnippet /> and the <snippet /> nodes are after, which will not work.
How can I make it NOT treat an empty node as  <codeSnippet /> and explicitly keep it as in long hand form, such as:
<codeSnippet>
</codeSnppet>
Thanks...
fd

I figured it out for myself.
So, does that mean I get the 10 points?
fd

Similar Messages

  • Avoid explicit closing tag in XML using graphical mapping

    Hi,
    I created a data type with an element called TAG1 which has an attribute called attr.
    I mapped an empty constant to the element and the value XXX to the attribute.  I`m using graphical mapping and the XML I get is the following:
    <TAG1 attr = u201CXXXu201D></TAG1>
    But for reasons of volume I need to generate the XML without the explicit closing tag, such as:
    <TAG1 value = u201CXXXu201D/>
    Is there any possibility to achieve this with graphical mapping?
    Thanks & Best Regards,
    Viviana

    > But for reasons of volume I need to generate the XML without the explicit closing tag, such as:
    >
    >  <TAG1 value = u201CXXXu201D/>
    >
    > Is there any possibility to achieve this with graphical mapping?
    This is not posible. The graphical mapping always creates start and end tag, even for empty elements.
    You need a seperate mapping step with XSLT or Java mapping.
    Regards
    Stefan

  • Closing tag in xml transformation

    Hi experts,
    I have the following ABAP code:
    ABAP itab to XML string
      CALL TRANSFORMATION id SOURCE data = ti_stocks[]
                             RESULT XML    ps_output.
    The result in ps_output should be an xml like this
    <?xml version="1.0" encoding="utf-16" ?>
    <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
    <asx:values>
    <DATA>
    <ZTABLE_STO>
      <FIELD1 /> ABC</FIELD1>
      <FIELD2 />0300</FIELD2>
      <FIELD3 />1</FIELD3>
      </ZTABLE_STO>
    etc.
    However, if my internal table ti_stocks contains the field1 with an empty value then the xml is incorrect without its corresponding closing tag:
    <?xml version="1.0" encoding="utf-16" ?>
    <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
    <asx:values>
    <DATA>
    <ZTABLE_STO>
      <FIELD1 />
      <FIELD2 />0300</FIELD2>
      <FIELD3 />1</FIELD3>
      </ZTABLE_STO>
    etc.
    How can I resolve this problem? I would like to have an open tag and a closing tag for every field.
    FIELD1 is a char type field.
    Thank you,
    Oscar
    Edited by: Oscar Arranz on Jan 26, 2012 2:46 PM

    Hello everyone, sorry for my english, I had the same requeriment for the end tag, the simple transformation give this result <xxx/> when the value was empty, and I did something similar to Oscar,
    i did the simple transformation and the result whas and xstring, i used a function to pass it to string, and then I make a replacement.
    here is some code:
    *  Genera XML
       data: xml_xstring          type xstring.
       data: w_xml                 type string.
       data: ixml                    type ref to if_ixml,
               streamfactory      type ref to if_ixml_stream_factory,
               encoding             type ref to if_ixml_encoding,
               ixml_ostream      type ref to if_ixml_ostream.
       data: resstream           type ref to if_ixml_ostream.
    ****Create an instance of the Ixml Processor
       ixml = cl_ixml=>create( ).
    *  ****Create the Stream Factory
       streamfactory = ixml->create_stream_factory( ).
    *  ****Create an Endcoding and Byte Order
       encoding = ixml->create_encoding( character_set = 'ISO-8859-1' byte_order = 0 ).
    *  *  ****Create the output stream with a pointer to our binary string
       ixml_ostream = streamfactory->create_ostream_xstring( xml_xstring ).
    *  ****Set the Encoding into a stream
       ixml_ostream->set_encoding( encoding = encoding ).
    ****Call simple Transformation
       call transformation zdte_libros
       source zcaratula = x_doc
       result xml ixml_ostream.
    *From xstring to string.
       call function 'HR_RU_CONVERT_HEX_TO_STRING'
              exporting
                     xstring = xml_xstring
              importing
                     cstring = w_xml.
    * <xxx/> to <xxx><xxx/>
       replace all occurrences of regex '<([^><\s]+)( [^><]+)?/>' in w_xml with '<$1$2></$1>'.
    Hope it helps someone with the same problem .

  • How to Make an explicit oracle connection  to a default.

    Hi Users ,
    (Pro*C code)
    I have 2 connections to oracle db using connection identifier. At one point of time, i would like to make one of the explicit connection as default, which means further along i do not want to use the "AT" clause, instead queries should default to default connection. 
    Referring to below url, it only speaks about 2 distinct explicit connections, does not mention how to convert one of the explicit connection as default. 
    [ora11 guide|http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28427/pc_03dbc.htm#auto Id13]
    Is there a way to do so ? 
    Looking at google, i found a reference to a url, ora7. In section, 17.2.5, It does say how to make a connection default - by using EXEC SQL SET CONNECT connection_name. However it seems , its not supported anymore. 
    [ora7 guide|http://starlet.deltatelecom.ru/rdb$doc/oraclerdb/gsp7/gus_pro_create_conn.html]
    Antony
    Edited by: user11952222 on Sep 1, 2011 3:16 PM

    I figured it out for myself.
    So, does that mean I get the 10 points?
    fd

  • How to make  struts html:select tag readOnly....!!!!

    Hi All,
    In my below code I want to make <html:select> as readonly like I did for <html:text>
    I don't want to make it disabled as it is graying out that field.
    My requirement is that it should be visible and also it shouldn't be editable.
    I am using Struts...!!!
    <html:text property="paramName" size="20" maxlength="50" readonly="true"/>                                
    <html:select property="paramTypeId" disabled="true"> // I dont want to use this--- disabled="true"
         <html:options collection="queryReturnType" property="value" labelProperty="label"/>
    </html:select>Thanks in advance....!!

    Can some one tell me in the below code
    *1. what is test="${controlEnabled}"....wha is this controlEnabled variable*
    *2. do I need to create an attribute for paramTypeId_Label in my form bean ??*
    I just wanna to make my <html:select> readonly..pls see my first post in this thread....!!
    <c:choose>
         <c:when test="${controlEnabled}">
           <html:select property="paramTypeId" >
                <html:options collection="queryReturnType" property="value" labelProperty="label"/>
           </html:select>
         </c:when>
         <c:otherwise
           <html:text property="paramTypeId_Label" value="${queryReturnType[paramTypeId].label}" readonly="true"/>
           <html:hidden property="paramTypeId"/>
         </c:otherwise>
    </c:choose>--Thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to make folders remain closed/collapsed in a list-view finder window?

    Hi there,
    I apologize if this was already answered, but after checking the posts, I just could find one dude who made the very same question but he got no answer; so that is why I'm posting this question back since is so much inconvenient having a lot of folders opened all the time.
    Back in the OS9 system the tip was as simple: just option-click the arrow next to the folder icon, but it no longers works...
    Any ideas?
    Thanx.

    Hi Roam,
    I'm afraid that it won't work as expected. There they remain, expanded or collapsed as they were in some time you didn't noticed. I guess it has to be with permissions repair. I even tried to change permissions (instead of repair them) and apply them to the included folders (with the folders within collapsed) to see if that works, but there's no way.
    The thing is that I dont wanna get messed with permissions repair (too busy in the studio), but on the other hand, it seems a pain to me to browse all that expanded folders every day...
    Well, let's see how it goes...
    Thanks for taking the time to reply,
    Peace!

  • How to make the parent div tag hug the top of the page?

    Okay, if you are not sure what I mean here is a website that has it, look at the top of the page and note that the banner is bumped up against the top of the page. http://thecreatureconservancy.org/. Anyway, I can't figure out how to do that, here is the code of the website I'm working on.
    Copper Leaf Crossing is a 23 acre complex dedicated to the care of animals.We have created a warm and friendly destination for animal enthusiasts.Wether you have a cat or canary, a dog or a frog, we can help you care for your pet. On campus, you will find:       Animal Kingdom Veterinary Hospital - Their compassionate and dedicated staff are    skilled in the medical care of both domestic and exotic pets.
    Creature Comforts Bed & Bath a great pet boarding facility for dogs, cats, birds, reptiles and small mammals that also offers pet grooming.
    The Creature Conservancy- A truly unique non-profit organization that offers avariety of educational programs with live exotic animals, summer camps, tours and a variety of animals on display.       Dogwood Veterinary Referral Center - a full service imaging and surgery centerthat provides exceptional care for pets with neurological problems.   
         4940 Ann Arbor-Saline RD Ann Arbor MI 48103                        
    Thank you!

    Try zeroing out the padding as well.
    body{
    margin:0;
    padding:0;
    If that doesn't work, you could try adding:
    html{
    margin:0;
    padding:0;
    It's difficult to know exactly without the URL and/or updated code.

  • How to make OMS try to re-load XML files marked as error

    Hello,
    we have a lot of XML files marked as errors due to the OMS had been unable to load them becouse a full TS.
    Now that de TS has been extended, how can we force the OMS loader to retry loading all those XML files???. Is there any method to do it??.
    Thanks in advance.

    Hi,
    >>>
    Now, after the form has been open for several weeks and I have collected a number of responsed (hence, made a number of assignments) I've been asked to get 2 volunteers for most assignments (I was only getting 1 volunteer per assignment initally). I now need to reopen/re-display all of the assignments that I marked as an error but they are no longer visable on my form.
    Can I bring them back? If so, how?
    You can go back to "Design" Tab and add the options back to your choice fields. For example, if your choice field options are "Blue", "Yellow", "Red", and you deleted "Red", you can add "Red" back to the choice field options (you should be able to add additional new options as well).  In "View Responses" Tab you should not see the error mark anymore.
    Hope this helps,
    Thanks,
    Lucia

  • How to do an if-or tag in xml ?

    Hi guys,i want to hide a column depending if the other column has or not two values,for example if column1='window' or if column1='door'
    im using like this -> in the column title <?if@column:TAX_TYPE1!='Real Estate Tax'?>
    -> in the column value <?if@column:TAX_TYPE1!='Real Estate Tax'?><?LEVY_OZB?><?end if?>
    but i want also to the TAX_TYPE1!='MovablePropTax'
    if other types than these two then i should show,if there two i should hide.something like this.
    Im using oracle xml publisher.

    I figured it out for myself.
    So, does that mean I get the 10 points?
    fd

  • How to create Nested (Multi level ) tag in XML using DBMS_XMLQUERY function

    Hi,
    I need Following out put in CLOB Column.
    XML format Like :
    <?xml version="1.0" encoding="UTF-8"?>
    <ReceiptHeader>
    <Id>1234556</Id>
    <Type>DD</Type>
    <Receipts>
    <ReceiptDEO>
    <StoreId>11380001</StoreId>
    <EmployeeId>NOLO980</EmployeeId>
    <LineItems>
    <ReceiptLineItem>
    <CartonId>ABC12345</CartonId>
    <ShippedQty>1.0000</ShippedQty>
    <UnitCost>118.500000</UnitCost>
    </ReceiptLineItem>
    </LineItems>
    <ReceiptDate>Wed Jun 20 11:50:01 CEST 2012</ReceiptDate>
    <ReceiptNumber>3127855</ReceiptNumber>
    </ReceiptDEO>
    </Receipts>
    </ReceiptHeader>
    And i'm using dbms_xmlquery.newcontext ( );
    Can you please help to get above output.
    - Thanks,
    Pallavi

    Hi ,
    Thanks for reply .
    Version is "Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production".
    First I tried with DBMS_XMLGEN ,, it doesnt work properly.
    Then tried with XMLAGG and XMLELEMENT but giving me output in 1 row. I need proper XML format.
    Following is some data, For which I had created view of 2 tables.
    ID     STORE_ID     EMPLOYEE_ID     ACTUAL_ARRIVAL_DATE     CARTON_ID     SHIPMENT_ID     QUANTITY_RECEIVED     UNIT_COST     RECEIPT_DOC_ID     RECEIPT_Date
    3772     12340001     PALS001     16-Feb-11     2A632     29     28.000     118.50000     1234     16-Feb-11
    3775     12340001     PALS001     16-Feb-11     1A633     30     120.000     218.50000     7866     16-Feb-11
    3776     12340001     PALS001     16-Feb-11     2A634     30     75.000     345.75000     7876     16-Feb-11
    3773     12340001     PALS001     16-Feb-11     3A632     30     45.000     200.10000     7869     16-Feb-11
    3774     12340001     PALS001     16-Feb-11     3A632     30     10.000     450.45000     7869     16-Feb-11
    Please suggest better way..
    -Thanks,
    Pallavi

  • How to make JDev leave out data-sources.xml

    Greetings
    I would like to have jdeveloper leave out data-sources.xml. I have my test server setup with all the data-sources so this isn't needed. All it does is create bunches of data sources on my server then I go in and delete them.
    Is there a way somewhere in jdeveloper or my deploy profiles were I can tell it to leave this file out so it just uses the ones I have already setup on the server?
    thanks
    troy

    I think you can control this by going to tool->Embedded OC4J Preferences->Data sourcesI think the original author meant to ask for a way to exclude data-sources.xml when deploying to an external application server.
    So far the only way I've found out to work is to manually blank the 'dataSourcesPath' field in "Configure Application" dialog before actual deployment takes place.

  • Data Service Wizard - How can I reconfigure return type field as XML (E4X) value

    The HTTP Data Service wizard - "Reconfigure Return Type" - does not allow XML (E4X) to be selected as a data type for a field.  For example , If my example XML payload looks like this (see below), I would like to set the datatype for "settings" field to be XML (E4X) and have the service decode the "string" value into an XML (E4X) value.
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ListOfUsers version="1.0.0">
        <User>
            <id>3</id>
            <subType>INTERNAL</subType>
            <authName>internal</authName>
            <name>Internal User</name>
            <settings>&lt;?xml version="1.0" encoding="utf-8" ?&gt;&lt;Settings&gt;&lt;Profile&gt;&lt;Region&gt;emea&lt;/Region&gt;&lt;Language&gt;en.g b&lt;/Language&gt;&lt;/Profile&gt;&lt;/Settings&gt;</settings>
        </User>
    </ListOfUsers>

    I find a (reasonably) elegant workaround which is to add a transient property in the "public" sub class of the value type - see below - I havent tested it much so not sure if it will work adequateky in all circumstances
    package services.listeningpost
    public class User_type extends _Super_User_type
    public function get xmlSettings():XML
    return new XML(settings);
    public function set xmlSettings(object:XML):void
    settings = object.toXMLString();

  • HT4515 How to make sure that after browsing that the webpage is not running in the background, but totally closed down

    How to make sure that after browsing that the webpage is not running in the background, but totally closed down

    Double tap the Home button, tap & hold the Safari icon until it starts to wiggle, tap the red minus sign to remove it from the Multi-Tasking bar. Tap the Home button when finished.

  • How to make a checkbox tag functionable?

    i added a checkbox tag from insert menu......when i clicked on it......nothing happens.....i mean how to make it function like when i click on it .....it becomes checked.....and when i click it again it becomes unchecked.....the problem i face is nothing happens when i click on it....

    Checkbox is a form element.  Did you put it inside <form> tags? 
    <form action="form-processing-script.php">
    <label for="option1"> Option 1 </label>
    <input name="option1" type="checkbox" value="option1" />
    <label for="option2"> Option 2 </label>
    <input name="option2" type="checkbox" value="option2" />
    <label for="option3"> Option 3 </label>
    <input name="option3" type="checkbox" value="option3" />
    <p><input name="submit" type="submit" value="Submit" /> </p>
    </form>
    Option 1 Option 2 Option 3
    Nancy O.

  • Spry Accord. Panel - How to make it closed Please help!

    Hi, I would like to ask for your help with the following:
    I made a spry accord. panel. I was wondering how to make the first tab being closed when I open up the following page. Somehow when I made it, it created that the first tab stays open all the time. I was wondering if I can make it being closed and only open when I click on the Artisan Collection.
    Thank you so much for your help in advance! Agi
    Here is the link and you will see the panel on the left handside:
    http://mallinfurniture.com/browse_c01.html

    Hi,
    Thank you so much for the answers. I tried what you recommended. An error message came up saying the following. Also, I noticed something weird in my coding... Maybe that is why it is not working. I copy the coding as well. Thank you so much for taking the time to help me out!!!
    Error message: "This document contains JavaScript code for a widget that no longer exists. If you don't remove the code, the browser might display JavaScript errors when loading the page. Would you like Dreamweaver to find all the instances of this code for you?" Ok, No.
    When I click on Ok. Nothing happens. What am I doing wrong?
    Coding - the end of my page:
    <script type="text/javascript">
    <!--
    var Accordion1 = new Spry.Widget.Accordion("CatalogMenu", {defaultPanel: params.panel ? params.panel: 0});
    //-->
    </script>
    <script type="text/javascript">
    <!--
    var Accordion1 = new Spry.Widget.Accordion("Accordion1", { useFixedPanelHeights: false, defaultPanel: -1 }); //--> </script> </body>
    </html>
    It looks like I have double of that. When I removed the first accordion, all of my panels were opened...
    What could ne wrong?
    Thank you! Agi

Maybe you are looking for