Checking if there is an XML element after the root

hello experts
I have an XML that some time will have an element under the root, and some time not.
for example:
<Asset>
  <PolicyPlan />
</Asset>
or if there is an element with data
<Asset>
  <PolicyPlan >
      <ID="1">
  </PolicyPlan >
</Asset>
I would like to know if I can in the XI to check if there is an element under PolicyPlan, and if so, return its value (in this case 1) and if not return an empty string.
if it can be done in XI, or there is a code that need to be written as a new function, help will be appreciated.
Thanks
Kfir

Hi,
Please try to do the following mapping.
        Map the source to exist function, The output of exist has to send to if conditiond and the output of if condition to the target.
  Thanks,
Kiran.

Similar Messages

  • Hiding XML elements in the structure view – scripting influence to the structure view?

    Hi
    Is there a way to hide specific XML elements (really the elements and not the attributes) in the structure view?
    I am asking this question to know if it is possible to influence the structure view by scripting.
    Many elements are indeed used as a kind of help for constructions which have nothing to do with the actual contents especially in the case of tables.
    You inflate the the structure view unnecessarily and the author will lose track of the real contents. It would be nice if there was a possibility to hide those help construction elements.
    Thank you for any hints.
    Regards
    Apollo102

    Hello Apollo,
    There is a way to hide elements from the Structure View (one such method is offered by the free AXCM plug-in). What happens when you use AXCM (or other methods to hide elements) is that the elements get wrapped into hidden content. This might make the structure view less complex for your authors, but has a number of disadvantages and dangers.
    1. The structure is normally invalidated, as the helper elements are usually required.
    2. Accidentally deleting hidden content may make the invalidation permanent and render your documents useless.
    It is NOT good practice to hide elements from authors in the structure view. Instead, you should either teach authors about the structure, or let them work in the Author View while adding sufficiently clear formatting to show them the underlying structure. In some cases, it might be better to create an authoring structure which is automatically transformed into the required full structure using an XSLT or other processing step. I have created a couple of such environments and they work fine. It just depends on the difference between the structure required for further processing and the structure that would be optimal for your authors (which in turn depends on the level at which your authors are experienced in working with structured content).
    I hope this helps you solve your problem without having to tweak the structure view.
    Kind regards
    Jang

  • Firefox will not remember passwords even tho the box is checked and there are no exceptions listed. The little bar asking to save passwords doesn't even come up.

    After an online session, Firefox (6.0.1) crashed and a crash report was sent. After that, Firefox would not start and the crash window kept coming up. I uninstalled it and did a new install. It works fine now except it will not remember passwords even tho the box to save is checked and there are no exceptions listed. The bar asking to save does not come up.

    Make sure that you not run Firefox in (permanent) [[Private Browsing]] mode.
    * You enter Private Browsing mode if you select: Tools > Options > Privacy > History: Firefox will: "Never Remember History"
    * To see all History and Cookie settings, choose: Tools > Options > Privacy, choose the setting <b>Firefox will: Use custom settings for history</b>
    * Uncheck: [ ] "Permanent Private Browsing mode"
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    * [[Troubleshooting extensions and themes]]

  • Why does fix capitalization work when there is only one space after the period in pages 09?

    why does fix capitalization work when there is only one space after the period in pages 09?  For example:  "Turn on 3rd St. After the traffic light."  There is only one space after the period in "St."  shouldn't it only auto correct after TWO spaces..??  the word After, should be after..

    You may also use a noBreak space after the period at the end of the abbreviation.
    If I remember well, in such case the capitalization will not apply.
    Yvan KOENIG (VALLAURIS, France) mercredi 27 avril 2011 23:34:46

  • How to put an xml element in the header field?

    Hello friends,
    My requirement is like I've a particular element that needs to be printed on the header filed
    for ex --dept_no and dept_name in the header field...please let me know how..
    Thanks

    For each occurrence of DEPT_GROUP, a new section is created.
    These sections can have different header/footer.
    In case, you want different values to be displayed in header/footer section(as your requirement) or you want the page numbers to be reset for each group, you can use this command.
    Check the user guide http://download.oracle.com/docs/cd/E10415_01/doc/bi.1013/e12187/T421739T481157.htm#4535398

  • Good evening, How can I check if there are downloaling programs running in the background while using an IPod. I want to eliminate them because my internet dowload volume has increased dramatically.

    How can I check if I have a software(s) installed on my Ipod touch (4th generation) that download information all the time in the background? My internet downlaod consumption has increased dramatically lately and I cannot solve the problem. An online support person from my internet provider suggested to check that out.
    Thanks for your¸help.

    HI northangel,
    you can press the home button double times and the bottom of the screen and it will show apps that are running in the backround.

  • When I start de application, I get two messages at once. The first one tells me that there are two upgraded elements and the second one tells me that a customer of mine has made some online changes on the website. Then I can do nothing more.

    Beste forum,
    Ik heb een groot probleem met Muse.
    Als ik het programma opstart en een bestaande website open, krijg ik twee meldingen te zien: de eerste zegt dat er twee geupsamplede bestanden zijn. De tweede dat er online een wijziging heeft plaatsgevonden. Beide vensters zijn vervolgens niet aan te klikken en het programma doet niets meer.@

    The message tells that published version of the site includes some changes which you can synch to your Muse file, is that after sync Muse hangs ? is it with a specific file or any file ?
    If you try to undo the changes , are you able to open the site and work ?
    Thanks,
    Sanjit

  • Appending content to an XML file in the Root tag using FileAdapter

    Hi Friends..!!
    I have got a requirement like this. There will be an XML file with List of Employees like following...
    <Employees>
    <Emp>
    <SNo>111</Sno>
    <Fname>Mahesh<Fname>
    <Lname>Babu</Lname>
    </Emp>
    <Emp>
    <SNo>222</Sno>
    <Fname>----<Fname>
    <Lname>-----</Lname>
    </Emp>
    <Emp>
    <SNo>----</Sno>
    <Fname>----<Fname>
    <Lname>----</Lname>
    </Emp>
    </Employees>
    .. So What i have to do is Appending the given Employees info to the existed XML file using File Adapter. But When i m trying to figure it out.. the given details are appended at the end of the previous content.. but i want to see all the Emp tags(the newly appended emp list also) in the existed <Employees> tag only..
    (i m also facing namespace issues here)
    Can u plz provide solution for this problem..?
    Thanks in advance.
    Regards-
    Nlion7

    Hi Nilon7,
    the given details are appended at the end of the previous contentThat will be the behaviour if you are just using file write with append...
    You will need to expand your solution into three steps, firstly a file adapter sync read to retrieve the current contents of the file, then a xslt transformation to "merge" the current data with the new data and finally a file adapter write with the merged content...
    Cheers,
    Vlad

  • Check for existing XML element

    Dear all,
    I'm trying to write a simple script first checking to see whether an XML element exists, and then creating it if it doesn't. I've tried editing a piece of code that I used previously to do the same for paragraph styles, but apparently it's not that straightforward. Currently, all I get is the error "Cannot execute the script in target engine 'main'!" Without the checking, adding the XML element based on the search result works fine.
    /* Find all instances of the word "Superscript" */
    app.findTextPreferences.findWhat = "Superscript";
    var mySuperscript = myDocument.findText(); // Save search result for future reference
    /* See if an XML element named "Superscript" already exists, and create it if that's not the case; then add it to all instances of the word "Superscript" */
    var myXMLElementSuper = myDocument.xmlElements.item("Superscript");
    try {
    var myName = myXMLElementSuper.name;
    catch (myError){
        var myXMLElementSuper = myDocument.xmlElements.add({markupTag:"Superscript", xmlContent:mySuperscript[i]});}
    Any assistance would be greatly appreciated!
    Kind regards and thanks in advance,
    Julian

    Try this,
    app.findTextPreferences=app.changeTextPreferences=null; 
    app.findTextPreferences.findWhat = "Superscript"; 
    var mySuperscript = app.activeDocument.findText();
    for(var i=0; i< mySuperscript.length; i++)
        if(mySuperscript[i].associatedXMLElements[0].markupTag.name != "Superscript")
            app.activeDocument.xmlElements[0].xmlElements.add({markupTag:"Superscript", xmlContent:mySuperscript[i]}); 
    app.findTextPreferences=app.changeTextPreferences=null; 
    Vandy

  • Simple Transformation with very long XML element names

    I am trying to write a program to deserialize XML documents using the Simple Transformation technique.  There are many optional elements in the XML document, so I need to have conditional statements statements to avoid trying to process elements that are not in the document.  The XML document, however, has several Element Names that are greater than 30 characters in length.  The Simple Transformation technique seems to require ABAP data dictionary structures that mirror the schema of the XML document.  But one cannot create structure component names that are greater than 30 characters in length.  We don't have any control over the XML schema as the XML documents come from the US government.  The ST fragment below shows the statement that I want to write, but since the ABAP Structure PlasticCardInformationGroup cannot have a component AuthorizationResponseInformation, the ST syntax checker yields an "Illegal Reference ADDITIONALPLASTICCARDINFORMATION" error message.
    Does anyone know a way to avoid this error?
    <tt:d-cond check="exist(TRS_TradingPartner_Agreement.TRS_FinancialTransaction.PlasticCardInformationGroup.AdditionalPlasticCardInformation)">
    <ns2:AdditionalPlasticCardInformation>
    <tt:attribute name="CardNetworkType" value-ref="TRS_TRADINGPARTNER_AGREEMENT.TRS_FINANCIALTRANSACTION.PLASTICCARDINFORMATIONGROUP.ADDITIONALPLASTICCARDINFORMATI.CARDNETWORKTYPE"/>
    <tt:attribute name="DraftLocatorNumber" value-ref="TRS_TRADINGPARTNER_AGREEMENT.TRS_FINANCIALTRANSACTION.PLASTICCARDINFORMATIONGROUP.ADDITIONALPLASTICCARDINFORMATI.DRAFTLOCATORNUMBER"/>
    </ns2:AdditionalPlasticCardInformation>

    could anyone help me?

  • Remove XML element with JAXB

    Hi all,
    does anyone knows if it's possible to remove an xml element after that element has been set ? Using only jaxb if possible and not using other technology, for example DOM.
    I explain:
    umarshall car -->setOwner("me"); setSpeed("80"); -->marshall car
    will result into:
    <car>
    <owner>me</owner>
    <speed>80</speed>
    </car>
    I would like something that for example
    unmarshall car -->remove(speed); ....-->marshall car
    would result into:
    <car>
    <owner>me</owner>
    </car>
    could someone point out a way to do that ?
    thanks in advance...

    Okay, after peering over your code and trying a few things out I see one immediate problem and one possible improvement.
    The problem lies in this:
    1. if condition is true, remove item
    2. check recursively
    The problem is .. if an item is removed, the following recursive check will always fail. However, the entire loop is wrapped into a try..catch, so InDesign will not alert you that it failed. Instead, it will continue with what's after the loop, exactly because the try..catch is around the entire loop!
    Change the loop code to this
    if((elm.xmlElements[i].markupTag.name == "http") && (elm.xmlElements[i].parent.markupTag.name == "extlink"))
        var Store_CitAttri = elm.xmlElements[i].xmlAttributes.item("c_style").value;
        if(Store_CitAttri == "URL")
          elm.xmlElements[i].remove();
           foundtext = foundtext + 1;
           continue;
    Query_Remove(elm.xmlElements[i]);
    so the recursive checking is skipped. You can also remove the entire try..catch block, as this may hide additional errors ...
    The improvement is: as I started reading this thread from the top again, shouldn't you be removing the "extlink" items, rather than just the "http" ones inside?
    If so, remove the parent of the found item (which is always the "extlink"):
          elm.xmlElements[i].parent.remove();
    -- and, as this will break the loop (because you just removed the set of elements it was working in!), replace 'continue' with 'return'.
    Hope this helps

  • XML element missing

    hi there
    Does anyone know if Oracle has removed the Extend XML element from the Funds Capture Extract data definitions. I can see the document (oracle Payments Implementation guide) showing that the Extend element should at all levels but when I look at the iby package/views that build the extract does not have that element in the structure??
    Can anyone tell me how to get custom data in the XML so I can use it in my funds capture output.
    thanks.

    Hi,
    You could try one thing.
    Instead of taking the xml from PI , just check out if the proxy works with the auto generated xml in test.
    If required, could edit the values only.
    If it works, then compare both the xml.
    Also, try regenerating the proxy.
    Regards,
    Manjusha

  • Checking .txt file with valid XML tags

    hey guys,
    I've a .txt file which conatins info with XML tags. I've to check whether the file contains valid tags or not!
    a tag should start with "<" and end with ">", there shouldn't be space between characters after "<" e.g.
    a tag should be like "<name>" or "</name>" not "< name>" or  "< /name>" nor "<name" or "</name"nor "name>" or  "/name>"Here is an example of a well formed XML document:
    <root>
    Some text <nextTag> more text  <secondTag> stuff </secondTag> </nextTag> more text again
    </root>Here is an example of XML .txt file:
    <students >
         <student>
              <name> John </name>
              <name> Doe </name>
              <address> 98 Pine St.</address>
         </stdnt>
    </students>I also have to make sure that no text appears before and after the root tag! Please help me, i'm trying to figure out but my alogrithm just doesn't work! Thanks in advance!!!

    What's the purpose of those requirements? If you
    wanted to check whether the file was well-formed XML
    then you would just need to run it through an XML
    parser. But some of the things you plan to reject are
    actually well-formed XML. I don't see the point of
    that.basically, it's my assignment. In the assignment our task is to check the .txt files to make sure that all XML tags are valid. The problems i mentioned in my first post, i've figured those out, eventually. There're few other things which i've to also make sure for example no text appearing before and after the root tag
    Can someone please tell me how i can check following cases:
    text<root> or </root> text  (both are invalid XML files)

  • Moving an existing xml element into aTable

    Hi Everyone,
    After importing the xml I need to place or convert the xml elements into the table. Is there any way to do this by JS?
    Here is the sample Table xml elements....
    <table-wrap id="ch3_t1">
    <label>Table 3.1</label>
    <caption>
    <title>Anatomy and Classification of Major Hepatic Resections</title>
    </caption>
    <table>
    <thead>
    <tr>
    <th align="left" valign="top" colspan="5">Anatomic Classification</th>
    </tr>
    <tr>
    <th align="left" valign="top">Couinaud</th>
    <th align="left" valign="top" colspan="2">Goldsmith and Woodburne</th>
    <th align="left" valign="top">Brisbane</th>
    <th align="left" valign="top">Segments resected</th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td align="left" valign="top">Right hepatectomy</td>
    <td align="left" valign="top" colspan="2">Right hepatic lobectomy</td>
    <td align="left" valign="top">Right hemihepatectomy</td>
    <td align="left" valign="top">V, VI, VII, VIII</td>
    </tr>
    <tr>
    <td align="left" valign="top">Right lobectomy<sup>a</sup>
    </td>
    <td align="left" valign="top" colspan="2">Extended right hepatic lobectomy</td>
    <td align="left" valign="top">Right trisectionectomy</td>
    <td align="left" valign="top">IV,V,VI, VII, VIII<sup>b</sup>
    </td>
    </tr>
    <tr>
    <td align="left" valign="top">Left hepatectomy</td>
    <td align="left" valign="top" colspan="2">Left hepatic lobectomy</td>
    <td align="left" valign="top">Left hemihepatectomy</td>
    <td align="left" valign="top">II, III, IV</td>
    </tr>
    <tr>
    <td align="left" valign="top">Extended left hepatectomy<sup>a</sup>
    </td>
    <td align="left" valign="top" colspan="2">Extended left lobectomy</td>
    <td align="left" valign="top">Left lateral sectionectomy</td>
    <td align="left" valign="top">II, III, IV, V, VIII<sup>b</sup>
    </td>
    </tr>
    <tr>
    <td align="left" valign="top">Left lobectomy</td>
    <td align="left" valign="top" colspan="2">Left lateral segmentectomy</td>
    <td align="left" valign="top">Left trisectionectomy</td>
    <td align="left" valign="top">II, III</td>
    </tr>
    </tbody>
    </table>
    </table-wrap>
    Looking forward your replies... Your help will be thankful....

    You may want to look again, specifically section 20.11 Moving Oracle Enterprise Content Management to a Production System, Task 4.
    The same basic steps would apply to 10g, minus the WebLogic parts. (Also note that prior to 11g, what you are attempting is really a non-supported configuration. In 11g, Oracle at least gives this set of supported pointers.)

  • NS0 namespace in every element after mapping

    Hi All,
    We have a scenario IDOC --> XML file on a file share. I created a free style data type for the XML message and the mapping objects. When I test the message mapping, every XML element gets the ns0 namespace before the tagname. The namespace prefix is ok to be mentioned on a root level, but not with every element. Can we configure something that this behavior is not occuring anymore?
    Example current result:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:OrderCreateNotification xmlns:ns0="urn:mc-nl:procurement:boras:boras">
    <ns0:OrderNumber>4550000037</ns0:OrderNumber>
    <ns0:DocumentDate>20140722</ns0:DocumentDate>
    <ns0:OrderItem>
         <ns0:ItemNumber>00001</ns0:ItemNumber>
         <ns0:Unit>ST</ns0:Unit>
         <ns0:Quantity>100.000</ns0:Quantity>
         <ns0:NettPrice>10000</ns0:NettPrice>
         <ns0:PurchaseRequisitionItemNumber>00000</ns0:PurchaseRequisitionItemNumber>
         <ns0:TaxRate>21.00</ns0:TaxRate>
    </ns0:OrderItem>
    </ns0:OrderCreateNotification>
    I expected to have it like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:OrderCreateNotification xmlns:ns0="urn:mc-nl:procurement:boras:boras">
    <OrderNumber>4550000037</OrderNumber>
    <DocumentDate>20140722</DocumentDate>
    <OrderItem>
         <ItemNumber>00001</ItemNumber>
         <Unit>ST</Unit>
         <Quantity>100.000</Quantity>
         <NettPrice>10000</NettPrice>
         <PurchaseRequisitionItemNumber>00000</PurchaseRequisitionItemNumber>
         <TaxRate>21.00</TaxRate>
    </OrderItem>
    </ns0:OrderCreateNotification>
    With the data type it is possible to define the property "qualify schema", but it doesn't seem to do anything.
    I know of the possibility to use the XML Anonimizer module, but I was hoping that we can configure this in a standard way.
    kind regards,
    Mark

    Hi All,
    Issue was solved by defining the value "None" in the Qualify Schema option + reimporting the message types into the message mapping after making the Qualify Schema change. The XML structures didn't got refreshed automatically.
    Everything is working normally now with the ns prefix only on root level.
    Regards,
    Mark

Maybe you are looking for

  • List of transactions are not available for creation in CRMD_ORDER

    Hai Experts, I am trying to create opportunity by using T.Code CRMD_ORDER, Business transaction-Create, Ideally the system shall display the list of transactions that are available(as available in Define Transaction types), but the system is showing

  • Photoshop CS2 in 2006. for Macintosh. Now I changed the Maverick version 10.9.

    Hello  I purchased Photoshop CS2 in 2006. for Macintosh. Now I changed the Maverick version 10.9. But now I do not know where to download the same version, so I use bought in 2006 key. When pulled CS2 can not install it because my version is higher.

  • Flash CS4 Trial won't install

    Hi There! I've been trying to install Flash CS4 Trial since its release but always get the same error message. The package is uncompressed and install process begins, goes to 100% and then a message box comes on asking to check disk space (I've got p

  • My elements suite i bought (CD) doesn't have a serial number

    Hi i bought Adobe Premiere elements 13 and Photoshop Elements 13 in a box (CD) from JB hifi and it has no serial number any where that i can see so therefore i cannot install the programmes. thanks Janet

  • DD_DOMA_GET not enabled

    Hi All, I have installed netweaver 2004 portal & trying to connect to SAP r/3 . It is giving message that DD_DOMA_GET has to be remote enabled. My System is SAP R/3 4.7 enterprise . My Current BASIS Component is 620 & level is 11 & for ABAP component