How to normalize/linearize whitspace in XML attributes?

Hello

I have data in a CLOB column I need to appeal to an XML attribute. The data may contain CR, LF and tabs - that the XML must be preserve way standardized/linearized (that is to say using & #10; & #13; etc.)

I tried using XMLROOT - it deletes the line a total break.

I tried to use XMLSERIALIZE - when finished with clause VERSION it also suppresses the newline, when without the VERSION, it keeps the jump line but not standardized.

Do not use these preserves the jump line - but not standardized.

Is there a bed in order to standardize XML - or should I use replace nested?

Examples below.

Thanks in advance.

SQL> set long 20000
SQL> set lines 1000
SQL> set pages 1000
SQL> select * from v$version


BANNER                                                                          
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production    
PL/SQL Release 11.2.0.3.0 - Production                                          
CORE 11.2.0.3.0 Production                                                      
TNS for Linux: Version 11.2.0.3.0 - Production                                  
NLSRTL Version 11.2.0.3.0 - Production                                          


5 rows selected.
SQL> -- as XMLTYPE, newline (chr(10)) is preserved, but not normalized
SQL> select XMLELEMENT("A",
        XMLATTRIBUTES(1 as ID, 2 ||chr(10)||3 as "TXT")
                 )
from dual


XMLELEMENT("A",XMLATTRIBUTES(1ASID,2||CHR(10)||3AS"TXT"))
---------------------------------------------------------
<A ID="1" TXT="2                                         
3"></A>                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
1 row selected.
SQL> -- as CLOB, newline (chr(10)) is preserved, but not normalized
SQL> select XMLELEMENT("A",
        XMLATTRIBUTES(1 as ID, 2 ||chr(10)||3 as "TXT")
                 ).getclobval()
from dual


XMLELEMENT("A",XMLATTRIBUTES(1ASID,2||CHR(10)||3AS"TXT")).GETCLOBVAL()
----------------------------------------------------------------------
<A ID="1" TXT="2                                                      
3"></A>                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
1 row selected.
SQL> -- with XMLROOT - newline is removed
SQL> select XMLROOT(
        XMLELEMENT("A",
         XMLATTRIBUTES(1 as ID, 2 ||chr(10)||3 as "TXT")
                  ),
               VERSION '1.0')
from dual


XMLROOT(XMLELEMENT("A",XMLATTRIBUTES(1ASID,2||CHR(10)||3AS"TXT")),VERSION'1.0')
-------------------------------------------------------------------------------
<?xml version="1.0"?>                                                          
<A ID="1" TXT="2 3"/>                                                          
                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
1 row selected.
SQL> --with XMLSERIALIZE without VERSION clause - newline is preserved but not normalized
SQL> select XMLSERIALIZE(DOCUMENT
        XMLELEMENT("A",
         XMLATTRIBUTES(1 as ID, 2 ||chr(10)||3 as "TXT")
                  )
                   )
from dual


XMLSERIALIZE(DOCUMENTXMLELEMENT("A",XMLATTRIBUTES(1ASID,2||CHR(10)||3AS"TXT")))
-------------------------------------------------------------------------------
<A ID="1" TXT="2                                                               
3"></A>                                                                        
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
1 row selected.
SQL> --with XMLSERIALIZE with VERSION clause - newline is removed
SQL> select XMLSERIALIZE(DOCUMENT
        XMLELEMENT("A",
         XMLATTRIBUTES(1 as ID, 2 ||chr(10)||3 as "TXT")
                  )
                   VERSION '1.0')
from dual


XMLSERIALIZE(DOCUMENTXMLELEMENT("A",XMLATTRIBUTES(1ASID,2||CHR(10)||3AS"TXT"))VERSION'1.0')
-------------------------------------------------------------------------------------------
<A ID="1" TXT="2 3"/>                                                                      
1 row selected.
SQL> --doing replace works, but seems "un-natural" and very inefficient
SQL> select replace(
        XMLELEMENT("A",
         XMLATTRIBUTES(1 as ID, 2 ||chr(10)||3 as "TXT")
                  ),
        chr(10),'&#10;')
from dual


REPLACE(XMLELEMENT("A",XMLATTRIBUTES(1ASID,2||CHR(10)||3AS"TXT")),CHR(10),'&#10;')                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<A ID="1" TXT="2&#10;3"></A>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
1 row selected.

Question still pending, if anyone has another way - or knows for sure replace is the only option.

Replaces nesting calls is probably the only option, of course, but not the way you have tried in your examples.

Do replace it at an earlier stage, directly on the data source.

Here's how I'd do:

SQL> set define off
SQL>
SQL>
SQL> select xmlserialize(document
  2           xmlelement("A",
  3             xmlattributes(noentityescaping
  4               1 as id
  5             , replace(
  6                 dbms_xmlgen.convert('X'||chr(10)||'Y')
  7               , chr(10)
  8               , '
'
  9               ) as txt
 10             )
 11           )
 12           no indent
 13         )
 14  from dual ;

XMLSERIALIZE(DOCUMENTXMLELEMEN
--------------------------------------------------------------------------------

1. use DBMS_XMLGEN. CONVERT to handle reserved characters.

2-using REPLACE to manage a specific entity escape

Option NOENTITYESCAPING 3 - use to keep the entity references comes to be presented

Tags: Database

Similar Questions

  • How to handle xml attributes?

    Hallo,

    I am new to Livecycle and I have some difficulties to understand how reading/identification of the attributes XML in LiveCycle Designer.

    If I drag-and - drop items (#data of display data), they appear without problems. But if I drag an attribute (@attributename) they always show the empty to the PDF.

    For example, I have an XML file that looks like this:

    < product >

    ....

    < price >

    < ParamPrice visible = "true" >

    < prixUn visible = "false" > 1.350,00 < / prixUn >

    < priceB visible = "true" > 1.350,00 < / priceB >

    < price visible = "true" > 20.00 < / price >

    < price visible = "false" > 0,00 < / price >

    < / if >

    < NouveauPrix visible = "true" >

    < prixUn visible = "false" > 1.350,00 < / prixUn >

    < priceB visible = "true" > 1.350,00 < / priceB >

    < price visible = "true" > 20.00 < / price >

    < price visible = "false" > 0,00 < / price >

    < / sonderpreise >

    < / price >

    ...

    < / product >

    I tried to link like this: price.oldprice. (visible.value == "true") .priceA, but it does not work.

    I can´t really find some good information about the manipulation of XML attribute in LiveCycle. Can you please help me or tell me where to find more information on this topic.

    Thank you!!!

    What about Kat

    It is not the relationship between the presence of the object property and your visible attribute to date.

    But you can use a script to create such a thing.

    Put this in the event layout: ready for a text field, you want to be hidden or shown depending on the value of the visible attributes.

    this.presence = this.dataNode.visible.value === "true" ? "visible" : "hidden";
    
  • 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 read the value of the attribute XML using DBMS_XMLSTORE

    the following xml data

    + < ROWSET > +.
    + < ROW > +.
    + < > 2290 EMPNO < / EMPNO > +.
    + < SAL > 2000 < / SAL > +.
    + 31 December 1992 of < HIREDATE > < / HIREDATE > +.
    + < TYPE > +.
    + < ENO > 123456 < / ENO > +.
    + attr_name < ENAME > < / ENAME > +.
    + < / TYPE > +.
    + < / ROW > +.
    + < / LINES > +.

    The above XML data stored underneath table of the object using DBMS_XMLSTORE

    CREATE or REPLACE TYPE typ_dummy AS OBJECT
    (
    ENO NUMBER,
    Ename VARCHAR2 (100)
    );

    CREATE TABLE EMP
    (
    EmpNo VARCHAR2 (25).
    SAL NUMBER,
    HireDate DATE,
    Typ typ_dummy
    );


    DECLARE
    insCtx DBMS_XMLStore.ctxType;
    lines NUMBER;
    xmlDoc CLOB: =.
    ' < ROWSET >
    < LINE number = "1" >
    < SAL > 1800 < / SAL >
    < > 7369 EMPNO < / EMPNO >
    < HIREDATE > 27 August 1996 < / HIREDATE >
    < / ROW >
    < ROW >
    < > 2290 EMPNO < / EMPNO >
    < SAL > 2000 < / SAL >
    < HIREDATE > 31 December 1992 < / HIREDATE >
    < TYPE ENO = ENAME "123456" = "attr_name" / >
    < TYPE >
    < ENO > 123456 < / ENO >
    attr_name < ENAME > < / ENAME >
    < / TYPE >
    < / ROW >
    < / LINES > ';
    BEGIN
    insCtx: = DBMS_XMLStore.newContext ('emp'); -be saved context
    lines: = DBMS_XMLStore.insertXML (insCtx, xmlDoc);
    DBMS_XMLStore.closeContext (insCtx);
    END;



    but I don't know if the XML contains the attribute values for particular node means how to insert in the table (assuming the creation of the structure of the table)


    + < ROWSET > +.
    + < ROW > +.
    + < > 2290 EMPNO < / EMPNO > +.
    + < SAL > 2000 < / SAL > +.
    + 31 December 1992 of < HIREDATE > < / HIREDATE > +.
    * + < TYP ENO = ENAME "123456" = "attr_name" / > + *.
    + < / TYPE > +.
    + < / ROW > +.
    + < / LINES > +.

    You can declare the type of object like this:

    CREATE OR REPLACE TYPE typ_dummy AS OBJECT (
      "@ENO"   NUMBER
    , "@ENAME" VARCHAR2(100)
    );
    /
    

    Oracle will know that XML attributes must be mapped to attributes of the object.

    But personally, I would not use DBMS_XMLSTORE:

    INSERT INTO emp (empno, sal, hiredate, typ, eno, ename)
    SELECT empno, sal, hiredate, eno, ename
    FROM XMLTable('/ROWSET/ROW'
           passing xmltype(xmlDoc)
           columns empno    varchar2(25)  path 'EMPNO'
                 , sal      number        path 'SAL'
                 , hiredate date          path 'HIREDATE'
                 , eno      number        path 'TYP/@ENO'
                 , ename    varchar2(100) path 'TYP/@ENAME'
         )
    ;
    
  • Set XML attributes to multiply items

    Hello world

    This is my situation. I have a document with multiple pages and multiple objects on each page.

    now, I want to get the coordinates and dimensions of an object and write the data as an XML attribute.

    The script should do this for each object in my document.

    That's what I got so far:

    function creatAtt() {}

    for (var i = 0; i < app.selection.length; i ++) {}

    var myObject = app.selection [i];

    var myXMLobject = myObject.associatedXMLElement;

    var ycoords = myObject.geometricBounds [0];

    var xcoords = myObject.geometricBounds [1];

    var width = myObject.geometricBounds [3] - myObject.geometricBounds [1];

    var height = myObject.geometricBounds [2] - myObject.geometricBounds [0];

    myXMLobject.xmlAttributes.add ("Y-coordinate", ycoords.toString () + "px");

    myXMLobject.xmlAttributes.add ("X-coordinate", xcoords.toString () + "px");

    myXMLobject.xmlAttributes.add ("Width", width.toString () + "px");

    myXMLobject.xmlAttributes.add ('Height', height.toString () + "px");

    }

    }

    creatAtt();

    When I select an object and run the script he writes only the data for the selected object, not for all objects. Someone a tip how to fix?

    Hi Sebbomatico,

    Now, I remove the attributes at the beginning and after I generated. Please check this code and the snapshot.

    var myDoc= app.activeDocument;
    var myPages = myDoc.pages;
    for (var i = 0; i < myPages.length; i++){
        var myActualPage = myPages[i].pageItems;
        for (var j = 0; j < myActualPage.length; j++){
           var myObject= myActualPage[j];
           var myXMLobject = myObject.associatedXMLElement;
           var ycoords= myObject.geometricBounds[0];
           var xcoords= myObject.geometricBounds[1];
           var width = myObject.geometricBounds[3] - myObject.geometricBounds[1];
           var height = myObject.geometricBounds[2] - myObject.geometricBounds[0];
           try{myXMLobject.xmlAttributes.everyItem().remove();}catch(e){};
           myXMLobject.xmlAttributes.add ("Y-Koordinate", ycoords.toString() + " px");
           myXMLobject.xmlAttributes.add ("X-Koordinate", xcoords.toString() + " px");
           myXMLobject.xmlAttributes.add ("Width", width.toString() + " px");
           myXMLobject.xmlAttributes.add ("Height", height.toString() + " px");
           }
        }
    

  • 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
    
  • How to display a value of transitional attribute to column db entity column?

    Mr President

    Help me at the time 12.2.1 jdev.

    How to display a value of transitional attribute to column db entity column?

    I have the requirement to indicate a value of transitional attribute column in the column db entity for some reason any.

    Any body can help as my show in the picture below

    The StAmt is a transitional column and a column db of the entity.

    tworows.png

    Any body can help please. !

    Concerning

    This means that the amount to be the attribute will always has the same value of the transient attribute? If so, why do you want the amount attribute the transient attribute is sufficient?

    Anyway, if you want to get attribute data in attribute transitional amounts you can open class ViewRowImpl and appearing in the getter or amount, you can get the value in the transitional as attribute:

      public Number getAmount()
      {
        return getTransientAttribute();
        //return (Number) getAttributeInternal(AMOUNT);
      }
    

    in this case, the quantity data store database will not appear on the table it will still get the transitional attribute data and it's meaningless.

  • How we can filter the members of attributes using MDX ASO

    How can we filter the members of attributes using MDX ASO?

    SELECT {Descendants ([1_Account], LEVELS([1_Account],0))}

    ON COLUMNS,

    {Filter (different 1_Cost [Online], 1_Cost [Online]. CurrentMember = [1_AllocAccountR]. [85151010])} on the LINES

    OF Alloc1R.Alloc1R

    WHERE ([DC], [GenealogyAllocation], [Bill], [FY14],

    2_Cost [Online]. [Impact], [3_Cost online]. [Impact], [4_Cost online]. [Impact], [5_Cost Center_intra]. [Impact], [2_Project]. [Impact], [1_Project]. [Impact]

    )

    The code marked in yellow, is suppose to filter and to provide an output only the cost that has 85151010 attribute tag - Center but it generates all cost centers


    Thank you

    Vishal

    How about using attribute or WithAttr

    Concerning

    Celvin Kattookaran

  • ESD context-setting shaped based on XML attributes

    Hi all

    I have some difficulty to get my EDD to format correctly based on the XML attributes. Basically, what I would like is:

    I have a few XML:

    < root >

    < elem > example text sample text sample text sample text. < / elem >

    < elem multi = "true" > example text example text example text sample text. < / elem >

    < / root >

    For items with the multi = 'true' attribute, I want to be prefixed by a ball and with a left indent of 0.14"in order to align the text with the ball.

    • Example text sample text

    example text sample text.

    Those without the attribute are simply formatted according to the paragraph format (no prefix, 0.0 left indent ")

    Example text sample text

    example text sample text.

    My EDD looks like this:

    (Container) element: elem

    General rule: < ANY >

    List of attributes

    Name: multi String

    Rules of prefix

    If the context is: [multi = 'true']

    Prefix: •

    Text format rules

    Paragraph element format: element

    If the context is: [multi = 'true']

    Basic properties

    Dashes

    Withdrawal left: 0.14 "

    After importing my XML, the prefix part works perfectly. No problem.

    However, the left based on the context does not work at all - all items inherit only the removal of paragraph (0.0 "). So it ends up looking like this:

    • Example text sample text

    example text sample text.

    I can't understand this. No formatting in ESD does not replace the formats specified paragraph or something?

    Any help would be greatly appreciated.

    Thank you
    Carl

    Please do not take into account the incomplete answer, it seems to me having posted. What I started to say is:

    Carl,

    Format of the item rules override formatting that it inherits from its parent, as well as modalities parentElement must not interfere with those that you specify for prim.

    I don't see the problem, and without actually opening the file in FM, it is difficult for me to guess what might be wrong.  A number of things that I do are:

    (1) set another property in the rule, for example, to set the font size to 70pt and changes the left indent. A change in font size will confirm that the rule was actually fired.

    (2) inspect the left indent in paragraph Designer. Maybe you have set it to 0.14pt instead of 0.14 to?

    -Lynne

  • XML attribute change

    I need to replace the 'M05_LEMO9433_06_SE_CH05' to M05_LEMO5401_06_SE_CH05 xml attribute value

    In the document with more than thousand entries

    I used the following code but it does not work

    function AddReturns() {}

    myIdName = "AddReturns";

    This.XPath = "//p//span//a";

    This.Apply = function (myElement, myRuleProcessor) {}

    with (MyElement)

    {

    try {}

    If (myElement.xmlAttributes.item("href").value.match ("LEMO9433"))

    {

    Fig var = myElement.xmlAttributes.itemByName("href").value;

    var fig.replace = figv ("9433', 'O5401')

    myElement.xmlAttributes.itemByName("href").value = figv;

    }

    myElement.xmlAttributes.item("id").name = "olinkend";

    } catch (e) {}

    }

    Returns true;

    }

    }

    Try this:

    var main  = function() {
      var root,
      xes,
      n,
      ov = "M05_LEMO9433_06_SE_CH05",
      nv = "M05_LEMO5401_06_SE_CH05";
      if ( !app.documents.length ) return;
    
      root = app.activeDocument.xmlElements[0];
    
      xes = root.evaluateXPathExpression ("//*[@*='"+ov+"']" );
      n = xes.length;
    
      while ( n-- ) {
      changeAttributeValue ( xes[n], ov, nv );
      }
    }
    
    var changeAttributeValue  = function ( xe, oldValue, newValue ) {
      var xas = xe.xmlAttributes,
      xa,
      n = xas.length;
    
      while ( n-- ) {
      xa = xas[n];
      xa.value == oldValue && xa.value = newValue;
      }
    }
    
    main();
    
  • How to insert data in the XML file?

    Hi guys,.

    How to insert information into an XML file. I tell you, I have a CFM file with some questions to the user

    When users submit this form within the form information is send in an XML file.

    How can insert this information in the XML file?

    When I don't have a DB?

    Thank you

    Kind regards

    Fabiano Magno Pechibella

    You must

    1. Read in the XML file
    2. Analyze the document in an XML (just one big struct) object
    3. Insert your XML code of the object where you need
    4. rewrite the XML file with your data now included

    You can Google 'ColdFusion working with XML' and find hundreds of items to help you. Here's a beginning tutorial to help you get started:

    Intermediate ColdFusion Tutorials - working with XML

  • Can someone please tell me the "see correct / more effective to get the 'status' XML ' attributes

    Can someone please tell me the "see correct / more effective to get the 'status' XML ' attributes (ID, CssClass, Description and IsActive to the XML code below):

    Implementation will be the standalone .swf file

    (XML)

    <ArrayOfLineStatus>
    <LineStatus ID="0" StatusDetails="">
        <BranchDisruptions/><Line ID="1" Name="Bakerloo"/>
        <Status ID="GS" CssClass="GoodService" Description="Good Service" IsActive="true">         
             <StatusType ID="1" Description="Line"/></Status></LineStatus>
    </ArrayOfLineStatus>

    < ArrayOfLineStatus >

    < LineStatus ID = "0" StatusDetails = "" >

    < BranchDisruptions / >

    < line ID = "1" Name = "Bakerloo" / >

    < State ID = 'GS' CssClass = "GoodService" Description = "Good Service" IsActive = "true" >

    < StatusType ID = '1' Description = 'Line' / > < / status >

    < / LineStatus >

    < / ArrayOfLineStatus >

    There is no good way with as2:

    trace(this.firstChild.childNodes[1].childNodes[4].) Attributes ['ID']);

    trace(this.firstChild.childNodes[1].childNodes[4].) Attributes ['CssClass']);

    etc.

  • How can I get the original xml code to a webservice called...

    I use WL 10.3.

    I created a WebService using WSDL as a starting point. The Web service is running as it should, but now I want to go back to the original XML that was passed in.

    I tried to collect the data to a string using JAXB, but he complains that there is no notation for @XmlRootElement - so, who does not work.

    I also tried to access the original data by injecting the WebServiceContext, but this value is always zero (not sure why that doesn't work)...


    Is someone can you PLEASE tell me how can I get the original XML code?

    You can use managers to this end, for example,

    package server.handlers;
    
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerException;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.stream.StreamResult;
    import javax.xml.ws.LogicalMessage;
    import javax.xml.ws.handler.LogicalHandler;
    import javax.xml.ws.handler.LogicalMessageContext;
    import javax.xml.ws.handler.MessageContext;
    
    public class ServiceLogicalHandler implements LogicalHandler {
    
        public boolean handleMessage(LogicalMessageContext context) {
            Boolean direction = (Boolean) context.get(LogicalMessageContext.MESSAGE_OUTBOUND_PROPERTY);
            if (direction) {
                System.out.println("LOGICAL - DIRECTION IS OUTBOUND");
            } else {
                System.out.println("LOGICAL - DIRECTION IS INBOUND");
            }
            return true;
        }
    
        public boolean handleFault(LogicalMessageContext context) {
            Boolean direction = (Boolean) context.get(LogicalMessageContext.MESSAGE_OUTBOUND_PROPERTY);
            if (direction) {
                System.out.println("LOGICALFAULT - DIRECTION IS OUTBOUND");
    
                LogicalMessage message = context.getMessage();
                Source payload = message.getPayload();
                try {
                    Transformer transformer = TransformerFactory.newInstance().newTransformer();
                    transformer.transform(payload, new StreamResult(System.out));
                } catch (TransformerException ex) {
                    ex.printStackTrace();
                }
            } else {
                System.out.println("LOGICALFAULT - DIRECTION IS INBOUND");
            }
            return true;
        }
    
        public void close(MessageContext context) {
        }
    }
    

    More information on managers can be found here: http://www.javaworld.com/javaworld/jw-02-2007/jw-02-handler.html

  • How to export a command Via XML

    How can we "Export command Via XML" using such STANDARD as mentioned in the Program Guide ATG Commerce classes?

    Use StartSQLRepository to export.

    Peace
    Shaik

  • Enforcement of XML attribute with a structure?

    I use xmlParse() to read an XML file into a structure and then deal with the structure (replace some of the XML attributes) and then write structure back as an XML file. The problem is that I lost the original order of the XML attributes when I convert a structure and instead end up with a new attribute for each element that is alphabetical order.

    In other: c = 'text' d = 'text' element has = "text" / >

    be rewritten in the form: element = 'text' c = 'text' d = "text" / >

    which is a problem for this application.

    Is it possible to work with XML in CF but keep ordering attribute (LinkedHashMap instead of a structure, perhaps)?

    Thank you.

    Walter

    If you need to control the order of the attributes, you must write your xml code on hand, according to the XML specification, ordering attribute must not be important, so strictly speaking your condition here requires something XML which is contrary to his intention.  And, therefore, has no way of making CF respect something that inherently isn't supposed to be respected.

    NB: "I use xmlParse() to read an XML file in a structure"... xmlParse() creates an XML object, not a struct, so what you ask in your last paragraph doesn't really sense.  xmlParse() will only create an XML object. If you want to read the XML data as something else than XML, you need to write your own function.

    The best solution here, if poss, is to remove the importance of the order attribute in your application, because it is "wrong" to deduct any order, and you do a little logic a rod for your own back based on this ranking.

    Not an answer 'just do it like this', I'm sorry, but that's what you get when the question is immersed in a Pandora's box... ;-)

    --
    Adam

Maybe you are looking for

  • Split x 2: bios password

    I forgot my bios password on hp split x 2 disabled system: 50429952

  • Several questions on Portege M100

    Hello Forgive me in advance if this sounds a bit sketchy but my husband's is the only useful with these things, but his time is limited with work, I thought I'd try and help in advance for when he comes home. I bought a M100 to take with us on our va

  • Re: Satellite L875D-S7332: lack of bluetooth

    Hi people, I'm really surprised that a new laptop would have occurred without bluetooth capability, but well sure, I took delivery of my new machine and cannot use one of my devices with it. Before investing in a dongle, can someone make sure that it

  • Windows XP can be used on a Satellite A210 (PSAEG)?

    Please if you know where can I find the drivers for my laptop for windows XP? And maybe you can tell me if those for the A200 will work? Thank you very much.

  • indicator of serial port

    I have the output of the serial port connected to an indicator, and it is set to display in hexadecimal. (The output string is converted to an array of uint8 first.) I want the indicator to maintain the value of the last number he received from the s