Hide the XML attribute if no data value / doesn't exist

Hello

I have a xsd defined as the following structure:
--------------
< xsd: complexType name = "PersonImageType" >
< xsd: attribute name = "ID" type = "xsd: Integer" / >
< xsd: attribute name = "FileName" type = "xsd: String" / >
< xsd: attribute name = "ErrorMessage" type = "xsd: String" use = "optional" / >
< xsd: attribute name = "Fetched" type = "xsd: String" / >
< xsd: attribute name = "S1" type = "xsd: String" / >
< xsd: attribute name = "S2" type = "xsd: String" / >
< / xsd: complexType >
--------------

When I run my BPEL process, I get the reply/output as follows:

--------------
< PersonImage >
"" < PersonImage ID = "12410276" FileName = "12410276.jpg" ErrorMessage ="" recovered = "Y" S1 = S2 "Y" = "Y" / >
< / PersonImage >
--------------

When you look at the output, the xml 'ErrorMessage' attribute has no value in it.
I want to:
(a) hide this attribute - when there is no data and
(b) display this attribute - when it has all the data.

Very appreciated if someone help me solve this problem.

Thank you and best regards,
Rakesh

without double quotes around the @ErrorMessage

see you soon
James

Tags: Fusion Middleware

Similar Questions

  • How to remove the value of the XML attribute in the Indesign file with javascript

    Hi all

    How to remove the value of the XML attribute in the Indesign file.

    1.jpg

    What error is this?

    in any case try this as well (one another),

    var myDoc = app.activeDocument;
    attrDelete(myDoc);
    function attrDelete(elm)
    {
        for (var i = 0; i < elm.xmlElements.length; i++)
        {
            try{
                for(j=0; j
    

    Vandy

  • How to hide the status of «Transfer of data...» » ?

    I want to hide the State of «Transfer of data...» "that shows in the bottom left of the browser's screen because he is as dangerous as a flashing icon, from the ergonomic point of view.

    You can hide the pop-up messages for specific with userChrome.css code State if you still want to see links to the overview.

    Add code to the file userChrome.css below default @namespace.

    Customization files (interface) userChrome.css and userContent.css (Web sites) are located in the chrome folder in the user profile folder.

    @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    
    #statusbar-display[label^="Looking"] {display:none !important;}
    #statusbar-display[label^="Connect"] {display:none !important;}
    #statusbar-display[label^="Waiting"] {display:none !important;}
    #statusbar-display[label^="Transfer"] {display:none !important;}
    
  • Retrieves the value of the XML attribute for multiple element sequence

    Guys,

    I have already posted this in the forum XML DB, but some of you could help me.


    I have searched for a solution for this and couldn't quite. I'm trying to get multiple entries in a node attribute values. It workes for a single node, but for many nodes, it fails. Could you please give me a solution?

    SQL> select extractvalue(column_value, '/WORLD/COUNTRY/@NAME') COUNTRY_NAME
      2        ,extractvalue(column_value, '/WORLD/COUNTRY/CITY/@NAME') CITY_NAME
      3        ,extractvalue(column_value, '/WORLD/COUNTRY/CITY/@POPULATION') POPULATION
      4  from xmltable('WORLD' passing xmltype('
      5  <WORLD>
      6  <COUNTRY NAME="INDIA">
      7  <CITY NAME="MUMBAI" POPULATION="10000"></CITY>
      8  </COUNTRY>
      9  </WORLD>'
     10  ));
     
    COUNTRY_NAME CITY_NAME POPULATION
    ---------------------- ------------------ -------------------
    INDIA MUMBAI 10000
    When I execute the same for several nodes, it fails, please guide me. Please also let me know how to handle if I have an XML file that contains this data.

    SQL> select extractvalue(column_value, '/WORLD/COUNTRY/@NAME') COUNTRY_NAME
      2        ,extractvalue(column_value, '/WORLD/COUNTRY/CITY/@NAME') CITY_NAME
      3        ,extractvalue(column_value, '/WORLD/COUNTRY/CITY/@POPULATION') POPULATION
      4  from xmltable('WORLD' passing xmltype('
      5  <WORLD>
      6  <COUNTRY NAME="INDIA">
      7  <CITY NAME="MUMBAI" POPULATION="10000"></CITY>
      8  <CITY NAME="CHENNAI" POPULATION="2000"></CITY>
      9  <CITY NAME="BANGALORE" POPULATION="13000"></CITY>
     10  <CITY NAME="HYDERABAD" POPULATION="14000"></CITY>
     11  </COUNTRY>
     12  </WORLD>'
     13  ));
    select extractvalue(column_value, '/WORLD/COUNTRY/@NAME') COUNTRY_NAME
                                                                      *
    ERROR at line 1:
    ORA-19025: EXTRACTVALUE returns value of only one node
    See you soon
    Sarma.

    So, this is the first step:

    SQL> with test as
      2  (select xmltype('
      3                 
      4                 
      5                 
      6                 
      7                 
      8                 
      9  ') resp from dual)
     10  select country
     11       , cities
     12  from xmltable('WORLD/COUNTRY' passing (select resp from test)
     13                         columns country varchar2(50) path '/COUNTRY/@NAME'
     14                               , cities xmltype path '/COUNTRY/CITY') world
     15  /
    
    COUNTRY         CITIES
    --------------- --------------------------------------------------
    INDIA           
    

    two columns, a varchar2 and an xmltype.

    Then do the same with the second column, pass the XML to the function XMLTABLE

    SQL> with test as
      2  (select xmltype('
      3                 
      4                 
      5                 
      6                 
      7                 
      8                 
      9  ') resp from dual)
     10  select country
     11       , cit.name
     12       , cit.population
     13  from xmltable('WORLD/COUNTRY' passing (select resp from test)
     14                         columns country varchar2(50) path '/COUNTRY/@NAME'
     15                               , cities xmltype path '/COUNTRY/CITY') world
     16     , xmltable ('CITY' passing cities
     17                columns name varchar2(50) path '@NAME'
     18                      , population number path '@POPULATION'
     19                ) cit
     20  ;
    
    COUNTRY         NAME                                               POPULATION
    --------------- -------------------------------------------------- ----------
    INDIA           MUMBAI                                                  10000
    INDIA           CHENNAI                                                  2000
    INDIA           BANGALORE                                               13000
    INDIA           HYDERABAD                                               14000
    
  • POOR RECOVERY OF THE XML ATTRIBUTE VALUES

    Hi all

    I searched this forum and the web a way to get the value of an xml attribute. The solutions I found always had a problem, the values returned when concatenated without any separators, so I can't know every value.

    Here's how:

    BEGIN

    l_bfile: = BFILENAME ('CTEMP1', nome_fich);
    DBMS_LOB. FileOpen (l_bfile);
    DBMS_LOB. LoadFromFile (l_clob, l_bfile, DBMS_LOB.lobmaxsize);
    DBMS_LOB. FileClose (l_bfile);
    xmlx: = XMLTYPE (l_clob);
    Str: = xmlx. Extract('rowset/Row/@id'). GETSTRINGVAL();

    dbms_output.put_line (' :'|| id values) (STR);
    END;

    Returns the string str: 123456654321 for this example

    <? XML version = "1.0" encoding = "UTF-8"? >
    rowset <>
    < row id = "123456" >
    < name > Peter < / name >
    < / row >
    < row id '654321' = >
    < name > Louis < / name >
    < / row >
    < / lines >


    I want to get each id concatenated for example values (123456:654321) instead, I get the concatenated values (123456654321).


    Does anyone know a work around for this problem?


    Cordially Pedro.

    11.2 you can use listagg()

    SQL> with t as (select xmltype('
      2    
      3      Peter
      4     
      5     
      6      Louis
      7     
      8    ') xcol from dual)
      9  select listagg(v.val,':') within group (order by null) val
     10  from t,xmltable('/rowset/row/@id'
     11  passing t.xcol
     12  columns val varchar2(1000) path '.') v;
    
    VAL
    ------------------------------------------------------------------------------------------------------------------------
    123456:654321  
    

    If not 11.2

    SQL> with t as (select xmltype('
      2  
      3  Peter
      4  
      5  
      6  Louis
      7  
      8  ') xcol from dual)
      9  select xmlquery('fn:string-join(/rowset/row/@id,'':'')'
     10  passing by value t.xcol  returning content) val
     11  from t;
    
    VAL
    ------------------------------------------------------------------------------------------------------------------------
    123456:654321
    
  • the value of the xml column type tag data BLOB

    Hello

    I'm on Oracle 10 g.
    I have a table that has a column as BLOB data type and contains XML data. I need to select specific table records according to a unique tag value of the xml data in the BLOB column. For example:
    The table say Test has two columns: id (integer) and MESG (BLOB)
    The xml in the MESG column message is assumed:
    < message >
    < > 123456 contactphone < / contactphone >
    < contactname > ABCD < / contactname >
    < amount > 9999 < / amount >
    < / message >

    I need to extract only the records where the amount is = 9999

    Help, please. Thanks in advance.

    user12850338 wrote:
    Hi BluShadow,
    Thanks for your reply.
    I confess that if we would have used type xml in the first place, things would have been easier.
    For example, I mentioned three tags in the xml file, but my real data contains some hundreds of tags... :( So it will always be a good idea with this approach.

    Yes, it's a good approach. Oracle has provided built-in XML functionality to manage XML, then of course it's the best thing to use. :)

    For example, you can easily deal with namespaces and repeating nested groups and flatten the data in a table structure. for example

    SQL> ed
    Wrote file afiedt.buf
    
      1  WITH t as (select XMLTYPE('
      2  
      3    
      4      1
      5      1800
      6      
      7        1
      8        28
      9        6
     10        12
     11      
     12      
     13        5
     14        19
     15        1
     16        90
     17      
     18    
     19    
     20      2
     21      2400
     22      
     23        3
     24        14
     25        7
     26        5
     27      
     28    
     29  ') as xml from dual)
     30  -- END OF TEST DATA
     31  select x.country, x.point, y.user_id, y.target, y.state, y.task
     32  from t
     33      ,XMLTABLE(XMLNAMESPACES('http://www.w3.org' as "aa"),
     34                '/RECSET/aa:REC'
     35                PASSING t.xml
     36                COLUMNS country NUMBER PATH '/aa:REC/aa:COUNTRY'
     37                       ,point   NUMBER PATH '/aa:REC/aa:POINT'
     38                       ,user_info XMLTYPE PATH '/aa:REC/*'
     39               ) x
     40      ,XMLTABLE(XMLNAMESPACES('http://www.w3.org' as "aa"),
     41                '/aa:USER_INFO'
     42                PASSING x.user_info
     43                COLUMNS user_id NUMBER PATH '/aa:USER_INFO/aa:USER_ID'
     44                       ,target  NUMBER PATH '/aa:USER_INFO/aa:TARGET'
     45                       ,state   NUMBER PATH '/aa:USER_INFO/aa:STATE'
     46                       ,task    NUMBER PATH '/aa:USER_INFO/aa:TASK'
     47*              ) y
    SQL> /
    
       COUNTRY      POINT    USER_ID     TARGET      STATE       TASK
    ---------- ---------- ---------- ---------- ---------- ----------
             1       1800          1         28          6         12
             1       1800          5         19          1         90
             2       2400          3         14          7          5
    
    SQL>
    
  • Panel request: hide the transient attributes

    Hello

    I have an EmpVO that has a transitional attribute to say lets say for example age. I want to display on the page. This page is a panel request also with "Add", more fields dropdown. I don't want to display my age transitional attribute in the query Panel or adding drop-down fields.

    When I put the suspicion of display to hide in the indicators of control of the view at the age attribute, object, the value is NOT coming in the page. ID, I say 'Display' is 'also' showing in the query Panel.

    My Version of JDev

    -----------------------------------------------------

    Studio Edition Version 11.1.1.7.0

    Build JDEVADF_11.1.1.7.0_GENERIC_130226.1400.6493

    JDK1.6

    Thank you

    Murali.

    Hello

    Check this: https://tompeez.wordpress.com/2012/01/06/jdev-afquery-hide-some-attributes-from-query-panel-but-show-them-in-the-result-table/

    Arun-

  • Web game see the presentation in order to hide the predefined attributes

    Hi, I'm creating a workflow that automates the creation of vDC. The goal is to give our customer vCloud the possibility of deploying vDC themselves. A problem I have is that the workflow of creating default vDC give user option to select the provider TDC. We want to set this attribute and hide the customer. But the only option I can find is to hide the parameter when an another Boolean input attribute has been set to 'True' or 'False '.

    There must be another way to hide these predefined attributes. Can anyone help?

    Thank you

    Do not have another attribute of input, you can simply define "true" (without the quotes) in the value field for the hide option

    In addition, you can move the entry as an attribute and predefine your provider vDC here.

  • Parse the XML file and extract data

    I want to parse a XML file and get the data as columns.

    Input country.xml file:

    <?xml version="1.0" encoding="UTF-8"?>
    <MAS Action="Insert">
    <Country ObjectId="100000000000000009" VersionId="8"><Id>1</Id><NlTexts><Name Language="de">Land1</Name><Name Language="en">Country1</Name></NlTexts></Country>
    <Country ObjectId="100000000000000033" VersionId="2"><Id>2</Id><NlTexts><Name Language="de">Land2</Name><Name Language="en">Country1</Name></NlTexts></Country>
    </MAS>
    
    

    I would like to analyze the xmlfile to get the following result

    Required result:

    col1        col2           col3
    1            Land1        Country1
    2            Land2        Country2
    

    or alternatively

    col1  col2       
    1            Land1       
    1            Country1
    2            Land2       
    2            Country2
    

    I tried the extract function

    select extract((XMLTYPE(BFILENAME('XML_DAT_DIR', 'country.xml'),
               NLS_CHARSET_ID('AL32UTF8'))) , '/*/*/Id') as "xdata"
    from dual;
    
    xdata
    ------------------------
    <Id>1</Id><Id>2</Id>
    

    and XMLTABLE (but how can I add countries now)

    SELECT *
        FROM XMLTABLE('/*/*/Id'
               PASSING XMLTYPE(BFILENAME('XML_DAT_DIR', 'country.xml'),
               NLS_CHARSET_ID('AL32UTF8'))
           )
      ;
    COLUMN_VALUE
    ------------------------
    <Id>1</Id>
    <Id>2</Id>
    

    DB version 11.2.0.3 on Windows 64-bit

    Thank you

    Tim

    Here are a few examples.

    For your output required:

    SELECT *.

    FROM XMLTable)

    "/ MAS/country".

    from XMLType (bfilename ('TEST_DIR', 'country.xml'), nls_charset_id ('AL32UTF8'))

    number of columns col1 way "Id".

    , col2 varchar2 (30) path "NlTexts/name [1].

    , col3 varchar2 (30) path "NlTexts/name [2]»

    )

    ;

    or, if the Language attribute is significant:

    SELECT *.

    FROM XMLTable)

    "/ MAS/country".

    from XMLType (bfilename ('TEST_DIR', 'country.xml'), nls_charset_id ('AL32UTF8'))

    number of columns col1 way "Id".

    col2 varchar2 (30) path "NlTexts/Name[@Language="de"]"

    col3 varchar2 (30) path "NlTexts/Name[@Language="en"]"

    )

    ;

    For your alternate exit:

    SELECT x1.col1

    x2.col2

    -, x2.col3

    FROM XMLTable)

    "/ MAS/country".

    from XMLType (bfilename ('TEST_DIR', 'country.xml'), nls_charset_id ('AL32UTF8'))

    number of columns col1 way "Id".

    , path of xmltype names ' NlTexts/name '.

    ) x 1

    XMLTable)

    "/ Name".

    in passing x1.names

    path of column col2 varchar2 (30) '.'

    -, col3 to ordinalite

    ) x 2

    ;

    (uncomment col3 to see what he does)

    or in a shorter way:

    SELECT *.

    FROM XMLTable)

    ' for $i/MAS/country

    , $j in $ NlTexts/i/name

    Returns the r element {$i / Id, $j}'

    from XMLType (bfilename ('TEST_DIR', 'country.xml'), nls_charset_id ('AL32UTF8'))

    number of columns col1 way "Id".

    , col2 varchar2 (30) path 'name '.

    ) ;

  • How to hide the table header if no data is present

    Hello

    I need to hide the heading for the table if no data is present. Table a, column 5. If no matter what clolumn gave this section table should not be display.

    I use <? If: count (Installation_Event_S19) = 0? > but this is not a job for me.

    Could you please help me.

    Thank you

    Sylvie Kumar


    I think you want to show/hide a table that if its conditions of licence exists and have some value. You can have an if condition including the table.

  • How to add the XML attribute to an element using BPEL assign

    I have a xml request to a bpel process that contains no attribute.
    After some process, I need to create this missing attribute and specify a value.

    I tried to use the XML fragment in the business to be divested. But how do I create an attribute?
    This XML node which I am trying to create an attribute is a very large knot with many dynamic typing(xsi:type). I can just re - create the complete xml code with the required nodes.

    Anyone know how I can create an attribute xml using the BPEL entitlement? I don't want to use the Java code in my process.

    Thank you.

    You can use the attribute bpelx:insertMissingToData on the item to copy, for example:




    Query="/client:process/@time"/ >

    If not there is time of the attribute in the process element, it will be added.

  • With the help of the XML attributes in itemRenderer and labelFunction

    Hello!

    I searched for hours and read the Devguide but always impossible to find the solution to my problem.
    I have a xml returned from php like this:
    < files >
    < record id = "1" name = "name_1" type = "0" / >
    < record id = "2" name = "name_2" type = "0" / >
    < record id = "3" name = "name_3" type = "1 / >"
    < / documents >

    I can bind the result returned from the HTTPService to a data grid:

    < mx:DataGrid dataProvider = "{ret_XML.record}" width = "500" number of rows = "20" editable = "false" id = "dg" > "
    < mx:columns >
    <!-NEXT WORK! ->
    "< mx:DataGridColumn headerText ="Name" dataField="@name " width ="300"/ >
    <!- LABELFUNC don't DO NOT WORK IN LINE NEXT->
    "< headerText ="Type"dataField="@type mx:DataGridColumn " labelFunction ="labelFunc">
    < / mx:DataGridColumn >
    "< headerText ="Id"mx:DataGridColumn dataField="@id " editable ="false">
    < mx:itemRenderer >
    < mx:Component >
    <!-LINE FOLLOWING IS don't DO NOT WORK! ->
    "{< mx:Button label="{data.@id} '/ >
    < / mx:Component >
    < / mx:itemRenderer >
    < / mx:DataGridColumn >
    < / mx:columns >
    < / mx:DataGrid >

    and I have a labelFunction like this:

    private void labelFunc(item:Object,_column:DataGridColumn):String {}
    return "Type:"+ item.@type; "
    }

    So, my problem is that when I bind the column to an XML attribute, it works fine but when I try to link it to an itemRenderer or use it in a function, it does not work. I'm trying for hours now, but just can't make it work.
    I tried:
    "{< mx:Button label="{data.@id} '/ >
    < mx:Button label = "{data. () @id)} »/ >
    "{< mx:Button label="{@data.id} '/ >

    and perhaps others but no luck...
    Please someone help me with this one!

    Ty:
    [Pig]

    Problem solved!

    Well, post it on the forum after I solved my problem as follows:

    So in itemRenderer just use data.attribute () with the desired XML attribute name

    And in the labelFunction:

    private void labelFunc(item:Object,_column:DataGridColumn):String {}
    return "Type:"+ item.attribute ('type'); '.
    }
    Even with itemRenderer but rather data use () item.attribute

    I hope that this is the 'official' solution too...

    [Pig]

  • Add the XML attribute

    Right now I work with a very simple .xml file that retrieves data ultimately resulting in the generation of run-time components. Here is a simplified version:

    < data >
    < article type = "Button" x = "50" y = "100" label = "Button 1" / >
    < article type = "Button" x = "50" y = "300" label = "Button 2" / >
    < / data >

    I figured out how to remove an attribute, such as the "label" with this:

    If (. name(). attributes() [i] myXML.item [0] == "label" "")
    {
    delete myXML.build.item [0]. attributes() [i];
    i-- ;
    }

    Now, the question is how can I add another attribute - like the "height"? Any help would be greatly appreciated. Thank you.

    Okay, I just stumbbled on the solution:

    x 1. @["name"] = "test 2"; "

    This seems to do. I don't know if the reverse works just not or if I did it all just bad. Thanks for your help.

  • [CS5 - JS] Definition of the XML attributes from variables...

    Hello

    I'm building a XML variable to store the information needed to run my script.

    The XML structure is quite simple:

    var = new XML document ("< document > < pages > < page / > < / pages > < / document >");

    Every 'page' nodes are added using a simple statement.

    If I need to add an attribute to a node of 'page' I usually use this method:

    document.pages.page.@height= 210;

    What happens if I need to add an attribute without knowing its name (because it is stored in a variable)?

    Y at - it something like that? :

    document.pages.page.setAttribute (Name, 210);

    Have no idea how to handle this...

    Try this:

    document.pages.page['@'+var_name] = 210;

    @+

    Marc

  • Remove the XML attribute

    Hello

    I export xml data into our database files. Since the xsd has changed it can be exported directly to another db to a third-party tool and I (among others) remove an attribute of an element
    CREATE TABLE xml_test(
          message XMLTYPE
          )
    /
    INSERT INTO xml_test
    VALUES (q'[<?xml version="1.0" encoding="ISO-8859-1"?>
    <ZusyMeldung xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns="http://www.zusy.de/2002/XMLSchema" 
    xsi:schemaLocation="http://www.zusy.de/2002/XMLSchema ZusyAZ01.xsd">
      <TransferHeader xsi:nil="true"/>
      <Daten>
        A lot more elements
      </Daten>
    </ZusyMeldung>]')
    /
    COMMIT;
    < TransferHeader xsi: Nil = 'true' / > should become < TransferHeader / >.

    I want to write files directly with the script next and tried to use updateXML in my SELECTION, but somehow I don't understand well.
    DECLARE
        CURSOR cur_out IS
            SELECT  message
            FROM    xml_test;
    BEGIN
        FOR r_out IN cur_out LOOP
            dbms_xslprocessor.clob2file (
                 r_out.message
                ,'DIR_XMLOUT'
                ,'out_name.xml'
                ,0
                );
        END LOOP;
    END;
    /
    Concerning
    Marcus

    Hi Marcus,

    Given that you want to remove, try deleteXML :

    select xmlserialize(document
             deletexml(
               message
             , '/ZusyMeldung/TransferHeader/@xsi:nil'
             , 'xmlns="http://www.zusy.de/2002/XMLSchema", xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
             )
           )
    from xml_test ;
    

    Note that the functions of XML DML Oracle (updateXML, deleteXML etc.) are not recommended in 11.2.0.3 for the update of XQuery:

    select xmlquery(
             'declare default element namespace "http://www.zusy.de/2002/XMLSchema"; (: :)
              copy $d := .
              modify ( delete node $d/ZusyMeldung/TransferHeader/@xsi:nil )
              return $d'
            passing message
            returning content
           )
    from xml_test ;
    

Maybe you are looking for