How to parse the following xml file

Hi
I have an xml file with the following data
Example.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<html><set label="09/07/29" value="1241.90"/>
</html>
How do i retrive the values of the attributes
Example i want the label value 09/07/29
and 1241.90 to be inserted into some temp table.
Appreciate if any one can provide me the solution.
Thanks,

it's more an XQuery question than DB XML one.
Anyway, you can use the following queries to get attributes values:
doc(<your_doc>)/html/set/@label
doc(<your_doc>)/html/set/@valueYou can retrieve both values in a single query, but for this please refer to the XQuery specification.
Or read: [http://www.oracle.com/technology/documentation/berkeley-db/xml/gsg_xml/java/xquery.html#xqueryintro]
Best,
Vyacheslav

Similar Messages

  • How to deploy the web.xml file when trying to use the JSP SDK from SAP?

    I want to use the adduser.jsp which downloaded form SAP SDK samples to add user in BO, but I cannot run it sucessfully. I believe it's caused the web.xml file was not deployed appropriately.
    could you please teach how to deploy the web.xml file for the JSP samples ?
    Could you show me some sample of web.xml for the SDK jsp files? Thank you very much!

    Ensure that you have followed below directory structure while deploying your web application.
       web_application_name
          WEB-INF
             lib
             classes
    web.xml must be placed in WEB-INF. Ensure that you have included all the jar files and other necessary files in your application.
    For more information refer to the below link:
    http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/devsuite.htm
    Regards,
    Anuj

  • How to parse contents from XML file in Java

    Hi All,
    I have a scenario like this . I have one xml file with key value pairs of ( name , URL ) . I have retrieved contents from XML file , now I want to parse these contents and store in a bean object.
    How to parse Contents of XML file??
    Thanks in advance,
    Rajendra.

    Hi All,
    I have a scenario like this . I have one xml file with key value pairs of ( name , URL ) . I have retrieved contents from XML file , now I want to parse these contents and store in a bean object.
    How to parse Contents of XML file??
    Thanks in advance,
    Rajendra.

  • How to config the web.xml file, when I use Richfaces + RI 1.2?

    Hi there:
    I want to use Richfaces + RI 1.2 to build a project. I don`t know how to config the web.xml file.
    By the way, my web server is Tomcat 6.0, my JDK's version is 6u6. I don`t want to use the facelets.
    thanks.
    lxm

    just add this before *</web-app>*
    <context-param>
           <param-name>org.richfaces.SKIN</param-name>
           <param-value>blueSky</param-value>
      </context-param>
      <filter>
           <display-name>RichFaces Filter</display-name>
           <filter-name>richfaces</filter-name>
           <filter-class>org.ajax4jsf.Filter</filter-class>
      </filter>
      <filter-mapping>
           <filter-name>richfaces</filter-name>
           <servlet-name>Faces Servlet</servlet-name>
           <dispatcher>REQUEST</dispatcher>
           <dispatcher>FORWARD</dispatcher>
           <dispatcher>INCLUDE</dispatcher>
      </filter-mapping>

  • How to generate the following XML-Output?

    Hi all,
    I would like to generate the following XML-Output without defining any types or tables:
    <?xml version = '1.0'?>
    <DEPARTMENTS_EMPLOYEES>
    <DEPARTMENT NAME="ACCOUNTING">
    <DEPTNO>10</DEPTNO>
    <LOC>NEW YORK</LOC>
    <EMPLOYEES_OF_DEPARTMENT>
    <EMPNO>...</EMPNO>
    <ENAME>...</ENAME>
    </EMPLOYEES_OF_DEPARTMENT>
    </DEPARTMENT>
    <DEPARTMENT NAME="RESEARCH">
    <DEPTNO>20</DEPTNO>
    <LOC>DALLAS</LOC>
    <EMPLOYEES_OF_DEPARTMENT>
    </EMPLOYEES_OF_DEPARTMENT>
    </DEPARTMENT>
    </DEPARTMENTS_EMPLOYEES>
    Unfortunately the following SQL-Statement does not working:
    select xmlElement("DEPARTMENTS_EMPLOYEES",
    xmlAttributes(d.deptno as "DEPTNO"),
    xmlElement("DNAME", d.dname),
    xmlElement("LOC", d.loc),
    xmlElement("EMPLOYEES_OF_DEPARTMENT",
    (select xmlAgg(xmlElement("EMPLOYEE", xmlAttributes(e.empno as "EMPNO"), xmlForest(e.ename as "ENAME", e.job as "JOB", e.hiredate as "HIREDATE", e.sal as "SAL", e.comm as "COMM", m.empno as "MGRNO", m.ename as "MGRNAME" ) )
    from emp e, emp m
    where e.deptno = d.deptno
    and m.empno = e.mgr
    ) as XML
    from dept d;
    1. When I provide this statement with SQL*Plus
    (unfortunately 9.0.1.3.0) then I get the
    following output:
    XML()
    XMLTYPE()
    XMLTYPE()
    XMLTYPE()
    XMLTYPE()
    2. When I provide this statement with SQL Navigator
    4.3.0.456 then I get the following error:
    [1]: (Error): OCI-21560: argument 3 is null, invalid,
    or out of range
    3. When I execute the following PL/SQL-Code then I get
    the XML-Error message:
    DECLARE
    x CLOB;
    xmlstr VARCHAR2(32767);
    line VARCHAR2(2000);
    BEGIN
    x := dbms_xmlquery.getxml('select xmlElement("DEPARTMENT",
    xmlAttributes(d.deptno as "DEPTNO"),
    xmlElement("DNAME", d.dname),
    xmlElement("LOC", d.loc),
    xmlElement("EMPLOYEELIST",
    (select xmlAgg(xmlElement("EMPLOYEE",
    xmlAttributes(e.empno as "EMPNO"),
    xmlForest(e.ename as "ENAME",
    e.job as "JOB",
    e.hiredate as "HIREDATE",
    e.sal as "SAL",
    e.comm as "COMM",
    m.empno as "MGRNO",
    m.ename as "MGRNAME"
    from emp e, emp m
    where e.deptno = d.deptno
    and m.empno = e.mgr
    ) as XML
    from dept d');
    xmlstr := dbms_lob.SUBSTR(x,32767);
    LOOP
    EXIT WHEN xmlstr IS NULL;
    line := SUBSTR(xmlstr,1,INSTR(xmlstr,CHR(10))-1);
    DBMS_OUTPUT.PUT_LINE(line);
    xmlstr := SUBSTR(xmlstr,INSTR(xmlstr,CHR(10))+1);
    END LOOP;
    END;
    <?xml version = '1.0'?>
    <ERROR>oracle.xml.sql.OracleXMLSQLException: Unimplemented Feature</ERROR>
    4. When I provide the following PL/SQL-Code then I get the same xml-error:
    DECLARE
    x CLOB;
    xmlstr VARCHAR2(32767);
    line VARCHAR2(2000);
    BEGIN
    x := dbms_xmlquery.getxml('select xmlElement("SYSDATE", xmlElement("Datum", to_char(sysdate,''DD.MM.YYYY'')),
    xmlElement("Zeit", to_char(sysdate,''HH24:MI:SS''))) as XML
    from dual');
    xmlstr := dbms_lob.SUBSTR(x,32767);
    LOOP
    EXIT WHEN xmlstr IS NULL;
    line := SUBSTR(xmlstr,1,INSTR(xmlstr,CHR(10))-1);
    DBMS_OUTPUT.PUT_LINE(line);
    xmlstr := SUBSTR(xmlstr,INSTR(xmlstr,CHR(10))+1);
    END LOOP;
    END;
    <?xml version = '1.0'?>
    <ERROR>oracle.xml.sql.OracleXMLSQLException: Unimplemented Feature</ERROR>
    Can I generate the needed XML-Output from Database with SQL or PL/SQL?
    Can anybody help me?
    Regards
    Leonid Pavlov

    I have this done with:
    DECLARE
    qryCtx DBMS_XMLGEN.ctxHandle;
    result CLOB;
    xmlstr VARCHAR2(32767);
    line VARCHAR2(2000);
    BEGIN
    qryCtx := dbms_xmlquery.newContext('select deptno, dname, loc, cursor(select e.empno, e.ename, e.job,
    to_char(e.hiredate,''DD.MM.YYYY'') hiredate, e.sal, e.comm,
    m.empno MGRNO, m.ename MGRNAME
    from emp e, emp m
    where e.deptno = dept.deptno
    and m.empno(+) = e.mgr) emp
    from dept');
    dbms_xmlquery.useNullAttributeIndicator(qryCtx, FALSE);
    dbms_xmlquery.setRowsetTag(qryCtx, 'DEPARTMENTS_EMPLOYEES');
    dbms_xmlquery.setrowtag(qryCtx, 'DEPARTMENT');
    DBMS_XMLQuery.setRowIdAttrName(qryCtx, 'ID');
    DBMS_XMLQuery.setRowIdAttrValue(qryCtx, 'DEPTNO');
    -- dbms_xmlquery.setrowidattrname(qryCtx, NULL);
    result := dbms_xmlquery.getXML(qryCtx);
    DBMS_XMLQuery.closeContext(qryCtx);
    xmlstr := dbms_lob.SUBSTR(result,32767);
    LOOP
    EXIT WHEN xmlstr IS NULL;
    line := SUBSTR(xmlstr,1,INSTR(xmlstr,CHR(10))-1);
    DBMS_OUTPUT.PUT_LINE(line);
    xmlstr := SUBSTR(xmlstr,INSTR(xmlstr,CHR(10))+1);
    END LOOP;
    END;
    But how can I rename the <EMP>-Element to Employees?

  • How to edit the web.xml file

    hi friends,
    i have been working with netbeans for webapplications so far therefore its not ever been requerd to edit the web.xml file that automatically done by IDE itself.
    now, i am just trying to deploy the servlet and jsp's externally without using any tool and i found a requrement to map the servlet and jsp in web.xml file. when i try to edit inside this file it seems noneditable, nothing gonna change. i have an alternate to do this is firstly copy the content of this file into txt file and after making the requred changes overwrite this file in .xml formate to orignal web.xml file.
    am i going in right way?? please help me
    regards
    san

    open it in a text editor and modify it.
    %

  • How can (parse) i use XML file with missing EndTag

    hi,
    i have an application which writes an "XML file".
    another application should read that XML file, build an DOM and
    access the nodes with xpath.
    my problem. if the first application is not finished there are tags
    missing. e.g. </xml>. but the seconds application cannot wait until the first application finishes it task.
    if i now read the XML file the parser cannot load it because the end tags are missing.
    my question:
    how can i deactivate the check or how can i read the XML file and access it via XPath (my application is using at the moment XPath to access the nodes and i dont want to change that)
    as parser i am using XERCES
    alex

    As far as I know, you can't do this - xml must be well formed (this is sort of a bedrock of xml). There may be some work around's, but I'm not aware of any - and they would most likely be hacks.

  • How to do the following XML/XSLT operation in a Java Oracle function?

    I'd like to write a Java method with the following signature...
    public static oracle.xdb.XMLType bwdtransform(java.lang.String suname, oracle.sql.CLOB documentText)
    The documentText is simply a CLOB that contains the XML. It needs to have two XSLT stylesheets applied to it, then made into an XMLType and returned.
    Another requirement is that the stylesheets have to have the Java XPath extensibility, which is available using the namespace "xmlns:java.lang.String="http://www.oracle.com/XSL/Transform/java/java.lang.String".
    I've tried a couple of different ways using oracle.xdb.XMLType.transform() and the classes in the oracle package oracle.xml.parser.v2.*, which is what the listing I pasted in below is based on, but I haven't been able to get anything to work. I THINK the XMLType.transform failed because I was using the Java XPath extensions.
    I'd appreciate it if there's a standard Oracle recommended way to do this operation, preferably as optimized as possible.
    Here btw is the current code I'm using which isn't working. Any variables that you see that aren't initialized in the function are static to the class and initialized in a static {} block including the stylesheets which are instances of XSLStylesheet.
    public static XMLType bwdtransform(java.lang.String suname, oracle.sql.CLOB documentText) throws Exception {
    parser.parse(new ByteArrayInputStream(clobToString(documentText).getBytes()));
    XMLDocument documentTextXMLDocument = parser.getDocument();
    XMLDocumentFragment docFrag = processor.processXSL(twiddlerXSLStylesheet, processor.processXSL(adopterXSLStylesheet, documentTextXMLDocument));
    Document intermediateDoc = docFrag.getOwnerDocument();
    XMLType x = new XMLType(conn, intermediateDoc);
    return x;
    I haven't been able to find any way to make this work and any any help in that direction would be oh so greatly appreciated.
    For completeness, here's the version of Oracle I'm running, according to sqlplus...
    SQL*Plus: Release 11.1.0.7.0 - Production on Thu Apr 30 20:24:53 2009
    Thanks!
    Ralph

    The XMLDB way of doing this like this would be something like the following examples:
    SELECT XMLtransform(x.xmlcol,
              DBURIType('/XDB/STYLESHEET_TAB/ROW[ID=1]
                               /STYLESHEET/text()').getXML()).getStringVal()
           AS result
    FROM  po_tab x; or
    SELECT XMLtransform(x.xmlcol,
                (SELECT stylesheet FROM stylesheet_tab WHERE id=1)).getStringVal()
              AS result
    FROM  po_tab x; or use DBMS_XSLPROCESSOR...

  • How to find the right XML files

    Hi all
    I need to customize OBIEE according to the custommers needs,Is there any tool to find the xml source files where I can make the changes.
    Currently I'm using 'psoug' to edit the page source code , for example I want to modify those values:
    <tbody>
    <tr>
    <td class="XUISectionHeadingTitle">Columns</td>
    </tr>
    <tr>
    <td class="XUISectionHeadingText">
    Click on column names in the selection pane to add them to the request. Once added, drag-and-drop columns to reorder them. Edit a column's format, formula and filters by clicking the buttons below its name.
    and I don't find the xml file to update it.
    Anyone knows how I can find it?

    *(BIInstallDir)\OracleBI\web\msgdb\l_en\messages*
    Under this path you can find the list of XML files....
    These XMLs are named to indicate what type of info it contain..

  • How to parse the result xml string in BPEL

    Hi,
    This is Ishmayel.v new to BPEL and hava experience in xml parsing, java and webservices.
    Now I am getting the XML file as a result string in BEPL.
    now I want to parse the XML string and insert into the database... If any one has the idea let me know.
    my email id is [email protected]
    Thanks in Advance,
    Regards,
    Ishmayel.

    Your question is not clear.
    You have a client applicaton which invokes a BPEL process and receives XML response from BPEL. Then you want to parse this response XML in your client application?
    Or you are running a BPEL process which invokes a service and receives an XML response. Then you want to parse this XML response in BPEL before your process can proceed?
    I have to assume that you are working with a string and then you want to convert the string into XML, and then parse the XML. If this is the case, then take a look at the ora:parseEscapedXML(contentString) function. You can use this in the expression editor in JDev.

  • How to Convert the following XML? using XSLT Mapper?

    Hey all,
    I have a simple looking but complex problem
    I have a XML file like this
    <userdata>
    <city> new york</city>
    <address>San Fransico </address>
    </userdata>
    My result XML should look like this
    <UserDetails>
    <Details>
    <id>1234</id>
    <place>new york</place>
    </Details>
    <Details>
    <id>42345</id>
    <place>San Fransico </place>
    </Details>
    </UserDetails>
    I tried things but they never worked.
    Any help regarding this will be of great helpppppppppppppppppppppppppp!!
    Thanks in advance
    -Murthy.

    You can use XSLT. Between, where do you want to get the ID values of the place tag in result xml.
    --Shiv                                                                                                                                                                                                                       

  • How to access the following xml data in Flex

    <users>
    <user dept id="HR">
         <user>
              <fname>mm</fname>
              <email>[email protected]</email>
         </user>
         <user>
              <fname>sss</fname>
              <email>[email protected]</email>
         </user>
    </dept>
    <user dept id="Finance">
         <user>
              <fname>ffff</fname>
              <email>[email protected]</email>
         </user>
         <user>
              <fname>www</fname>
              <email>[email protected]</email>
         </user>
    </dept>
    </users>
    using HTTP service through access the data
    this my user.xml file i want to display all the item in flex datagrid using tab navigator function................ each tab navigator contain one data grid for corresponding Dept like HR, sales , Finance
    corresponding information will display in data grid
    first tab navigatore is
    HR ->  data grid field like fname , Email
    finance -> fname, E Mail

    great for quick reply
    my XML file is data.xml
    <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
    private var myUser:XML =
    <users>
    <dept id="hr">
        <user>
            <firstName>murali</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
        <user>
            <firstName>bharathi</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
        <user>
            <firstName>vasa</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
    </dept>
    <dept id = "finance">
        <user>
            <firstName>mohan</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
        <user>
            <firstName>vinoth</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
    </dept>
    <dept ="sales">
        <user>
            <firstName>manoj</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
        <user>
            <firstName>deepan</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
    </dept>
    </users>
    codings i used
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="absolute" creationComplete="htp.send()">
        <mx:HTTPService id="htp" url="data.xml"
            result="resulthandler(event)"
            fault="faulthandler(event)"/>
            <mx:Script>
                <![CDATA[
                    import mx.collections.ArrayCollection;
                    import mx.rpc.events.FaultEvent;
                    import mx.rpc.events.ResultEvent;
                    [Bindable] private var userlist:ArrayCollection;
                    private function resulthandler(event:ResultEvent):void
                        userlist=(htp.lastResult.user.dept.user);
                    private function faulthandler(event:FaultEvent):void
                ]]>
            </mx:Script>
            <mx:TabNavigator>
            <mx:Repeater id="rep" dataProvider="{data.dept}"> <!--data.xml is my fle name-->
                <mx:Canvas label="{rep.currentItem.@id}">
                    <mx:DataGrid dataProvider="{rep.currentItem.user}">
                        <mx:columns>
                            <mx:DataGridColumn headerText="Name" dataField="fname"/>
                            <mx:DataGridColumn headerText="E Mail" dataField="email"/>
                        </mx:columns>
                    </mx:DataGrid>
                </mx:Canvas>      
            </mx:Repeater>
    </mx:TabNavigator>
    </mx:Application>
    its not show anything

  • How to generate the following XML

    Hi all,
    I have 2 tables, demo_orders and demo_order_items (child)
    how can I generate something like this :
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
      <ORDER_ID>1</ORDER_ID>
      <CUSTOMER_ID>1</CUSTOMER_ID>
      <ORDER_TOTAL>1200</ORDER_TOTAL>
      <ORDER_TIMESTAMP>2009-01-16T16:20:09.000</ORDER_TIMESTAMP>
      <USER_ID>2</USER_ID>
      <ITEMS>
       <ITEMROW>
        <ORDER_ITEM_ID>1</ORDER_ITEM_ID>
        <ORDER_ID>1</ORDER_ID>
        <PRODUCT_ID>1</PRODUCT_ID>
        <UNIT_PRICE>1200</UNIT_PRICE>
        <QUANTITY>1</QUANTITY>
       </ITEMROW>
      </ITEMS>
    </ROW>
    <ROW>
      <ORDER_ID>2</ORDER_ID>
      <CUSTOMER_ID>2</CUSTOMER_ID>
      <ORDER_TOTAL>599</ORDER_TOTAL>
      <ORDER_TIMESTAMP>2009-01-11T16:20:09.000</ORDER_TIMESTAMP>
      <USER_ID>2</USER_ID>
      <ITEMS>
       <ITEMROW>
        <ORDER_ITEM_ID>2</ORDER_ITEM_ID>
        <ORDER_ID>2</ORDER_ID>
        <PRODUCT_ID>2</PRODUCT_ID>
        <UNIT_PRICE>199</UNIT_PRICE>
        <QUANTITY>1</QUANTITY>
       </ITEMROW>
       <ITEMROW>
        <ORDER_ITEM_ID>3</ORDER_ITEM_ID>
        <ORDER_ID>2</ORDER_ID>
        <PRODUCT_ID>8</PRODUCT_ID>
        <UNIT_PRICE>50</UNIT_PRICE>
        <QUANTITY>2</QUANTITY>
       </ITEMROW>
      </ITEMS>
    </ROW>
    </ROWSET>

    Hi, I'm assuming that table columns have the same names as the xml elements in your example.
    Try this:
    SQL >select xmlelement("ROWSET",
      2                    xmlagg(xmlelement("ROW",xmlforest(order_id,
      3                                                      customer_id,
      4                                                      order_total,
      5                                                      to_char(order_timestamp,'yyyy-mm-dd"T"hh24:mi:ss.FF3') as "ORDER_TIMESTAMP",
      6                                                      user_id),
      7                                            xmlelement("ITEMS",(select
      8                                                               xmlagg(xmlelement("ITEMROW",xmlforest(order_item_id,
      9                                                                                                     order_id,
    10                                                                                                     product_id,
    11                                                                                                     unit_price,
    12                                                                                                     quantity)
    13                                                                                )
    14                                                                     ) from demo_order_items i where i.order_id=o.order_id)
    15                                                       )
    16                                     )
    17                          )
    18                   ).extract('/*') as yourXML
    19    from demo_orders o; 
    YOURXML
    <ROWSET>
      <ROW>
        <ORDER_ID>1</ORDER_ID>
        <CUSTOMER_ID>1</CUSTOMER_ID>
        <ORDER_TOTAL>1200</ORDER_TOTAL>
        <ORDER_TIMESTAMP>2009-12-28T10:19:01.464</ORDER_TIMESTAMP>
        <USER_ID>2</USER_ID>
        <ITEMS>
          <ITEMROW>
            <ORDER_ITEM_ID>1</ORDER_ITEM_ID>
            <ORDER_ID>1</ORDER_ID>
            <PRODUCT_ID>1</PRODUCT_ID>
            <UNIT_PRICE>1200</UNIT_PRICE>
            <QUANTITY>1</QUANTITY>
          </ITEMROW>
        </ITEMS>
      </ROW>
      <ROW>
        <ORDER_ID>2</ORDER_ID>
        <CUSTOMER_ID>2</CUSTOMER_ID>
        <ORDER_TOTAL>599</ORDER_TOTAL>
        <ORDER_TIMESTAMP>2009-12-28T10:19:01.464</ORDER_TIMESTAMP>
        <USER_ID>2</USER_ID>
        <ITEMS>
          <ITEMROW>
            <ORDER_ITEM_ID>2</ORDER_ITEM_ID>
            <ORDER_ID>2</ORDER_ID>
            <PRODUCT_ID>2</PRODUCT_ID>
            <UNIT_PRICE>199</UNIT_PRICE>
            <QUANTITY>1</QUANTITY>
          </ITEMROW>
          <ITEMROW>
            <ORDER_ITEM_ID>3</ORDER_ITEM_ID>
            <ORDER_ID>2</ORDER_ID>
            <PRODUCT_ID>8</PRODUCT_ID>
            <UNIT_PRICE>50</UNIT_PRICE>
            <QUANTITY>2</QUANTITY>
          </ITEMROW>
        </ITEMS>
      </ROW>
    </ROWSET>The extract('/*') method it's only useful to get a pretty formatted output. Remove it in your production applications for better performances and space saving.
    Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2009/12/27/inviare-email-dal-db-utilizzando-utl_smtp/]

  • Junk Characters in the output XML file after Parsing

    Hi
    I am using DOM parser to parse an XML file.
    After parsing the input XML file, i am fetching some contents
    from the same and also putting the same contents in the parsed output file which is also an XML file.
    The problem here is that the after putting the contents to the output XML file from the input XML file,
    some junk character appears at the end of each and every tag in the outputfile.
    The junk character is some thing like this : " ampersand hash thirteen and a semicolon "
    (*THE MESSAGE DID NOT ACCEPT THE SYMBOLS KINDLY TRANSLATE THE ABOVE WORDINGS*
    INTO SYMBOLS)
    This character gets appended at the end of each and every tag in the output file due to which the output file
    is not recognised as an XML file.
    Please let me know as to why is this character appearing and also please suggest some solution
    for the same.
    -Thanks in Advance.
    Edited by: itskarthik on Oct 10, 2008 7:16 AM
    Edited by: itskarthik on Oct 10, 2008 7:18 AM
    Edited by: itskarthik on Oct 10, 2008 7:19 AM
    Edited by: itskarthik on Oct 10, 2008 7:19 AM
    Edited by: itskarthik on Oct 10, 2008 7:23 AM
    Edited by: itskarthik on Oct 10, 2008 7:23 AM

    Wierd.
    Try this piece of code. (You can always change it to use input file and output file instead of string if you want)
    What is your output?
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.OutputStream;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Result;
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    public class XMLTest {
         public static void main(String[] args) throws Exception {
              String input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" +
                                  "<test>\r\n" +
                                  "</test>";
              System.out.println("Input:");
              lookForCR(input);
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              Document doc = factory.newDocumentBuilder().parse( new ByteArrayInputStream(input.getBytes()) );
              Source source = new DOMSource(doc);
              ByteArrayOutputStream bArrOut = new ByteArrayOutputStream();
              Result result = new StreamResult( new StripOutputStream( bArrOut ) );
              Transformer xformer = TransformerFactory.newInstance().newTransformer();
              xformer.transform(source, result);     
              System.out.println("\nResult:");
              lookForCR(bArrOut.toString());
              System.out.println("\nDone");
         public static void lookForCR(String input) throws Exception {
              char[] chars =input.toCharArray();
              for ( char chr : chars ) {
                   if (chr == 13 ) {
                        System.out.println("Has 0x0D character!!");
    class StripOutputStream extends OutputStream {
         OutputStream out = null;
         public StripOutputStream(OutputStream out) {
              this.out = out;
         @Override
         public void write(int b) throws IOException {
              if ( b != 13 )
                   out.write(b);
    }- Roy

  • Ant for the build.xml file

    when we give the ant command then what the background task perform?..
    how ant start parsing the build.xml file ?

    Go to ant.jakarta.org. They have numerous tutorials. Do some research first. If you run into an actual problem, then post what it is.
    - Saish

Maybe you are looking for

  • Links No longer work for HowTo

    Hi, for the thread with the title: Thread: HOWTO: Implementing a ViewObject with Multiple Updateable Dependent Entity Objects HOWTO: Implementing a ViewObject with Multiple Updateable Dependent Entity Objects The links in the thread no longer seem to

  • Help Please - having difficulties creating af link from the text to an attached file i acrobat

    I have been reading the help, but it just wonn't work when I try. I have tried as followed (I am working with a danish version, and hope to matched the same word as in the english version of Acrobat Xpro): 1. From the toolbox i choose content and the

  • PLEASE...Read This BEFORE Installing 10.5....

    I know everyone (including myself) is excited about the new release. But, PLEASE....back up your stuff before you install the new OS. I know there are going to be a million posts saying "Leopard Broke Whatever..." It happens every time. This can be s

  • Delay in  lookup of Remote object.

    Hi, I am using RMI for my client - server communication. My server is a Solaris machine and client is a Windows XP PC and I am using jre1.5. While I am doing a lookup of a Remote object from the client side using Naming.lookup , I see a delay of 1 to

  • Quickest way to lift brightness of a sequence of photos

    Dear All, I have a sequence of stills which are all too dark. What's the quickest way to raise the brightness of the all the pictures by the same amount? Many thanks, Damon