Reading UTF-7 XML document in Java

I have an XML document and I want to add PrcessingInstruction to it.
<?xml version="1.0" encoding="UTF-7" ?>
<root_element>
<sections>
<section_introduction>
<order-no>108800674</order-no>
<order-type>219</order-type>
<created-date>5. november 2008</created-date>
when trying to parse it like
File tmpFile = new File("C:\\ProvisioningEventError58412.xml");
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(false);
Document doc = factory.newDocumentBuilder().parse(tmpFile);
System.out.println("end");
I get an exception on Document doc = factory.newDocumentBuilder().parse(tmpFile);
org.xml.sax.SAXParseException: Invalid encoding name "UTF-7".
[Fatal Error] ProvisioningEventError58412.xml:1:40: Invalid encoding name "UTF-7".
Is it possible to set encoding on DocumentBuilder, so it can work with UTF-7 or is there any other was to parse it for adding ProcessingInstruction. Actually I want to add a CSS/XSL file for formatting the XML File.
Edited by: aamaam on Jul 15, 2009 5:18 AM

As you will see from [this Supported Encodings document|http://java.sun.com/javase/6/docs/technotes/guides/intl/encoding.doc.html], it's Java which doesn't support UTF-7, not just DocumentBuilder.
So you have a couple of options. You could send the document back to whoever produced it and tell them that you can't process it the way it is. That's a legitimate thing to do because [the XML Recommendation|http://www.w3.org/TR/REC-xml/] only requires parsers to support UTF-8 and UTF-16. Support for other encodings is optional.
Or you could write your own subclass of InputStreamReader which converts a stream of UTF-7 bytes into a stream of chars, and use that as a Reader which you pass to the parser. Somebody may even have done that already and posted it on the web somewhere.

Similar Messages

  • Serializing XML Documents(not Java Serialization)

    Hi,
    Iam looking for a class that can serialize the XML documents.
    Heres the problem in detail:
    - I need to create an XML String from scratch taking data from a database.
    - I created the XML Document adding the childs and attributes.
    - I need an XML string from the document. Iam not exactly sure how to do this. But Apache Xerces package provides an XMLSerializer class where we can convert the document into a string.
    Is there any functionality provided. If so where can i find it.
    Thanks,
    -Rao

    Not sure if this is a bug or not (filing one just in case it is) but the following program demonstrates that with 2.0.2.9 the internal subset is serialized correctly if the document was parsed with validationMode set to true. If set to false only the entities show up in the internal subset.
    package xmlbugs;
    import java.io.*;
    import org.w3c.dom.*;
    import oracle.xml.parser.v2.*;
    public class TestSerializeLocalSubset {
    private static final String xml =
    "<?xml version='1.0' encoding='UTF-8'?>"+
    "<!DOCTYPE bar ["+
    "<!ENTITY bar 'baz'>"+
    "<!ELEMENT foo EMPTY >"+
    "<!ELEMENT bar (foo) >"+
    "]>"+
    "<bar><foo/></bar>";
    public static void main(String[] a_ ) throws Exception {
    System.out.println("Test with parser in validation mode = false");
    DOMParser d = new DOMParser();
    d.setPreserveWhitespace(false);
    d.setValidationMode(false);
    d.parse( new StringReader(xml));
    Document x = d.getDocument();
    XMLDocument xx = (XMLDocument) x;
    xx.print(System.out);
    System.out.println("Test with parser in validation mode = true");
    DOMParser d2 = new DOMParser();
    d2.setPreserveWhitespace(false);
    d2.setValidationMode(true);
    d2.parse( new StringReader(xml));
    x = d2.getDocument();
    xx = (XMLDocument) x;
    xx.print(System.out);
    }

  • How to append child to XML document using Java

    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
    "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>
         <bean name="PinnacleReportsData"
              class="com.hsbc.webapp.report.view.GenericPinnacleReportsViewData"
              singleton="false">
              <property name="headers">
                   <value>Account|Cusip|Description|SecType|Sector|Holding|Price|MarketValue|SettleDate|Yield|SprdUST|AL|CFDur|OAS|ZVolOas|OADur|PrepayDur|VolDur|DV01|DVOAS01|KRDur10Y|PrepayModelCalled|CalcError|CalculationTime</value>
              </property>     
              <property name="noOfRows">
                   <value>20</value>
              </property>     
              <property name="rowdata">
                   <list>
                        <value>AA09b|CMO|8000|8000|62052MAD0|MFPLC_4A 2A 144A||8097|99-27+|5.18|0.25|200|0.00||15||||</value>
                        <value>AA09b|CMO|10000|10000|320277AD8|HASCO 2005 F II-A-2||9958|99-13|5.69|0.13|131|0.02||154|0.000|25|0.001|9864</value>
                        <value>AA09b|CMO|8000|2363|46071LAA8|IMT_03-3G A2||2378|100-01|5.18|0.14|33|0.00||2||||</value>
                        <value>AA09b|CMO|1270|312|40430HDW5|HASCO 2006-O II-A-1||309|99-00|8.98|0.16|5|0.01||3|0.000|1|0.001|296</value>
                        <value>AA09b|CMO|5000|5000|40430HFQ6|HASCO 2006-O M-3||4583|91-15+|8.99|1.16|534|-0.58|-2|-2644|0.016|712|0.080|367625</value>
                        <value>AA74b|ABS|8000|8000|62052MAD0|MFPLC_4A 2A 144A||8097|99-27+|5.18|0.25|200|0.00||15||||</value>
                        <value>AA74b|ABS|10000|10000|320277AD8|HASCO 2005 F II-A-2||9958|99-13|5.69|0.13|131|0.02||154|0.000|25|0.001|9864</value>
                        <value>AA74b|ABS|8000|2363|46071LAA8|IMT_03-3G A2||2378|100-01|5.18|0.14|33|0.00||2||||</value>
                        <value>AA74b|ABS|1270|312|40430HDW5|HASCO 2006-O II-A-1||309|99-00|8.98|0.16|5|0.01||3|0.000|1|0.001|296</value>
                        <value>AA74b|ABS|5000|5000|40430HFQ6|HASCO 2006-O M-3||4583|91-15+|8.99|1.16|534|-0.58|-2|-2644|0.016|712|0.080|367625</value>
                   </list>
              </property>
         </bean>
    </beans>               hi there i have a XML Document above,and i need to append values to the <list> using java.
    i have string values like
         <value>AA74b|ABS|5000|5000|40430HFQ6|HASCO 2006-O M-3||4583|91-15+|8.99|1.16|534|-0.58|-2|-2644|0.016|712|0.080|367625</value>to add, but failing to navigate to the <list>
    any help?

    1. Read the XML file into a DMO object, walk the DOM to find the list, insert your new entry as a child, write the DOM back to a file.
    2. If the XML is not in a file, but in a string, then you can do the same with string input and output.

  • How to Read and Generate XML file from java code.

    hi guys,
    how to read the xml file (Condition :we know only DTD or Shema only).
    How to Generate the new xml file ?(using Shema )
    And one more how directly Generate the xml from DB?
    Pleas with code or any URL

    Using XMLbeans you can generate Java objects from an XSD schema (perhaps DTDs aswell)
    Then you can create an instance of the Document object and ask it to write itself.
    This will create an XML document complient to the schema.
    XMLBeans generates a "type" safe DOM where you can only ever have a structure compilent to you schema.
    matfud

  • How to create XML document in Java from scratch ?

    I've downloaded the package generated for my schema.
    Now I'm trying to create a XML Document using the interfaces generated and the
    xmlbeans package. In documentation, all samples start with a call to XmlLoader.load(xmlinput).
    In my case I've no xmlinput, I've only java parameters and i need to produce an
    XML document.
    Could you provide a sample code please ?
    Thanks in advance.

    It looks like you only need to use the xmlText() method from the root of any node
    you want to print out to a file. I used a PrintStream() class and then used the
    ps.print(vpDetails.xmlText()); to save to a file.
    Hope this helps.
    Jerald
    "Eric Vasilik" <[email protected]> wrote:
    >
    To create a new, untyped document:
    XmlObject x = XmlLoader.newInstance();
    To create a new, typed document:
    Map options = new HashMap(
    XmlOptions.DOCUMENT_TYPE,
    CustomerDocument.type );
    CustomerDocument cd = (CustomerDocument) =
    XmlLoader.newInstance( options );
    I have changes pending which will alow you to do this more easily:
    CustomerDocument cd = CustomerDocument.Factory.newInstance();
    - Eric
    "Pascal Fuget" <[email protected]> wrote:
    I've downloaded the package generated for my schema.
    Now I'm trying to create a XML Document using the interfaces generated
    and the
    xmlbeans package. In documentation, all samples start with a call to
    XmlLoader.load(xmlinput).
    In my case I've no xmlinput, I've only java parameters and i need to
    produce an
    XML document.
    Could you provide a sample code please ?
    Thanks in advance.

  • Validating xml document in java

    Trying to do subject.
    I'm trying to use xsd from file(schemasource = 1) and from clob (schemasource = 0). I have two xsd schemas common_types.xsd and migom.xsd. second includes first. The problem is that when I'm using common_types schema from file I get error
    ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.parser.v2.XMLParseException: An internal error condition occurred.
    and when I validate xml against only first schema has being read from clob I get success, but when I add second xsd, i get the same error, which says nothing at all.
    create or replace and compile java source named XmlTools AS
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.XMLReader;
    import org.xml.sax.InputSource;
    import oracle.sql.CLOB;
    import java.io.IOException;
    import org.xml.sax.SAXException;
    import java.sql.SQLException;
    import java.lang.IllegalArgumentException;
    import oracle.xml.parser.v2.XMLParseException;
    import javax.xml.parsers.ParserConfigurationException;
    import java.io.*;
    public class XmlValidator
    static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
    static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
    static final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
    public static void ValidateDocument(int schemasource, oracle.sql.CLOB schemadoc, oracle.sql.CLOB schemadoc1, oracle.sql.CLOB xmldoc) throws SAXException, IOException, SQLException, ParserConfigurationException, XMLParseException, IllegalArgumentException {
    try
    File myfile = new File(".//XML//common_types.xsd");
    if (myfile.exists())
    Serv.log("ValidateDocument", "file size" + Long.toString(myfile.length()));
    /*else
    Serv.log("ValidateDocument", "file doesn't exists" );
    Serv.log("ValidateDocument", "1" );
    SAXParserFactory factory = SAXParserFactory.newInstance();
    factory.setValidating(true);
    factory.setNamespaceAware(true);
    Serv.log("ValidateDocument", "2" );
    SAXParser saxParser = factory.newSAXParser();
    saxParser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
    if (schemasource == 0)
    InputSource schemaIs = new InputSource(schemadoc.getCharacterStream());
    InputSource schemaIs1 = new InputSource(schemadoc1.getCharacterStream());
    InputSource[] schemas = {schemaIs, schemaIs1};
    //saxParser.setProperty(JAXP_SCHEMA_SOURCE, schemaIs);
    saxParser.setProperty(JAXP_SCHEMA_SOURCE, schemas);
    else
    saxParser.setProperty(JAXP_SCHEMA_SOURCE, ".//XML//common_types.xsd");
    XMLReader reader = saxParser.getXMLReader();
    //Получаем входной XML документ
    InputSource documentIs = new InputSource(xmldoc.getCharacterStream());
    Serv.log("ValidateDocument", "3" );
    //Запуск разбора
    reader.parse(documentIs);
    Serv.log("ValidateDocument", "4" );
    documentIs = null;
    /*catch (SAXException e)
    Serv.log("ValidateDocument", "SAXException" );
    Serv.log("ValidateDocument", "document is not valid because ");
    Serv.log("ValidateDocument", e.getMessage());
    throw(e);
    catch (ParserConfigurationException e)
    Serv.log("ValidateDocument", "ParserConfigurationException" );
    throw(e);
    catch (IOException e)
    Serv.log("ValidateDocument", "IOException" );
    throw(e);
    catch (XMLParseException e)
    Serv.log("ValidateDocument", "XMLParseException" );
    Serv.log("ValidateDocument", e.getMessage());
    StackTraceElement[] stack = e.getStackTrace();
    for (int i = 0; i < stack.length; i++)
    Serv.log("stacktrace element no " + Integer.toString(i), "toString: " + stack.toString());
    Serv.log("stacktrace element no " + Integer.toString(i), "file name: " + stack[i].getFileName() + ", class name: " + stack[i].getClassName() + ", method name: " + stack[i].getMethodName() + ", line : " + stack[i].getLineNumber());
    throw(e);
    catch (IllegalArgumentException e)
    Serv.log("ValidateDocument", "IllegalArgumentException" );
    Serv.log("ValidateDocument", e.getMessage());
    throw(e);
    additional information got from java stacktrace:
    file name: XMLError.java, class name: oracle.xml.parser.v2.XMLError, method name: flushErrors1, line : 320 file name: NonValidatingParser.java, class name: oracle.xml.parser.v2.NonValidatingParser, method name: parseDocument, line : 300 file name: XMLParser.java, class name: oracle.xml.parser.v2.XMLParser, method name: parse, line : 200 file name: XMLTOOLS, class name: XmlValidator, method name: ValidateDocument, line : 86
    my oracle version is Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod But my aim is to make it work on all versions starting from 9

    I found another examples of xml document validation in Java, but it seems to me that ORACLE's JVM doesn't include such class as SchemaFactory and class SAXParserFactory doesn't have method setSchema. Is it possible to update JVM installed in Oracle?
    SAXParserFactory factory = SAXParserFactory.newInstance();
    factory.setValidating(false);
    factory.setNamespaceAware(true);
    SchemaFactory schemaFactory =
    SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
    factory.setSchema(schemaFactory.newSchema(
    new Source[] {new StreamSource("contacts.xsd")}));
    SAXParser parser = factory.newSAXParser();
    XMLReader reader = parser.getXMLReader();
    reader.setErrorHandler(new SimpleErrorHandler());
    reader.parse(new InputSource("document.xml"));

  • Generic Populating the XML document using Java Class Generator and Reflection

    I am looking for a generic source code in order to convert the data parsed from any tabular text form ( tab delimited for example that maps certain XML Schema created form Database Schema for Oracle.
    I know it is possible to generate XML DTD or XSD from Oracle database table schema by XSU utility from XDK. And also it is possible to create Java source files from an XML DTD or XSD by using XML Clas Generator.
    I believe there must be some generic code that parses tabular text data and converts them to XML format using above mentioned generated Java source files and may be Java reflection mechanism.
    If anyone has any tool or knows any free ware that helps me, I would like to know about it, and I would really appreciate it.

    1. Read the XML file into a DMO object, walk the DOM to find the list, insert your new entry as a child, write the DOM back to a file.
    2. If the XML is not in a file, but in a string, then you can do the same with string input and output.

  • Getting Node Value of an XML document in JAVA.

    Hi,
    In my application, I have got the exact node that I want by parsing the document, but the node value returned is null as the node is an element and the Java Documentation does specify that it will return null. I would like to know if there in any alternative way by which I can parse the document and get the specified value of the node or element. Kindly Help.

    Well, there are not many mind readers on this forum.
    You do not tell us how you are parsing the document, and so it is difficult determining why the node value is returned as a null.
    There are two main styles of processing XML -- DOM and SAX. Dom (and its variants JDom and I think Dom4J) build a tree structure that is memory-resident. There are ways to walk up and down the tree, and locate arbitrary nodes in the tree.
    The other style is SAX, which is much less intensive from a memroy perspective, but puts more work on you to keep what you want as the data goes flying by.
    So, how are you "parsing the document" and what method is returning a null? That may give someone enough information to guess at your problem.
    Dave Patterson

  • Pls How do I read/write a xml file using java

    I want to read/write trough a server/client a file.xml from evt. the same computer, this is the code for the client
    import java.io.*;
    import java.net.*;
    class client
    public static void main (String args[]) throws Exception
    final String msg = "<beg>note</beg>";
    // BufferedReader in = new BufferedReader(new FileReader("note.xml"));
    final Socket clientSocket = new Socket ("localhost", 8000);
    final OutputStream clientStream = clientSocket.getOutputStream ();
    clientStream.write (msg.getBytes ());
    // clientStream.write (in.getBytes ());
    clientSocket.close ();
    // BufferedReader in = new BufferedReader(new FileReader("note.xml"));
    // System.out.println(in.readLine());
    I want to read it and put it in a buffer...
    please somebody help me!!!
    regards
    Harry

    Pls read this:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=271751
    And don't post the same message twice. It's annoying.

  • Question about special characters in XML documents

    Hi,
    I need to create some XML documents based on documents containing elements containing strings containing accentuated and special characters such as ��� or Asian characters.
    I have found the following code claiming that XML documents created by the xformer will have a utf-8 format:
    // Write the DOM document to the file
    Transformer xformer = TheTF.newTransformer();
    xformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");and I have found the InputSource object to be used to read UTF-8 XML documents:
    InputSource in = new InputSource(new FileReader(filename));
    in.setEncoding("UTF-8");Is this enough to make sure that accentuated and Asian characters (or any other characters) will be converted properly when creating and re-reading the XML document? If one of my elements contain the following text '���33445tata', will the string remain the same when re-read from the XML? Do I need more code to make sure that all conversion will be performed properly and transparently? If yes, can one provide an example?
    Thanks!

    Hi Dr.Clap,
    Thanks for your answer, but I am not really sure I understand you. I have performed a test to generate a simple document containing one element. An attribute containing some special characters is added to the element. The element text also contains specials characters.
    When I generate the XML into a byte array input and print the content, I get:
    <?xml version="1.0" encoding="utf-8" standalone="no"?><UTF8TEST BIBI="��ii��������">tre33������</UTF8TEST>When I parse the document, and print the result, I get:
    -- Begin of Parsing
    Element Name = UTF8TEST
    Attribute Name = BIBI
    Attribute Value = �ii����
    Found text : tre33���
    -- End of Parsingwhich is correct. I am worried by the ��ii� ������-like characters generated in the XML. Should I be worried or shouldn't I? Should I convert these into something looking a more like ASCII, or is this fine?
    I am including the code of my example (excluding imports):
    public class XMLUTF8_Test extends DefaultHandler {
        // Logger
        private final static Logger LOG = Logger.getLogger(XMLUTF8_Test.class.getName());
        // Static
        public static DocumentBuilderFactory DOCUMENT_BUILDER_FACTORY;
        public static DocumentBuilder DOCUMENT_BUILDER;
        public static TransformerFactory TRANSFORMER_FACTORY;
        private static SAXParserFactory FACTORY;
        private static SAXParser SAXPARSER;   
        private static XMLReader XMLREADER;
        static {
            // Preparing the writting
            DOCUMENT_BUILDER_FACTORY = DocumentBuilderFactory.newInstance();
            try {
                DOCUMENT_BUILDER = DOCUMENT_BUILDER_FACTORY.newDocumentBuilder();
            } catch (ParserConfigurationException Ex) {
                Debugger.LogUnreachableCodeReachedSituation(LOG, Ex);
            TRANSFORMER_FACTORY = TransformerFactory.newInstance();
            // Preparing the reading
            try {
                FACTORY = SAXParserFactory.newInstance();
                SAXPARSER = FACTORY.newSAXParser();
                XMLREADER = SAXPARSER.getXMLReader();
            } catch (ParserConfigurationException Ex) {
                Debugger.LogUnreachableCodeReachedSituation(LOG, Ex);
            } catch (SAXException Ex) {
                Debugger.LogUnreachableCodeReachedSituation(LOG, Ex);
        public static void main(String[] args) {
            // Perform test
            new XMLUTF8_Test();
        public XMLUTF8_Test() {
            // Saving to File
            Document NewDoc = DOCUMENT_BUILDER.newDocument();
            Element Root = NewDoc.createElement("UTF8TEST");
            Root.setAttribute("BIBI", "�ii����");
            Root.setTextContent("tre33���");
            NewDoc.appendChild(Root);
            ByteArrayOutputStream TheBAOS = new ByteArrayOutputStream();
            try {
                Source source = new DOMSource(NewDoc);
                Result result = new StreamResult(TheBAOS);
                Transformer xformer = TRANSFORMER_FACTORY.newTransformer();
                xformer.setOutputProperty(OutputKeys.ENCODING, "utf-8");
                xformer.transform(source, result);
            } catch (TransformerConfigurationException Ex) {
                Debugger.LogUnreachableCodeReachedSituation(LOG, Ex);
            } catch (TransformerException Ex) {
                Debugger.LogUnreachableCodeReachedSituation(LOG, Ex);
            // Printing result
            System.out.println(TheBAOS.toString());
            // Parsing the result
            ByteArrayInputStream TheBAIS = new ByteArrayInputStream(TheBAOS.toByteArray());
            XMLREADER.setContentHandler(this);
            try {
                XMLREADER.parse(new InputSource(TheBAIS));
            } catch (IOException Ex) {
                Debugger.LogUnreachableCodeReachedSituation(LOG, Ex);
            } catch (SAXException Ex) {
                Debugger.LogUnreachableCodeReachedSituation(LOG, Ex);
        @Override
        public void startDocument() throws SAXException {
            System.out.println("-- Begin of Parsing");
        @Override
        public void endDocument() throws SAXException {
            System.out.println("-- End of Parsing");
        @Override
        public void startElement(String namespaceURI, String LocalName, String QualifiedName,
                Attributes TheAttributes) throws SAXException {
            String ElementName = LocalName;
            if ("".equals(ElementName)) {
                ElementName = QualifiedName; // namespaceAware = false
            System.out.println("Element Name = " + ElementName);
            if (TheAttributes != null) {
                for (int i = 0; i < TheAttributes.getLength(); i++) {
                    String AttributeName = TheAttributes.getLocalName(i); // Attr name
                    if ("".equals(AttributeName)) AttributeName = TheAttributes.getQName(i);
                    System.out.println("Attribute Name = " + AttributeName);
                    System.out.println("Attribute Value = " + TheAttributes.getValue(AttributeName));
        @Override
        public void endElement(String namespaceURI, String SimpleName, String QualifiedName) throws SAXException {
        @Override
        public void characters(char[] buf, int offset, int len) throws SAXException {
            String s = new String(buf, offset, len);
            System.out.println("Found text : " + s);
    }Thanks!

  • XML document reading in java

    Hello
    Can any one help me to read XML document in JAVA
    Thank u

    I'd use the nanoXML parser because it's small enough to fit easily on a STB.
    Roger

  • Api POI read and replace my word document with java

    Hi
    Everyone
    I�d like to know if someone has a piece of code reading a word document with api POI to send me?
    I need read replace the word document wiht java j2ee.
    Thanks

    Hello,
    You have to use the Office Integration Library. Please, follow the documentation below:
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/32853febec3c17e10000000a114084/frameset.htm
    I hope this helps you.
    Regards,
    Blanca

  • Error while generating an XML Document from XML Schema with JAXB

    Hi,
    I am following this OTN tutorial to generate the XML document from Java classes got from the XSD document.
    http://www.oracle.com/technology/pub/notes/technote_jaxb.html
    I am able to generate all the Java classes but getting error on compiling the XMLConstructor.java class which is use for generating the XML document :
    I am using JDK 1.5 and
    Oracle 10g XML Developer's Kit (XDK) Production for Java. xdk_nt_10_1_0_2_0_production
    (though these are warnings I am not able to run it.)
    Error
    C:\Prototype\classes\jaxbderived\catalog>javac -Xlint XMLConstructor.java
    warning: [path] bad path element "%CLASSPATH%": no such file or directory
    XMLConstructor.java:42: warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.List
    journalList.add(journal);
    ^
    XMLConstructor.java:46: warning: [unchecked] unchecked call to add(E) as a membe
    r of the raw type java.util.List
    articleList.add(article);
    Thanks
    Sanjeev ([email protected])

    Use JDK 1.4.

  • XPath to Update XML document

    Using XPath I can read a particular node of an XML document through JAVA program. However, is it possible to Update the value of the node, just read from XML doc, using XPath expressions ?

    That is blatant misinformation. Xpath is used all the time to select nodes from a document. The returned nodes are references to parts of the document, therefore this it should be easy to update any part of it having retrieved the required nodes.

  • XML Document initialization.

    Hi,
    I need to parse an XML document that I read Externally.
    Presently for testing I need to simulate this by hardcoding the xml from Web Dynpro :
    eg: Document xmlSimulate =
    <?xml version="1.0" encoding="iso-8859-1" ?>
    - <DecisionTree>
    +<Header>
    +<Body>
    </DecisionTree>
    Please let me know how I can do this ???
    Awaiting your kind responses.
    Regards,
    Mahesh

    Hi,
    to parse a xml document in java you can either use SAX or DOM. If you want to generate java objects by xml JAXB is a good choice. You can find very much tutorials on the web (try google).
    Regards
    Sebastian

Maybe you are looking for

  • How to export security settings from Acrobat Pro

    I'm transferring my Acrobat Pro to a new computer.  Is there a way to export the security settings (passwords) that I have stored and then import them into Acrobat Pro on my new computer? Thanks, Steve

  • JList & JDBC display problem. Help, and Thanks.

    I wrote the three parts of Code, want to display the a column of database. import java.awt.*; public class Application1      private boolean packFrame=false;      static           try                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");     

  • How to trigger a workflow notification when DESADV reaches a status 51.

    Hi, A notification to the a user should be sent when DESADV goes to a error status 51.  I'm in SAP6.0 : Basic type:  DELVRY05 Message type:  DESADV Idoc:  IDOCDESADV Event: inputErrorOccurred Task to be linked for the event : TS00008178 In SWETYPV th

  • How do I delete Face Smooch?? I uninstalled but it wont go away!!!

    Added Face smooch with Youtube downloader by mistake. Uninstalled both but face smooch will not go away. Reloaded face smooch, per website, and it still wont go away. Its not on CC Cleaner either. SOLVED! THANKS

  • Why not use xp

    If you only need occasional software access that needs to run on Windows, I assume  you can get by using older windows XP.  Why the posts of all you guys using the most modern version, Windows 7?  I just read the "Welcome to Snow Leopard" file, and i