Validation of an XML document using an XMLSchema !

Hi all,
i have an xml document and an XmlSchema.
Well, my mission is validate the xml document using the XmlSchema and give the message true or false to the user.
What is the best,easier and faster way to do this ?
Cheers.
Stefano

I would like to do the same thing only I would like to use JAXP. The JAXP 1.2 samples show the following code to accomplish this:
final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
//create and configure SAX parser factory
SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setNamespaceAware(true);
spf.setValidating(true);
//create and configure SAX parser
SAXParser saxParser = spf.newSAXParser();
saxParser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
saxParser.setProperty(JAXP_SCHEMA_SOURCE, new File(schemaSource));
//parse XML document
saxParser.parse(new InputSource(xmlURI), myDefaultHandler);
However, I would like to use the default Crimson parse that ships with J2SE 1.4. Is there a way to accomplish this using the default Crimson parser that only support JAXP 1.1?

Similar Messages

  • Error while loading an XML document using a structured application

    Hi,
    I try to load an XML document using a structured application defined in the default structapps.fm
    My code is shown down, extracted from the FDK API code sample.
    Problem, I always have the same message :
    "Cannot find the file named e:\xml\AdobeFrameMaker10\file. Make sure that the file exists. "
    Where "e:\xml\AdobeFrameMaker10\" is my install directory.
    So I assume that frame try to find the structapps.fm file but does not find it.
    What else can it be ?
    Does anyone knowns how to achieve this simple task using extendScript ?
    Thanks for any comments, Pierre
    function openXMLFile(myLastFile) {
        var filename = myLastFile.openDlg("Choose XML file ...", "*.xml", false);
        if (filename != null) {
            /* Get default open properties. Return if it can’t be allocated. */
            var params = GetOpenDefaultParams();
            /* Set properties to open an XML document*/
            /*Specify XML as file type to open*/
            var i = GetPropIndex(params, Constants.FS_OpenAsType)
            params[i].propVal.ival = Constants.FV_TYPE_XML;
            /* Specify the XML application to be used when opening the document.*/
            i = GetPropIndex(params, Constants.FS_StructuredOpenApplication)
            params[i].propVal.sval = "myApp";
            i = GetPropIndex(params, Constants.FS_FileIsOldVersion)
            params[i].propVal.ival = Constants.FV_DoOK
            i = GetPropIndex(params, Constants.FS_FontNotFoundInDoc)
            params[i].propVal.ival = Constants.FV_DoOK
            i = GetPropIndex(params, Constants.FS_FileIsInUse)
            params[i].propVal.ival = Constants.FV_DoCancel
            i = GetPropIndex(params, Constants.FS_AlertUserAboutFailure)
            params[i].propVal.ival = Constants.FV_DoCancel
            /*The structapps.fm file containing the specified application must have
            already been read. The default structapps.fm file is read when FrameMaker is
            opened so this shouldn't be a problem if the application to be used is
            listed in the structapps.fm file.*/
            var retParm = new PropVals()
            var fileObj = Open(filename, params, retParm);
            return fileObj
        } else {
            return null;

    Pierre,
    Depending on the object "myLastFile", the method openDlg might not even exist (if the myLastFile object is not a File object, for instance). And I do not see any need for the myLastFile anyhow, as you are presenting a dialog to select a file to open. I recommend using the global ChooseFile( ) method instead. This will give you a filename as string in full path notation, or null when no file was selected in the dialog. I am not sure what your ExtendScript documentation states about the return value for ChooseFile, but if that differs from what I am telling you here, the documentation is wrong. So, if you replace the first lines of your code with the following it should work:
    function openXMLFile ( ) {
        var filename = ChooseFile ( "Choose XML file ...", "", "*.xml", Constants.FV_ChooseSelect );
    While writing this, I see that Russ has already given you the same advice. Use the symbolic constant value I indicated to use the ChooseFile dialog to select a single file (it can also be used to select a directory or open a file - but you want to control the opening process yourself). Note that this method allows you to set a start directory for the dialog (second parameter). The ESTK autocompletion also gives you a fifth parameter "helplink" which is undocumented and can safely be ignored.
    Good luck
    Jang

  • How to fill an oracle CLOB with a XML document using Unicode UTF8

    Hi,
    I'm working with C# and oracle database v8.1.7 (release 3), and i'm having some problems to fill correctly an oracle CLOB parameter with XML document using UTF8 encoding.
    It works fine with "Encoding.Unicode" but not with "Encoding.UTF8". The problem is that i can't use Unicode (UTF16) with oracle 8.
    Can someone help me ? Thanks.
    Here is my code.
    OracleTransaction tx = conn.BeginTransaction();
    OracleCommand cmd = conn.CreateCommand();
    cmd.Transaction = tx;
    cmd.CommandText = "declare xx clob; begin dbms_lob.createtemporary(xx, false, 0); :tempclob := xx; end;";
    cmd.Parameters.Add(new OracleParameter("tempclob", OracleType.Clob)).Direction = ParameterDirection.Output;
    cmd.ExecuteNonQuery();
    OracleLob tempLob = (OracleLob)cmd.Parameters[0].Value;
    MemoryStream MemStrm = new MemoryStream();
    XmlTextWriter writer = new XmlTextWriter(MemStrm, Encoding.UTF8);
    writer.Formatting = Formatting.Indented;
    WriteXMLExample(writer, "MSFT", 74.125, 5.89, 69020000);
    writer.Close();
    cmd.Parameters.Clear();
    cmd.CommandText = "test_xml";                    
    cmd.CommandType = CommandType.StoredProcedure;
    tempLob.Write(MemStrm.GetBuffer(), 0, MemStrm.GetBuffer().Length );
    tempLob.Position = 0;
    cmd.Parameters.Add(new OracleParameter("xml_inout", OracleType.Clob)).Value = (OracleLob) tempLob;
    cmd.ExecuteNonQuery();
    Console.WriteLine( "Param 0 = " + cmd.Parameters[0].Value.ToString() );
    tx.Commit();

    Hi,
    I'm working with C# and oracle database v8.1.7 (release 3), and i'm having some problems to fill correctly an oracle CLOB parameter with XML document using UTF8 encoding.
    It works fine with "Encoding.Unicode" but not with "Encoding.UTF8". The problem is that i can't use Unicode (UTF16) with oracle 8.
    Can someone help me ? Thanks.
    Here is my code.
    OracleTransaction tx = conn.BeginTransaction();
    OracleCommand cmd = conn.CreateCommand();
    cmd.Transaction = tx;
    cmd.CommandText = "declare xx clob; begin dbms_lob.createtemporary(xx, false, 0); :tempclob := xx; end;";
    cmd.Parameters.Add(new OracleParameter("tempclob", OracleType.Clob)).Direction = ParameterDirection.Output;
    cmd.ExecuteNonQuery();
    OracleLob tempLob = (OracleLob)cmd.Parameters[0].Value;
    MemoryStream MemStrm = new MemoryStream();
    XmlTextWriter writer = new XmlTextWriter(MemStrm, Encoding.UTF8);
    writer.Formatting = Formatting.Indented;
    WriteXMLExample(writer, "MSFT", 74.125, 5.89, 69020000);
    writer.Close();
    cmd.Parameters.Clear();
    cmd.CommandText = "test_xml";                    
    cmd.CommandType = CommandType.StoredProcedure;
    tempLob.Write(MemStrm.GetBuffer(), 0, MemStrm.GetBuffer().Length );
    tempLob.Position = 0;
    cmd.Parameters.Add(new OracleParameter("xml_inout", OracleType.Clob)).Value = (OracleLob) tempLob;
    cmd.ExecuteNonQuery();
    Console.WriteLine( "Param 0 = " + cmd.Parameters[0].Value.ToString() );
    tx.Commit();

  • Validating an XML document using external DTD?

    Hi,
    I want to validate an XML file using external DTD with SAX parser.
    How can I validate an XML file with external DTD.
    Thanks in Advance,
    Mahendra

    I dont think we can set a DTD file throug java while
    parsing an XML.I've done it with an XML schema though. Can you use that instead? For schemas you do something like:
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setAttribute( "http://java.sun.com/xml/jaxp/properties/schemaSource",
                                       schemaUrl );where schemaUrl in this case would be something like file:///usr/local/whatever.xsd

  • How  to  send a  XML document using HTTPurlconnection as a  post

    Dear Guru's ,
    I am trying ot send a xml document to a httpserver
    using httpurl connection ..
    It works fine locally ..but over the net it is throwning an exception ..java.io.interupted exception ..
    any ideas .. please send me the code if possible
    Thanks in advance

    Are you opening the input stream or querying the reply headers after writing to the output stream? It's doing one or the other that actually triggers the send.

  • Parse an Aggregate in XML Document using PL/SQL

    Hi. I've been successful with parsing a TAG in XML Document stored in CLOB using PL/SQL XML Parser.
    However, I need help on how to get the whole aggregate in XML Document stored in CLOB.
    sample XML Doc :
    <library>
    <book>
    <title>Oracle Complete Reference</title>
    <author>Kevin</Author>
    <year>2000</year>
    </book>
    <video>
    <title>Learning C++</title>
    <length>2 hours</length>
    <video>
    </library>
    I need a function that will accept an Input which is the aggregate name and will return the aggregate value.
    With the sample XML above, say the input is 'VIDEO', the function will return :
    <video>
    <title>Learning C++</title>
    <length>2 hours</length>
    <video>
    I'll really appreciate any help.
    null

    I used such an example to parse several Varchar2 strings in a given DB session:
    BEGIN
    parser := xmlparser.newparser ;
    xmlparser.parsebuffer(parser,xmlout) ;
    domdoc := xmlparser.getDocument(parser) ;
    xmlparser.FREEPARSER(parser) ;
    parser.id := -1 ;
    nodes := xslprocessor.selectNodes(
    xmldom.makenode(domdoc),
    'Positionen/Position') ;
    for i in 1 .. xmldom.getLength(nodes) loop
    node := xmldom.item(nodes,i-1) ;
    -- do s/thing with the node
    end loop ;
    xmldom.freedocument(domdoc) ;
    RETURN(komponenten) ;
    EXCEPTION
    WHEN OTHERS THEN
    if parser.id <> -1 then xmlparser.freeparser(parser) ;
    end if ;
    if domdoc.id <> -1 then xmldom.freedocument(domdoc) ;
    end if ;
    RAISE ;
    END ;
    However, after about 2000 of nodes lists parsed, I get an ArrayIndexOutOfBoundsException from XMLNodeCover. Obviously, I should release the nodes or the nodelist, but I have not found any procedure to do this.
    Pascal

  • Merging XML documents using DOM

    I have 300 XML documents to merge. They contain structures such as:
    1.xml=
    <MIM>
    <MIM-ENTRY>
    <MIM-NUMBER>123456
    </MIM-NUMBER>
    </MIM-ENTRY>
    </MIM>
    2.xml =
    <Mim>
    -<Mim-entry>
    <Mim-title>*604176 SUPPRESSOR OF CYTOKINE SIGNALING 3</Mim-title>
    </Mim-entry>
    </Mim>
    3.xml=
    <Mim>
    <Mim-entry>
    <Mim-alternative_titles_and_symbols>
    <Mim-alternative_titles_and_symbols-alt>SOCS3</Mim-alternative_titles_and_symbols-alt>
    </Mim-alternative_titles_and_symbols>
    </Mim-entry>
    </Mim>
    all the XML files have this sort of structure.
    Essentailly, I need to merge them (using the above as an example) to get:
    <MIM>
    <MIM-ENTRY>
    <MIM-NUMBER>123456</MIM-NUMBER>
    <Mim-title>*604176 SUPPRESSOR OF CYTOKINE SIGNALING 3</Mim-title>
    <Mim-alternative_titles_and_symbols>
    <Mim-alternative_titles_and_symbols-alt>SOCS3</Mim-alternative_titles_and_symbols-alt>
    </Mim-alternative_titles_and_symbols>
    </Mim-entry>
    </MIM>
    I have all the trees stored in a Vector as DOM objects.
    Anyone have any ideas how to merge these documents as stated?
    Any help would be most appriciated

    Ah, think im begining to get you. And if I am undertstanding you correctly it might not solve my problem.
    Ok, so the files exist as follows:
    file1.xml
    <MIN>
    <MIM-1>
    <MIM-2>something
    </MIM-2>
    </MIM-1>
    </MIM>
    file2.xml
    <MIN>
    <MIM-1>
    <MIM-3>somethingelse
    </MIM-3>
    </MIM-1>
    </MIM>
    merged to give:
    <MIN>
    <MIM-1>
    <MIM-2>something
    </MIM-2>
    <MIM-3>somethingelse
    </MIM-3>
    </MIM-1>
    </MIM>
    SO....
    I have to bring out the nodes <MIM-2> from file1.xml and import them. in file2 appendChild will be applied to <MIM1> using those nodes.
    This is really not what i was looking for.
    I wanted to throw everything together. Reason? I will be merging over 300 xml documents all of which will be inserting elements at different depths. This method you describe (i think) will need the specific nodes to be extracted from each and every DOM structure. This might not be possible as the XML stuctures will change depend on the program circumstances.
    I would like to just to put all the DOMS together and Tags of the same name will simply merge. to give the output above.
    Or does method you descibed this actually do this?
    I apologise for my stupidity in advance.
    litkid

  • Writing XML document using form values

    Being new to java/xml I'm strugling with this task:
    I have a web form and I need to pass the values from the form to a class that will then create an xml file using the form values.
    I've looked through the JAXP tutorial and Sun's XML tutorial but can't find anything that would suit my needs.
    Could anyone help me on how I should go about doing this?
    Does anyone have any sample code?

    with JAXP, you can either :
    - build a new XML document from scratch, using DOM, and append each node, each value,
    - create a style sheet that generates an XML document, receiving the web form values as parameters, processed with XSLT.

  • How to use OAF transform sotred xml documents using XSLT...

    Does anyone have any experience using XSLT in OAF? Specifically, I have xml documents stored in a clob to which I wish to apply an XSLT transformation and then store the transformed documents back into the clob. Is there a way to apply an XSLT transformation using say BI-Publisher via OAF?

    "XML DIFF" are the keywords you can use to search for products that do this. Last time I looked there was a lot of XML Diff implementations, but none of them produced human-readable output that I really liked. I expect that's because XML diff is an easy thing for people to ask for but not an easy thing to do, given the considerable number of ways there are to change a document.

  • 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.

  • Loading/breaking large files containing multiple XML documents using plsql

    Hi I have a requirement where in the client sends the multiple xml payloads/documents in a single text file. I need to load that into the xmltype varialbe. How to do this?
    I'm able to load the entire document into a clob object, here.. all the xml payloads are loaded into a single row. When I try to access this I get a error
    ORA-31001: Invalid resource handle or path name "/MobileInventoryResponse.dtd"
    ORA-06512: at "SYS.XMLTYPE", line 254
    ORA-06512: at line 1
    This error is due to the dtd present in the xml document : <!DOCTYPE MobileInventoryResponse SYSTEM "MobileInventoryResponse.dtd">
    But if I load the data into a clob after removing the doctype reference then I get the following error. Here to mulitple xml documents are loaded into a single clob row.
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00209: PI names starting with XML are reserved
    Error at line 81
    ORA-06512: at "SYS.XMLTYPE", line 254
    ORA-06512: at line 1
    When try to access this by using select xmltype(x) from t
    where x is column type of clob.
    Please let me know any method or type loading the multiple xml documents by using plsql. Only plsql method. There is a way by using SAX Loader. But can it be used in plsql or its a java method of loading.
    Regards,
    Naveen
    Edited by: MAN on Oct 18, 2008 9:21 PM

    sorry for that...
    There was enter character between some tags. From there I'm not receiving that particular error.
    Now what I get is
    ORA-31001: Invalid resource handle or path name "/MobileInventoryResponse.dtd"
    ORA-06512: at "SYS.XMLTYPE", line 254
    ORA-06512: at line 1
    ORA-06512: at line 39
    This is because there is a doctype at the start of the xml payload.
    But if there is no <!DOCTYPE MobileInventoryResponse SYSTEM "MobileInventoryResponse.dtd"> this statement then it works fine.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE MobileInventoryResponse SYSTEM "MobileInventoryResponse.dtd">
    <MobileInventoryResponse>
    And this exercise I'm doing in my Windows xp loaded operating system with a local instance of oracle ... Do i need to do any other setting.
    Along with that I followed your method mentioned @ Re: LPX-00209: PI names starting with XML are reserved
    ignore:=dbms_xdb.createResource('/MobileInventoryResponse.dtd',bfilename('XML_DIR','MobileInventoryResponse.dtd'));
    And I'm not getting how it will refer the this resource.
    this above partilcular statement . should it be executed when ever we insert into the table ? But in the dtd there is no word saying "MobileInventoryResponse".
    got this error.
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00104: Warning: element "MobileInventoryResponse" is not declared in the DTD
    Error at line 1
    ORA-06512: at "SYS.XMLTYPE", line 254
    ORA-06512: at line 1
    ORA-06512: at line 21
    This is how I'm doing in the block
    DECLARE
    l_filehandle UTL_FILE.FILE_TYPE;
    l_filename VARCHAR2(50):='test.xml';
    l_rec_data VARCHAR2(500);
    l_rec_trim_data VARCHAR2(500);
    l_rec_trim_upper VARCHAR2(500);
    l_rec_full_data CLOB;
    ignore boolean;
    BEGIN
    l_filehandle := UTL_FILE.FOPEN('XML_DIR',l_filename,'R');
    --dbms_xdb.deleteResource('/MobileInventoryResponse.dtd',dbms_xdb.DELETE_RESOURCE   );
    LOOP
    ignore:=dbms_xdb.createResource('/MobileInventoryResponse.dtd',bfilename('XML_DIR','MobileInventoryResponse.dtd'));
    commit;
    UTL_FILE.GET_LINE(l_filehandle, l_rec_data);
    --dbms_output.put_line('l_rec_data : '|| l_rec_data);
    -- Trim the record to remove spaces
    l_rec_trim_data := TRIM(l_rec_data);
    l_rec_trim_upper := UPPER(l_rec_trim_data);
    l_rec_full_data := l_rec_full_data||l_rec_data;
    IF l_rec_trim_upper LIKE '</MOBILEINVENTORYRESPONSE>' THEN
    dbms_output.put_line('l_rec_full_data : '||l_rec_full_data);
    INSERT INTO library_xml VALUES(xmltype(l_rec_full_data));
    l_rec_full_data:=NULL;
    END IF;
    dbms_xdb.deleteResource('/MobileInventoryResponse.dtd',dbms_xdb.DELETE_RESOURCE );
    commit;
    END LOOP;
    UTL_FILE.FCLOSE(l_filehandle);
    COMMIT;
    --exception just for testing purpose
    EXCEPTION
    WHEN no_data_found THEN
    NULL;
    commit;
    END;
    Edited by: MAN on Oct 21, 2008 2:47 AM

  • 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.

  • Updating XML document using DOM only updates in memory

    I am trying to update an element value but it only gets updated in the memory and displayed. It does not physically change the xml document when I look after running the program.
    Here is the code I am trying to run :
    Please let me know what I am doing wrong.
    static private Document findReplace(Document document, String elementName,
    String valueToFind, String valueToReplace)
    int i;
    int k;
    NodeList children;
    Element docRoot= document.getDocumentElement(); // get root
    NodeList elements = docRoot.getElementsByTagName(elementName);
    if (elements !=null)
         for (i=0;i<elements.getLength(); i++)
         if (elements.item(i).hasChildNodes())
         children = elements.item(i).getChildNodes();
    for(k=0;k<children.getLength(); k++)
              if (children.item(k).getNodeType() ==
                   org.w3c.dom.Node.TEXT_NODE){
              if(children.item(k).getNodeValue().equals(valueToFind))
         children.item(k).setNodeValue(valueToReplace);
    Thanks !

    Document document;
                   TransformerFactory tFactory =
                    TransformerFactory.newInstance();
                   Transformer transformer = tFactory.newTransformer();
                   DOMSource source = new DOMSource(document);
                   StreamResult result = new StreamResult(new File
                   (c:/output/outputXml.xml));
                   transformer.transform(source, result);

  • How to read from xml documents using either sax or dom

    dear all
    i have an xml document and i want to create a procedure to read the data from it .
    is it possible or not? thanks in advance

    Where is the xml document located?
    load it into an XMLTYPE and apply xpath as required.
    SQL> declare
      2    xml xmltype ;
      3  begin
      4    xml := xmltype('<node><value>this is text</value></node>') ;
      5    dbms_output.put_line('value='||xml.extract('/node/value/text()').getStringVal()) ;
      6  end ;
      7  /
    value=this is text
    PL/SQL procedure successfully completed.
    SQL>

  • Validation when posting a document using T. Code FB50 or F-02

    Dear Experts
    Please let me know on how to validate when posting a Cross Company Transaction using T. Codes FB50 or F-02.  The requirement is to restrict Branches (each Branch is a Company Code in SAP) to post any Cross Company documents by selecting HO Company Code in Line Item, system has to stop the User by giving Error Message.
    We can't control this using User level Authorizations because, here the Authorization is provided to the Users to post the Transactions using T. Codes FB50 and F-02.
    To restrict this, I created a Validation as below:
    Prerequisite:
    BKPF-TCODE = 'FB50' OR BKPF-TCODE = 'F-02' AND
    BKPF-BUKRS = 'Br. Company Code' AND
    BSEG-BUKRS = 'HO Company Code'
    Check:
    FALSE
    Message:
    You Can't post Cross Company Transactions using T.Code FB50 or F-02
    And I activated the above Validation in OB28 for HO and Branch Company Codes.  But the Validation is not working properly.  Can anybody help me on how to proceed further in this regard please.

    Hi,
    I haven't tried to use a transaction code for Validation purpose. Instead, I have used document type as prerequisite and then check:
    BKPF-BUKRS = 'Br. Company Code' AND
    BSEG-BUKRS = 'HO Company Code'
    If the condition is met, it displays an error (per the message in validation) while completing the line item details on posting a document.
    Please let me know if that helps. If not, I can try to replicate your scenario and let you know if there is anything missing.
    Thanks,
    Ashish

Maybe you are looking for

  • Safari quits unexpectedly whenever I try to open it

    For a while now, whenever I try to open Safari, it crashes, or "quits unexpectedly". As soon as I click the Safari button on my dock, the icon jumps up and down a couple of times, but then suddenly, the page pops up with "Safari quit unexpectedly". I

  • Error while deploying application on portal domain

    Hi All, I am getting following error while deploying application on portal domain :( :( Not sure what I am missing....... Anyone has any idea on this??? <Oct 6, 2010 7:49:03 AM EDT> <Warning> <com.bea.wlw.netui.pageflow.internal.WebLogicURLTemplateFa

  • Need of F4 help in single values section of select options

    I need to select more than one file as input from application server. For this i used a select option field(with multiple option) and i provided F4 help by using the function module /SAPDMC/LSM_F4_SERVER_FILE in at selection screen value request. Her

  • Query Botton

    hi, I have created a form based on a procedure.There are to buttons(Submit and Reset) created by default. But I need a query button in this form. How to do it? Thinks Frank

  • HT201280 Numbers help

    I am trying to name a sheet but cant work out how. It just says Sheet1. How do i change it?