Parse XML from CLOB field

How can I parse XML from CLOB field? I need to replace or delete the node from XML document and update the database with new XML. I am using Oracle 9i release 2.
Here is the XML. In this XML if section1 and section2 exists then I need to delete the section1 node. If section2 doesn't exist, replace section1 with section2 node.
<Document ID='2' TypeID='2'>
<Body>
<Page Name='Page1'>
<Sec ID='section1' Title='Section 1' GroupID='' />
<Sec ID='section2' Title='Section 2' GroupID='' />
</Page>
</Body>
</Document>
Please help.. Thank you..

In 9.2, you are limited into your options. Have a look into, among others, updateXML. Updating tp 10gR2 will give you more options to succeed.

Similar Messages

  • Parsing text from CLOB field that's stored as XML

    I have a CLOB field that contains an XML string. That looks like the text below. Is it possible to parse out the text string Denied NOW!!!. I basically want to parse out the data between the first encounter of the <CommentBody> tag.
    <CommentHeader>Whatever<CommentDate>2010-01-21-15.16.48.000000
    </CommentDate></CommentHeader><CommentBody>Denied NOW!!!</CommentBody>
    <CommentHeader>Whatever<CommentDate>2010-01-21-15.10.38.000000
    </CommentDate></CommentHeader><CommentBody>Denied YESTERDAY!!!</CommentBody>
    Thanks all!!
    Edited by: user11938977 on Jun 28, 2010 11:32 AM

    Thanks everyone! I'm using Oracle 11.1.0.7.0
    It seems to work as long as the Text Contents of CommentBody tag is one word without spaces. If there are spaces in between the tags it errors out. Here's the SQL:
    SELECT extractvalue( xmltype('<root>'||t.comments||'</root>'),
    'root/CommentBody[1]' ) as "CommentBody"
    FROM AP_VCHR_AW t
    When COMMENTS contains this data it errors out:
    <CommentHeader> <CommentDate>2010-03-04-17.52.53.000000
    </CommentDate></CommentHeader><CommentBody>This is an approved vuocher</CommentBody>
    <CommentHeader> <CommentDate>2010-03-04-17.52.53.000000
    </CommentDate></CommentHeader><CommentBody>This is an approved vuocher</CommentBody>
    When COMMENTS contains this data the SQL succeeds:
    <CommentHeader>at <CommentDate>2010-01-21-15.16.48.000000
    </CommentDate></CommentHeader><CommentBody>Denied!!!</CommentBody>
    <CommentHeader> at <CommentDate>2010-01-21-15.10.38.000000
    </CommentDate></CommentHeader><CommentBody>Denied!!!</CommentBody>

  • How to parse/extract XML from clob field using ODI

    Hi,
    I am very new to ODI. I have an oracle table which has clob field. This clob field contains xml. I would like to parse this xml and convert it to oracle table. Means I would like to make all the tags of xml as oracle table columns.
    I have created a PL/SQL procedure and used XMLTABLE function and I have achieved my goal. The same this I am trying to do with ODI. Since I am new to ODI so any help is appreciated.
    Thanks

    In 9.2, you are limited into your options. Have a look into, among others, updateXML. Updating tp 10gR2 will give you more options to succeed.

  • Parsing xml in clob field remove non utf-8 characters

    hi all,
    i have an issue where a stored procedure runs during a nightly process and parses xml contained in a clob field. There are some records that contain non-utf8(they paste characters from word)characters and therefore the parse fails when using performing an xquery select against the clob field as xmltype. I was wondering if anyone knew of a handy way to handle such a situation? I have looked around a bit and not found anything that seemed tailored to my situation, and I would like something a bit more generic than doing a replace on individual characters that i have found causing issues...thx in advance! -- jp

    Hi,
    Like BluShadow I'm curious to see a test case...
    Depending on the way it's been created, the encoding declared in the XML prolog doesn't necessarily reflects the actual encoding of the content.
    What's your database character set, and version?
    Please also post the error message you get (LPX-00200 probably?).

  • Can't parse xml from applet using dom on linux on Netscape 7 using jre 1.4.

    Hi,
    I can't seem to parse xml from an applet on linux on Netscape 7 using the JRE 1.4.
    My code looks like the following:
    StringBufferInputStream is = new StringBufferInputStream("<foo></foo>");
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = null;
    try
      builder = factory.newDocumentBuilder();
      domDocument = builder.parse(is); // this line creates an exception
    catch (Exception e)
      System.out.println(e);
    This code works fine from an applet on windows. On linux, the error message is:
    java.security.AccessControlException: access denied (java.util.PropertyPermission entityExpansionLimit read)
    I've tried both JRE 1.4.0_04 and 1.4.1_03
    Thanks!
    Q

    There's another posting about this same problem (platform unspecified), but the same error message. I was also having this problem (Windows 1.4.03) and swithced back to 1.4.01 and the problem went away. In the future, I may sign my applets to get a more generous security policy. But, I'm sure it'll be a lot of work (vs. a line of code somewhere).

  • Parsing XML from Socket input stream

    I create a sax parser to which I send the InputStream from the socket
    But my HandlerBase never gets the events. I get startDocument
    but that is it, I never get any other event.
    The code I have works just like expected when I make the InputStream
    come from a file. The only differeence I see is that when I file is used the
    InputStream is fully consumed while with the socket the InputStream
    is kept open (I MUST KEEP THE SOCKET OPEN ALL THE TIME). If the parser
    does not generate the events unless the InputStream is fully consumed,
    isn't that against the whole idea of SAX (sax event driven) .
    Has anyone been succesfull parsing XML from the InputStream of a socket?
    if yes how?
    I am using JAXP 1.0.1 but I can upgrade to JAXP 1.1.0
    which uses SAX 2.0
    Does anybody know if my needs can be met by JAXP 1.1.0?
    Thanks

    I did the same with client/server model.
    I have client program with SAX parser. Please try if you can make the server side. I was be able to write the program with help from this forum. Please search to see if you can get the forum from which I got help for this program.
    // JAXP packages
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    // JAVA packages
    import java.util.*;
    import java.io.*;
    import java.net.*;
    public class XMLSocketClient {
    final private static int buffSize = 1024*10;
    final private static int PORTNUM = 8888;
         final private static int threadSleepValue = 1000;
    private static void usage() {
    System.err.println("Usage: XMLSocketClient [-v] serverAddr");
    System.err.println(" -v = validation");
    System.exit(1);
    public static void main(String[] args) {
    String address = null;
    boolean validation = false;
    Socket socket = null;
    InputStreamReader isr_socket = null;
    BufferedReader br_socket = null;
    CharArrayReader car = null;
    BufferedReader br_car = null;
    char[] charBuff = new char[buffSize];
    int in_buff = 0;
    * Parse arguments of command options
    for (int i = 0; i < args.length; i++) {
    if (args.equals("-v")) {
    validation = true;
    } else {
    address = args[i];
    // Must be last arg
    if (i != args.length - 1) {
    usage();
    // Initialize the socket and streams
    try {
    socket = new Socket(address, PORTNUM);
    isr_socket = new InputStreamReader(socket.getInputStream());
    br_socket = new BufferedReader(isr_socket, buffSize);
    catch (IOException e) {
    System.err.println("Exception: couldn't create stream socket "
    + e.getMessage());
    System.exit(1);
    * Check whether the buffer has input.
    try {
    while (br_socket.ready() != true) {
                   try {
                        Thread.currentThread().sleep(threadSleepValue);     
                   catch (InterruptedException ie) {
              System.err.println("Interrupted error for sleep: "+ ie.getMessage());
                   System.exit(1);
    catch (IOException e) {
    System.err.println("I/O error for in.read(): "+ e.getMessage());
    System.exit(1);
    try {
    in_buff = br_socket.read(charBuff, 0, buffSize);
    System.out.println("in_buff = " + in_buff);
    System.out.println("charBuff length: " + charBuff.length);
    if (in_buff != -1) {
    System.out.println("End of file");
    } catch (IOException e) {
    System.out.println("Exception: " + e.getMessage());
    System.exit(1);
    System.out.println("reading XML file:");
    StringBuffer display = new StringBuffer();
    display.append(charBuff, 0, in_buff);
    System.out.println(display.toString());
    * Create BufferedReader from the charBuff
    * in order to put into XML parser.
    car = new CharArrayReader(charBuff, 0, in_buff); // these two lines have to be here.
    br_car = new BufferedReader(car);
    * Create a JAXP SAXParserFactory and configure it
    * This section is standard handling of XML document by SAX XML parser.
    SAXParserFactory spf = SAXParserFactory.newInstance();
    spf.setValidating(validation);
    XMLReader xmlReader = null;
    try {
    // Create a JAXP SAXParser
    SAXParser saxParser = spf.newSAXParser();
    // Get the encapsulated SAX XMLReader
    xmlReader = saxParser.getXMLReader();
    } catch (Exception ex) {
    System.err.println(ex);
    System.exit(1);
    // Set the ContentHandler of the XMLReader
    xmlReader.setContentHandler(new MyXMLHandler());
    // Set an ErrorHandler before parsing
    xmlReader.setErrorHandler(new MyErrorHandler(System.err));
    try {
    * Tell the XMLReader to parse the XML document
    xmlReader.parse(new InputSource(br_car));
    } catch (SAXException se) {
    System.err.println(se.getMessage());
    System.exit(1);
    } catch (IOException ioe) {
    System.err.println(ioe);
    System.exit(1);
    * Clearance of i/o functions after parsing.
    try {
    br_socket.close();
    } catch (IOException e) {
    System.out.println("Exception: " + e.getMessage());
    try {
    socket.close();
    } catch (IOException e) {
    System.out.println("Exception: " + e.getMessage());
    try {
    br_car.close();
    } catch (IOException e) {
    System.out.println("Exception: " + e.getMessage());
    * The XML handler used by this program
    class MyXMLHandler extends DefaultHandler {
    // A Hashtable with tag names as keys and Integers as values
    private Hashtable tags;
    // Parser calls this once at the beginning of a document
    public void startDocument() throws SAXException {
    System.out.println("startDocument()");
    tags = new Hashtable();
    // Parser calls this for each element in a document
    public void startElement(String namespaceURI, String localName,
    String rawName, Attributes atts)
    throws SAXException
    String key = localName;
    Object value = tags.get(key);
    System.out.println("startElement()");
    System.out.println("namespaceURI: " + namespaceURI);
    System.out.println("localName: " + localName);
    System.out.println("rawName: " + rawName);
    if (value == null) {
    // Add a new entry
    tags.put(key, new Integer(1));
    } else {
    // Get the current count and increment it
    int count = ((Integer)value).intValue();
    count++;
    tags.put(key, new Integer(count));
    // Parser calls this once after parsing a document
    public void endDocument() throws SAXException {
    Enumeration e = tags.keys();
    System.out.println("endDocument()");
    while (e.hasMoreElements()) {
    String tag = (String)e.nextElement();
    int count = ((Integer)tags.get(tag)).intValue();
    System.out.println("Tag <" + tag + "> occurs " + count
    + " times");
    * Error handler of XML parser to report errors and warnings
    * This is standard handling.
    class MyErrorHandler implements ErrorHandler {
    /** Error handler output goes here */
    private PrintStream out;
    MyErrorHandler(PrintStream out) {
    this.out = out;
    * Returns a string describing parse exception details
    private String getParseExceptionInfo(SAXParseException spe) {
    String systemId = spe.getSystemId();
    if (systemId == null) {
    systemId = "null";
    String info = "URI=" + systemId +
    " Line=" + spe.getLineNumber() +
    ": " + spe.getMessage();
    return info;
    * The following methods are standard SAX ErrorHandler methods.
    * See SAX documentation for more info.
    public void warning(SAXParseException spe) throws SAXException {
    out.println("Warning: " + getParseExceptionInfo(spe));
    public void error(SAXParseException spe) throws SAXException {
    String message = "Error: " + getParseExceptionInfo(spe);
    throw new SAXException(message);
    public void fatalError(SAXParseException spe) throws SAXException {
    String message = "Fatal Error: " + getParseExceptionInfo(spe);
    throw new SAXException(message);

  • Extracting xmldata from clob field in oracle

    I have an xml document stored in xmltype (clob)field in oracle
    Below is the xml data inside the xml ( I have kind of 300 elements similar to this inside the xml)
    <ns1:E-I12_IS_13 ObjID="I12" ObjType="e">5437090</ns1:E-I12_IS_13>
    <ns1:E-I13_IS_14 ObjID="I13" ObjType="e">5</ns1:E-I13_IS_14>
    <ns1:E-I14_IS_15 ObjID="I14" ObjType="e">9</ns1:E-I14_IS_15>
    The requirement is to get all the elements from the xmldata and compare against the 15-16 oracle tables ( here xml is converted and stored in these tables by a tibco process)
    select dbms_lob.instr(clobcolumnname,'E-I13_IS_14') from tablename  where  ( given condition to extract specific transaction)
    the above statement gives me position of the string
    select dbms_lob.substr(clobcolumnname,6( length of element value),870(position from where the value starts)) from tablename where  condition
    the abv statement gives me the element value
    but I want to extract the value for  any element by giving the element name ( if u see any value comes after objtype="e"  between > and < tags)
    can anyone on this forum tell me to extract the element value just by giving element name ( since I have to do the same for n number of elements - how to find position of > and < tags??)

    Hi Odie,
    Good afternoon. I am not getting any help to solve my xmltable issues.
    <MeterTransaction xmlns:CorralClub="http://webservice.hlsr.net/CorralClubService/">
      <TransactionID>1100</TransactionID>
      <Club_Number>CN001</Club_Number>
      <Club_Activity_ID>0</Club_Activity_ID>
      <Transaction_Date>2014-01-29T00:00:00-06:00</Transaction_Date>
      <Creation_Date>2014-01-29T00:00:00-06:00</Creation_Date>
      <User_ID>1766</User_ID>
      <Status />
      <TicketCount>0</TicketCount>
      <Usage>0</Usage>
      <BadPulls>0</BadPulls>
      <Discrepancy>0</Discrepancy>
      <Percent>0</Percent>
      <Comments />
      <Readings>
         ********** Can be disregarded ******************
            <xs:schema id="ClubMeter" targetNamespace="http://tempuri.org/ClubMeter.xsd" xmlns:mstns="http://tempuri.org/ClubMeter.xsd" xmlns="http://tempuri.org/ClubMeter.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-               com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
                        ****** Some other elements
              </xs:schema>
          *********** End of Can be disregarded ******************
        <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
          <ClubMeter xmlns="http://tempuri.org/ClubMeter.xsd">
            <MeterBar diffgr:id="MeterBar1" msdata:rowOrder="0" diffgr:hasChanges="modified">
              <Club_Number>CN001</Club_Number>
              <Bar_Number>BBS01</Bar_Number>
              <TicketCount>111</TicketCount>
              <Usage>88</Usage>
              <BadPulls>15</BadPulls>
              <Discrepancy>8</Discrepancy>
              <Percent>0.0720720720720721</Percent>
              <DISPLAY>BEER - BBS01</DISPLAY>
            </MeterBar>
            <MeterBar diffgr:id="MeterBar2" msdata:rowOrder="1" diffgr:hasChanges="modified">
              <Club_Number>CN001</Club_Number>
              <Bar_Number>BBS02</Bar_Number>
              <DISPLAY>BEER - BBS02</DISPLAY>
            </MeterBar>
            <MeterReading diffgr:id="MeterReading16" msdata:rowOrder="15" diffgr:hasChanges="modified">
              <Club_Number>CN001</Club_Number>
              <Bar_Number>BBS01</Bar_Number>
              <Position>11</Position>
              <Inventory_Item_ID>12906</Inventory_Item_ID>
              <Product_Class>SOFT-GOODS</Product_Class>
              <Product_Type>SOFT DRINK</Product_Type>
              <Product_Name>Full Throttle Coca Cola</Product_Name>
              <Open>6</Open>
              <Add1>11</Add1>
              <Close>1</Close>
              <Usage>16</Usage>
            </MeterReading>
            <MeterReading diffgr:id="MeterReading96" msdata:rowOrder="95" diffgr:hasChanges="modified">
              <Club_Number>CN001</Club_Number>
              <Bar_Number>BBS01</Bar_Number>
              <Position>10</Position>
              <Inventory_Item_ID>2188</Inventory_Item_ID>
              <Product_Class>BEER</Product_Class>
              <Product_Type>DOMESTIC</Product_Type>
              <Product_Name>Lone Star Regular</Product_Name>
              <Open>6</Open>
              <Add1>2</Add1>
              <Close>1</Close>
              <BadPulls>3</BadPulls>
              <Usage>4</Usage>
            </MeterReading>
            <MeterReading diffgr:id="MeterReading17" msdata:rowOrder="16" diffgr:hasChanges="modified">
              <Club_Number>CN001</Club_Number>
              <Bar_Number>BBS02</Bar_Number>
              <Position>11</Position>
              <Inventory_Item_ID>12906</Inventory_Item_ID>
              <Product_Class>SOFT-GOODS</Product_Class>
              <Product_Type>SOFT DRINK</Product_Type>
              <Product_Name>Full Throttle Coca Cola</Product_Name>
            </MeterReading>
            <MeterReading diffgr:id="MeterReading97" msdata:rowOrder="96" diffgr:hasChanges="modified">
              <Club_Number>CN001</Club_Number>
              <Bar_Number>BBS02</Bar_Number>
              <Position>10</Position>
              <Inventory_Item_ID>2188</Inventory_Item_ID>
              <Product_Class>BEER</Product_Class>
              <Product_Type>DOMESTIC</Product_Type>
              <Product_Name>Lone Star Regular</Product_Name>
            </MeterReading>
          </ClubMeter>
          <diffgr:before>
            <MeterBar xmlns="http://tempuri.org/ClubMeter.xsd" diffgr:id="MeterBar1" msdata:rowOrder="0">
              <Bar_Number>BBS01</Bar_Number>
              <DISPLAY>BEER - BBS01</DISPLAY>
            </MeterBar>
            <MeterBar xmlns="http://tempuri.org/ClubMeter.xsd" diffgr:id="MeterBar2" msdata:rowOrder="1">
              <Bar_Number>BBS02</Bar_Number>
              <DISPLAY>BEER - BBS02</DISPLAY>
            </MeterBar>
            <MeterReading xmlns="http://tempuri.org/ClubMeter.xsd" diffgr:id="MeterReading16" msdata:rowOrder="15">
              <Bar_Number>BBS01</Bar_Number>
              <Position>11</Position>
              <Inventory_Item_ID>12906</Inventory_Item_ID>
              <Product_Class>SOFT-GOODS</Product_Class>
              <Product_Type>SOFT DRINK</Product_Type>
              <Product_Name>Full Throttle Coca Cola</Product_Name>
            </MeterReading>
            <MeterReading xmlns="http://tempuri.org/ClubMeter.xsd" diffgr:id="MeterReading96" msdata:rowOrder="95">
              <Bar_Number>BBS01</Bar_Number>
              <Position>10</Position>
              <Inventory_Item_ID>2188</Inventory_Item_ID>
              <Product_Class>BEER</Product_Class>
              <Product_Type>DOMESTIC</Product_Type>
              <Product_Name>Lone Star Regular</Product_Name>
            </MeterReading>
            <MeterReading xmlns="http://tempuri.org/ClubMeter.xsd" diffgr:id="MeterReading17" msdata:rowOrder="16">
              <Bar_Number>BBS02</Bar_Number>
              <Position>11</Position>
              <Inventory_Item_ID>12906</Inventory_Item_ID>
              <Product_Class>SOFT-GOODS</Product_Class>
              <Product_Type>SOFT DRINK</Product_Type>
              <Product_Name>Full Throttle Coca Cola</Product_Name>
            </MeterReading>
            <MeterReading xmlns="http://tempuri.org/ClubMeter.xsd" diffgr:id="MeterReading97" msdata:rowOrder="96">
              <Bar_Number>BBS02</Bar_Number>
              <Position>10</Position>
              <Inventory_Item_ID>2188</Inventory_Item_ID>
              <Product_Class>BEER</Product_Class>
              <Product_Type>DOMESTIC</Product_Type>
              <Product_Name>Lone Star Regular</Product_Name>
            </MeterReading>
          </diffgr:before>
        </diffgr:diffgram>
      </Readings>
    </MeterTransaction>
    From the above abbreviated XML document, how do I get the values from the nodes of MeterBar and MeterReading nodes?
    I really appreciate your help in this regard.
    Thanks,
    Bidhan

  • Get XML from CLOB

    Currently we have a web application that stores all of it's associated data in an XML document. This XML document is then stored in a CLOB field in an Oracle 10g database. I would like to use XML Publisher to query the XML document that is stored in the CLOB field. I have installed XML Publisher and cannot find a way get an XML feed from a CLOB field on a database. Please advise if this is possible and if so, some pointers as to how this can be accomplished. Thank you.

    Apologies, I thought I had written this up for the blog ... evidently not:
    select     WAREHOUSES.WAREHOUSE_ID as WAREHOUSE_ID,
         substr(WAREHOUSES.WAREHOUSE_SPEC.getClobval(),22) as WAREHOUSE_SPEC,
         WAREHOUSES.WAREHOUSE_NAME as WAREHOUSE_NAME
    from     OE.WAREHOUSES WAREHOUSES
    Where WAREHOUSE_SPEC contains :
    <?xml version="1.0" ?>
    <Warehouse>
    <Building>Owned</Building>
    <Area>25000</Area>
    <Docks>2</Docks>
    <DockType>Rear load</DockType>
    <WaterAccess>Y</WaterAccess>
    <RailAccess>N</RailAccess>
    <Parking>Street</Parking>
    <VClearance>10 ft</VClearance>
    </Warehouse>
    I needed the substr to strip the header out, not elegant but it works just fine.
    Tim

  • Parsing data from indexed field

     
    Hi,
    A contractor is developing a program to parse data from a form that I created in LiveCycle. There are some tables in the form where text fields in the same column have the same base name and are assigned an index by LiveCycle. For instance, there might be a CompanyName column with 6 text fields in each of 6 rows, where the text fields are named as follows: CompanyName [0], CompanyName [1], CompanyName [2], CompanyName [3], CompanyName [4], CompanyName [5].
    The programmer of the parsing program is having trouble parsing the data for those indexed fields from the XML.  Any pointers you could give me (that I would pass on to the programmer) for how to parse data from fields with indexed names like these?  I know just a little about what he is trying to do.  He said he is using a third-party DLL called iTextSharp for the parsing.  If any pointers come to mind on what he might do, please let me know.
    Thanks,
    Emily

    When design Adobe forms, you can have multiple fields with same name; as you mentioned your fields can be named as
    CompanyName [0], CompanyName [1], CompanyName [2], CompanyName [3], CompanyName [4], CompanyName [5]
    However when the form is submitted the form data (in the form of XML) would look like as follows:
    <xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/">
        <xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">
            <xfa:data>
                <form1>
                        <page1>
                                  <yourSubform>
                                           <CompanyName>My Company 1</CompanyName>
                                            <CompanyName>My Company 2</CompanyName>
                                            <CompanyName>My Company 3</CompanyName>
                                            <CompanyName>My Company 4</CompanyName>
                                            <CompanyName>My Company 5</CompanyName>
                                            <CompanyName>My Company 6</CompanyName>
                                  </yourSubform>
                        </page1>
                </form1>  
            </xfa:data>
        </xfa:datasets>
    </xdp:xdp>
    Note that all the CompanyName fields are named without any indexing.
    If you explain this format to your programmer, he will be able to understand and write a logic to retrieve all CompanyName field's values.

  • Xerces - Parse XML from String

    I am trying to parse an xml string using Xerces.
    I have the following code:
    String xml = <segments meters="8643" seconds="538" distance="5.4 mi" time="8 mins"><segment id="seg0"  pointIndex="0" meters="122" seconds="11"  distance="0.1 mi"  time="11 secs">Head  <b>southwest</b> from <b>B Ave NE</b>
    </segment>
    <segment id="seg1" pointIndex="2" meters="239" seconds="22" distance="0.1 mi" time="21 secs">Turn <b>left</b> at <b>19th St NE</b></segment>
    <segment id="seg2" pointIndex="5" meters="2985" seconds="192" distance="1.9 mi" time="3 mins">Turn <b>right</b> at <b>1st Ave NE</b></segment>
    <segment id="seg3" pointIndex="43" meters="3280" seconds="211" distance="2.0 mi" time="3 mins">Continue on <b>1st Ave SW/1st Ave NW</b></segment>
    <segment id="seg4" pointIndex="96" meters="158" seconds="10" distance="0.1 mi" time="10 secs">Bear <b>right</b> at <b>US-151-BR S</b></segment>
    <segment id="seg5" pointIndex="102" meters="1859" seconds="93" distance="1.2 mi" time="1 min">Turn <b>right</b> at <b>16th Ave SW</b></segment>;
    XMLReader reader = new SAXParser();
    reader.setContentHandler(new Handler());
    reader.parse(xml);I am getting the followoing error:
    org.xml.sax.SAXParseException: File "<segments meters="8643" seconds="538" distance="5.4 mi" time="8 mins"><segment id="seg0" pointIndex="0" meters="122" seconds="11" distance="0.1 mi" time="11 secs">Head  <b>southwest</b> from <b>B Ave NE</b></segment><segment id="seg1" pointIndex="2" meters="239" seconds="22" distance="0.1 mi" time="21 secs">Turn <b>left</b> at <b>19th St NE</b></segment><segment id="seg2" pointIndex="5" meters="2985" seconds="192" distance="1.9 mi" time="3 mins">Turn <b>right</b> at <b>1st Ave NE</b></segment><segment id="seg3" pointIndex="43" meters="3280" seconds="211" distance="2.0 mi" time="3 mins">Continue on <b>1st Ave SW/1st Ave NW</b></segment><segment id="seg4" pointIndex="96" meters="158" seconds="10" distance="0.1 mi" time="10 secs">Bear <b>right</b> at <b>US-151-BR S</b></segment><segment id="seg5" pointIndex="102" meters="1859" seconds="93" distance="1.2 mi" time="1 min">Turn <b>right</b> at <b>16th Ave SW</b></segment></segments>" not found.
         at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1219)
         at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument(DefaultEntityHandler.java:501)
         at org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:314)
         at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1097)
         at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1139)
         at com.shiftyeyes.xmlTest.main(xmlTest.java:34)
    Exception in thread "main" anyone know how I can fix this? Thanks!!

    reader.parse(new InputSource(new StringReader(xml)));

  • Parsing XML from a session bean

    Hi,
    I am trying to use a Sax parser for parsing xml received from a back end
    legacy system. The code is executed from a Session bean.
    Debugging learned me that the parse() method on the parser hangs the
    container without any error or exception trace. The code works fine outside
    a container.
    All help will be highly appreciated.
    Kurt

    I found out that the InputStream implementation used parsing source inside
    the container is different
    then from the one outside (other type of VM of course!). The Weblogic
    implementation blocks at the end of
    the stream, while the normal SUN JDK 1.3 returns. This is not a bug, the bug
    I found is in my proxy that allows
    the connection to the backend. This proxy allows HTTP connections, and I
    parse the XML received over HTTP.
    Regards,
    Kurt
    "Todd Karakashian" <[email protected]> wrote in message
    news:[email protected]..
    That's seems odd. Perhaps there is something going on in your document
    handler code that triggers a hang in the environment of the server.
    When you see the hang, instruct the VM to give you a thread dump (type
    control-<break> on Windows, <control>-\ (backslash) on UNIX in the
    window in which the server is running; the results are dumped to
    stderr). That will show what every thread in the server is doing. If you
    email or post the thread dump, I will take a look at it and see if I can
    see what is going on. Also, let us know which platform, VM, parser, and
    WebLogic version you are using.
    Regards,
    -Todd
    Kurt Quirijnen wrote:
    Hi,
    I am trying to use a Sax parser for parsing xml received from a back end
    legacy system. The code is executed from a Session bean.
    Debugging learned me that the parse() method on the parser hangs the
    container without any error or exception trace. The code works fine
    outside
    a container.
    All help will be highly appreciated.
    Kurt--
    Todd Karakashian
    BEA Systems, Inc.
    [email protected]

  • How to use DOMParser from an Applet / Or, how to parse XML from an Applet?

    Hey,
    As stating in the subject line, I wonder how to do it without getting an �Access Denied� error.
    I would like to parse a XML file that has external DTD pointing to a SYSTEM location. Yes, I can change it to a public location. However, in either way, I have problems to use DOMBuilder to parse the xml file. The application always throws the security exception.
    I tried to use the DOMParser from org.apache.xerces.parsers to parse the xml file. I set the DOMParser to ignore parsing the external DTD, and use the DOMParser.parse(InputSource) to parse the xml file from a giving URL. However, I get null of the result document.
    Does anyone know how to parse the XML from an Applet? Or, does anyone know how to use the DOMParser from an Applet?
    Thank you very much,

    If the document resides on the local filesystem, you will need to sign a CAB or JAR for the applet to circumvent the sandbox's security restrictions. There are dozens of posts on how to do this. Basically, that will turn the applet into an application, from a Java security perspective.
    - Saish
    "My karma ran over your dogma." - Anon

  • How to retrieve and use an XSL file from CLOB field

    I am using Java to query my data and return XML formatted data. I am able to format this data using an XSLStylesheet file. But I want to instead use an XSL Stylesheet stored in a clob field.
    I have an XSL file stored in a clob field. How can I retrieve and use it to initialize an XMLDocument and then create an XSLStylesheet.
    Thanks for your help,
    Les Smith

    I think this question has been raised before. Try searching this forum.

  • Read data from CLOB field

    Hello,
    I have table ( table1 ) with clob field ( clob1 ).
    Content of clob1 field is :
    data01 data02 data03 12345 data04
    data05 data06 data07 32131 data08
    data09 data10 data11 43422 data12
    data13 data14 data15 54534 data16
    Content of clob1 field is imported from ASCII file. Number of records in ASCII file is variable.
    How can I read each row separately from clob1 field?
    Thanks

    Here is an example of how it can be done.
    Note you will have to have an end of line marker on each line including the last line.
    In my case I have used the '@' symbol as a line delimiter
    declare
    v_clob clob := 'This is my@clob string which@is over a number@of lines@';
    v_clob_length number;
    v_read_pos number := 1;
    v_subclob clob;
    v_line varchar2(4000);
    v_marker number;
    begin
    v_clob_length := dbms_lob.getlength(v_clob);
    while  v_read_pos <= v_clob_length
    loop
    v_subclob := empty_clob();
    -- make a clob of the smaller piece of data
    v_subclob := dbms_lob.substr(v_clob,v_clob_length,v_read_pos);
    -- find the position of the end of line marker
    v_marker  := dbms_lob.instr(v_subclob,'@');
    -- build a line from the subclob, removing the trailing end of line marker
    v_line    := dbms_lob.substr(v_subclob,v_marker-1,1);
    dbms_output.put_line(v_line);
    --  increment the position from where to start reading the original clob
    v_read_pos := v_read_pos+length(v_line)+1;
    end loop;
    end;This produces the following
    This is my
    clob string which
    is over a number
    of lines

  • Parsing xml from forms6i,can anyone please help me

    Can anyone please help me.I need to parse a xml file from a directory.The parsing should help me in giving a structure for two things.
    1) i should be able to read the nodes( values between the tags) and display the values at my front-end textboxex
    2) whenever the user changes the front-end content it should change the corresponding value in the xml node.
    when it is finished i should be able to save the structure back as a xml file.This file is actually a blob object in the oracle database and is it wise to convert it into a file in dos directory and parse it from there or use oracle utilities from form6i and parse it from oracle utilities.
    Please if someone can find help on this ,it would really help me.

    No the password isn't your apple id password.
    You encrypted your backup with a password, if you don't remember the password, then i'm sorry you won't be able to use it.

Maybe you are looking for

  • Training and event management help

    hello frnds                             am Mathew,from Texas,,i am working with SAp consultant company,,,am in the implementation of training and event man agent module for my client,,, but the client not at all implemented personal development and t

  • BlackBerry Messenger version 7.0.1.23 Fault

    I have a BlackBerry 9360 (3G, Wi-Fi), 7.1 bundle 1717 (v7.1.0.569, Platform 9.6.0.86), BlackBerry Messenger version 7.0.1.23 The team originally had the version of BlackBerry OS 6 operating system, for months to upgrade to the latest available for th

  • Importing FROM external hard drive to new internal hard drive

    How can I move my backed up Itunes library from my external hard drive to my new internal hard drive? I went through the steps listed on the support page, and imported the .xml playlist that I moved to the desktop. Now all my playlists (names only) a

  • Dynamic Header Text

    I would like to set some of the Header Text on one of my pages dynamically via an iten set on another page. So far I've tried: <script src="http://foo.com/apps?file=api&v=1&key=#MY_ITEM#" type="text/javascript"></script> using the #MY_ITEM# syntax -

  • Vendor evaluation- where to put (see) sub criteria on which screen

    Please can any one update on it. Dear Friends. I have configured vendor evaluation in following  way . 1)     Price (main criteria) u2013 a) price level [60] b) price behavior [30] c)market behavior[10] Que u2013 where we have to put above sub criter