How to extract a set of XML elements from an XML element

My XML, stored in a variable called v_XML_input, is as follows:
<Root>
  <PackageName>MY_PKG</PackageName>
  <ProcedureName>SAVE_ADJ_VALUES</ProcedureName>
    <Parameters> 
      <Parameter>
          <Name>p_xml_string</Name>
          <Value><DocumentElement>
                   <tblAdjustments>
                     <EmpID>41439</EmpID>
                     <UserNTID>APPUSER</UserNTID>
                     <Comment>TEST RECORD</Comment>
                     <Amount>2000</Amount>
                     <RecordType>R</RecordType> 
                   </tblAdjustments>
                  </DocumentElement>
          </Value>
      </Parameter>
    </Parameters>
</Root>I want to extract only whatever is between <Value> and </Value>. In this case just this:
                <DocumentElement>
                   <tblAdjustments>
                     <EmpID>41439</EmpID>
                     <UserNTID>APPUSER</UserNTID>
                     <Comment>TEST RECORD</Comment>
                     <Amount>2000</Amount>
                     <RecordType>R</RecordType> 
                   </tblAdjustments>
                  </DocumentElement>The actual values between the <Value> and </Value> may not always be these same elements; they may be strings, numerical values, or other XML values.
I've tried the following in a LOOP, and it works for other strings and numerical values, but I get a ORA-30625: method dispatch on NULL SELF argument is disallowed when trying to extract an XML value as a string.
v_sql_str := v_XML_input .extract('//Parameters/Parameter[position() = '||i||']/Value/text()') .getstringVal()||'''';Any help is appreciated...TIA!

Not sure what you are actually trying to accomplish.
What's wrong with
SQL> SELECT xmlserialize(content XMLTYPE
          ('<Root>
  <PackageName>MY_PKG</PackageName>
  <ProcedureName>SAVE_ADJ_VALUES</ProcedureName>
    <Parameters> 
      <Parameter>
          <Name>p_xml_string</Name>
          <Value><DocumentElement>
                   <tblAdjustments>
                     <EmpID>41439</EmpID>
                     <UserNTID>APPUSER</UserNTID>
                     <Comment>TEST RECORD</Comment>
                     <Amount>2000</Amount>
                     <RecordType>R</RecordType> 
                   </tblAdjustments>
                  </DocumentElement>
          </Value>
      </Parameter>
    </Parameters>
</Root>'
          ).extract('//Value/*') indent)xml
  FROM DUAL
XML                                                                                                                                                                                                                                                                                                        
<DocumentElement>                                                                                                                                                                                                                                                                                          
  <tblAdjustments>                                                                                                                                                                                                                                                                                         
    <EmpID>41439</EmpID>                                                                                                                                                                                                                                                                                   
    <UserNTID>APPUSER</UserNTID>                                                                                                                                                                                                                                                                           
    <Comment>TEST RECORD</Comment>                                                                                                                                                                                                                                                                         
    <Amount>2000</Amount>                                                                                                                                                                                                                                                                                  
    <RecordType>R</RecordType>                                                                                                                                                                                                                                                                             
  </tblAdjustments>                                                                                                                                                                                                                                                                                        
</DocumentElement> ?
Note: xmlserialize is not necessary and is there just for pretty printing the result.

Similar Messages

  • How to get the values of all elements and sub elements from  following xml

    how to get the values of all elements and sub elements from following xml...
    <?xml version="1.0" encoding="UTF-8" ?>
    <List_AML_Finacle xmlns="http://3i-infotech.com/Cust_AML_Finacle.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://3i-infotech.com/Cust_AML_Finacle.xsd List_AML_Finacle.xsd">
    <TransactionID>TransactionID</TransactionID>
    <Match>
    <Src_Matched_Field>Src_Matched_Field</Src_Matched_Field>
    <List_Matched_Field>
    <FSFM_Matches>
    <NUMBER>NUMBER</NUMBER>
    <TERROR>TERROR</TERROR>
    <TU>TU</TU>
    <NAMEU>NAMEU</NAMEU>
    <DESCRIPT>DESCRIPT</DESCRIPT>
    <KODCR>KODCR</KODCR>
    <KODCN>KODCN</KODCN>
    <AMR>AMR</AMR>
    <ADDRESS>ADDRESS</ADDRESS>
    <SD>SD</SD>
    <RG>RG</RG>
    <ND>ND</ND>
    <VD>VD</VD>
    <GR>GR</GR>
    <YR>YR</YR>
    <MR>MR</MR>
    <CB_DATE>CB_DATE</CB_DATE>
    <CE_DATE>CE_DATE</CE_DATE>
    <DIRECTOR>DIRECTOR</DIRECTOR>
    <FOUNDER>FOUNDER</FOUNDER>
    <TERRTYPE>TERRTYPE</TERRTYPE>
    </FSFM_Matches>
    <OfacMatchDetails>
    <UID>UID</UID>
    <TITLE>TITLE</TITLE>
    <SDNTYPE>SDNTYPE</SDNTYPE>
    <REMARKS>REMARKS</REMARKS>
    <ID_UID>ID_UID</ID_UID>
    <IDTYPE>IDTYPE</IDTYPE>
    <IDNUMBER>IDNUMBER</IDNUMBER>
    <IDCOUNTRY>IDCOUNTRY</IDCOUNTRY>
    <ISSUEDATE>ISSUEDATE</ISSUEDATE>
    <EXPIRATIONDATE>EXPIRATIONDATE</EXPIRATIONDATE>
    <ADDRESS1>ADDRESS1</ADDRESS1>
    <ADDRESS2>ADDRESS2</ADDRESS2>
    <ADDRESS3>ADDRESS3</ADDRESS3>
    <CITY>CITY</CITY>
    <STATEORPROVINCE>STATEORPROVINCE</STATEORPROVINCE>
    <POSTALCODE>POSTALCODE</POSTALCODE>
    <COUNTRY>COUNTRY</COUNTRY>
    </OfacMatchDetails>
    </List_Matched_Field>
    </Match>
    </List_AML_Finacle>

    avoid multi post
    http://forum.java.sun.com/thread.jspa?threadID=5249519

  • How to extract a folder (and its contents) from inside a zip file?

    There is a zip file which contains a folder inside it. The folder itself contains a few files. I would need to know how to extract the folder (with its contents) from inside a zip file.
    I have found a few unzipping code samples which show how to handle a folder inside a zip file. An example is shown below:
    public static void extract(String workingDirectory, byte[] zipFile)
    throws Exception {
    ByteArrayInputStream byteStream = new ByteArrayInputStream(zipFile);
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    ZipInputStream zipStream = new ZipInputStream(byteStream);
    ZipEntry zipEntry = null;
    String nameZipEntry = null;
    byte[] contentZiphttp://forum.java.sun.com/post!default.jspa?forumID=31#
    Click for code tagsEntry = null;
    boolean isDirectory = false;
    int indexFileSeparator = -1;
    String directory = null;
    String fileName =  null;
    while ( (zipEntry = zipStream.getNextEntry()) != null )
                nameZipEntry = workingDirectory + File.separator + zipEntry.getName();
                isDirectory = zipEntry.isDirectory();
                if (isDirectory) {
    File file = new File(nameZipEntry);
    file.mkdirs();
                else
                    // read zipEntry
                    byte[] buf = new byte[1024];
                    int c = 0;
                    while ( (c = zipStream.read(buf)) != -1)
                        out.write(buf, 0, c);
                    indexFileSeparator = nameZipEntry.lastIndexOf(File.separator);
                    directory = nameZipEntry.substring(0, indexFileSeparator);
                    fileName =  nameZipEntry.substring(indexFileSeparator+1,nameZipEntry.length());
                    FileSystemTools.createFile(directory, fileName, out);
                    out.reset();
                    zipStream.closeEntry();
            zipStream.close();
            byteStream.close();
    }The code sample which deals with the part where the zipEntry is a directory creates a directory with the same path and name. (highlighted in bold)
    Another similar variation is:
    File file = new File(dirDestiny.getAbsolutePath() + File.separator + zipEntry.getName() );
    if(zipEntry.isDirectory())
          file.mkdirs();When the code creates a directory for the folder, does it unzip the contents inside the folder as well?
    If not, how do I extract the files inside the folder?

    Have you already tried to see if the sample code you downloaded works or not? Maybe if you try out the code yourself you can see if it extracts files from a directory within a zip file?
    I like to use pkzip. It is a command line compression/uncompression tool that can be used from a batch file. If you assignment involves unzipping large amount of zip files on a regular basis, I recommend taking a look at pkzip.

  • Loading an xml file from an xml file

    I'm trying to load an xml file from an xml file, but I'm
    having problems. My first xml file is really simple - it only
    contains one attribute with the name of another xml file in it
    (eventually I will have multiple xml files in here and run a loop
    on them...this is why I want to load an xml file from an xml file).
    Currently, with the code below, I can get the main xml file
    to load ("main.xml"), but I cannot get the secondary xml files to
    load FROM the main.xml.
    I want to then take childNode values from the secondary xml
    file and use them within my .swf in text boxes and whatnot.
    Any guidance? I think I'm going wrong on the line where I'm
    saying "i.newxml.load(i.attributes.location);"
    - How can I get this to work?

    johnypeter:
    I tried changing the code inside the loop to use just
    "newxml" instead of "i.newxml", and I declared with "var newxml =
    new XML();" - was this what you were thinking?
    kglad:
    The reason I tried to use the loadXML() function in the loop
    was so that for each node in my "main.xml" it would load the new
    xml file listed - this is a no-no? Do you have any ideas as to what
    I could do?
    For the for-loop, what should I change in it? I'm not great
    with loops so I tried to modify some code from another loop I found
    in another forum thread - not the right way to do it here?
    Also, what should I trace? The value of the _root.address, or
    i.attributes.location? I have created dynamic text boxes on my
    stage to see if the correct value from the xml file loads (ie. the
    name of the xml file within the xml file) and it does, but now I
    don't know how to put that information into ANOTHER loadXML()
    function and get the node information from it - does that make
    sense???
    Below are the examples of the xml files I am using. In the
    first one, main.xml, I will have a list of multiple xml files, each
    with the same nodes and elements as in the details.xml file
    (different values, of course).
    This is just to give you an example of what I'm trying to
    accomplish - pulling ALL the addresses and phone numbers from
    multiple xml files. I cannot manually collect this information, as
    it is dynamic, and will be updated in each individual details.xml.
    I was hoping to collect the information by simply adding to and
    updating ONE xml file - main.xml.
    Do you think this can be done? Am I going about it the wrong
    way? I'm quite limited in AS knowledge, which is why I'm piecing
    together code from other posts!

  • Extracting elements from an xml string - org.apache.xerces.dom.DeferredText

    Hello all,
    I am new to xml, and I thought I had a handle on things until I got this problem...I am getting an xml string from the body of an e-mail message, and then I am trying to extract elements out of it. Here is an example xml string:
    <?xml version="1.0" encoding="UTF-8"?>
    <filterRoot>
       <filter action="MOVE" bool="AND" name="My Saved Filter" target="Deleted Items">
          <condition attribute="TO" bool="AND" contains="CONTAINS">
             <value>[email protected]</value>
             <value>[email protected]</value>
             <value>[email protected]</value>
             <value>[email protected]</value>
             <value>[email protected]</value>
          </condition>
       </filter>
    </filterRoot>I am trying to extract the <filter> element out and store it into a Vector of Elements (called, not surprisingly, filters). However, I am getting a class cast exception:
    java.lang.ClassCastException: org.apache.xerces.dom.DeferredTextImplIt is being called from where I trying to extract the <filter> in this way:
            filterRoot = doc.getDocumentElement(); // get topmost element
            NodeList list = filterRoot.getChildNodes();
            Vector newFilters = new Vector();
            debug("There are "+list.getLength()+" filters in document");
            for(int i=0; i<list.getLength(); i++) {
                Node n = list.item(i);
                debug("Node "+i+" getNodeValue() is "+n.getNodeValue());
                Element temp = (Element)n;
                newFilters.add(temp);
            }Perhaps my question is, how do I correctly get hold of the <filter> node so that I may cast it as an Element?
    thanks,
    Riz

    Yes, I already knew that it is not a bug.
    But, I got next step problem.
    I put "false" to "include-ignorable-whitespace" feature in xerces parser.
    But, I still found unnecessary TextNodes in my parser object.
    Feature link : http://xerces.apache.org/xerces-j/features.html.
    I use xerces-2_8_0.
    DOMParser parser = new DOMParser();
    parser.setFeature("http://apache.org/xml/features/dom/include-ignorable-whitespace", false);
    parser.parse(inputSource);
    document = ps.getDocument();
    System.out.println(document.getDocumentElement().getChildNodes().length()); // still wrong lengthIs tehre any example of usage this feature?
    What is default defination of white-space "\n "(enter with one space) or " "(juz white space) or something else?
    Thanks,

  • How do I return all elements from a xml doc?

    I have a xml document which in my VB code I am saving the elements(ns1:Statute) in a variable
    objXmlStatuteNode  then adding that variable in to an object
    objXmlStatutesDoc.
    My code is working but only displaying one element (<ns1:Statute>) even though I have 3 <ns1:Statute>. How do I display all 3 <ns1:Statute>?
    Here is my xml document modified version to make it short.
    <ns1:Statutes xmlns:ns1="http://crimnet.state.mn.us/mnjustice/statute/messages/4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <ns1:Statutes xmlns:ns1="http://crimnet.state.mn.us/mnjustice/statute/messages/4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <ns1:Statute>
    <StatuteId xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">12875</StatuteId>
    <Chapter xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">171</Chapter>
    <Section xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">22</Section>
    <Subdivision xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">1(7)</Subdivision>
    <Year xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">1994</Year>
    </ns1:Statute>
    <ns1:Statute>
    <StatuteId xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">12875</StatuteId>
    <Chapter xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">171</Chapter>
    <Section xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">22</Section>
    <Subdivision xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">1(7)</Subdivision>
    <Year xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">1994</Year>
    </ns1:Statute>
    <ns1:Statute>
    <StatuteId xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">12875</StatuteId>
    <Chapter xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">171</Chapter>
    <Section xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">22</Section>
    <Subdivision xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">1(7)</Subdivision>
    <Year xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">1994</Year>
    </ns1:Statute>
    </ns1:Statutes>
    Here is my vb code
    Public Class GetStatutes
    Shared Sub main()
    Dim objMessageProcessor As New MessageProcessor
    Dim objSchemasCollection As New Msc.Integration.MessageBroker.Library.v4.SchemasCollection
    Dim objTransformsCollection As New Msc.Integration.MessageBroker.Library.v4.TransformsCollection
    objMessageProcessor.ProcessInputQueue(False, False, objSchemasCollection, objTransformsCollection)
    End Sub
    'Child class MessageProcessor which inherits from main class GetStatutes
    Private Class MessageProcessor
    Inherits Msc.Integration.ServiceCatalog.Library.v4.SoapMessageProcessor
    Protected Overrides Sub ProcessMessage(ByRef aobjBroker As ServiceCatalog.Library.v4.Broker, ByRef aobjXMLInputSoapEnvelopeDoc As System.Xml.XmlDocument, ByRef aobjInstantiatedObjectsCollection As Microsoft.VisualBasic.Collection, ByRef aobjConsumer As ServiceCatalog.Library.v4.Consumer)
    MyBase.ProcessMessage(aobjBroker, aobjXMLInputSoapEnvelopeDoc, aobjInstantiatedObjectsCollection, aobjConsumer)
    Dim objXmlStatutesDoc As XmlDocument
    Dim objXmlStatuteNode As XmlNode
    Dim objNameTable As Xml.NameTable
    Dim objXMLNameSpaceManager As XmlNamespaceManager
    Dim objXmlBcaResponseDoc As XmlDocument
    Dim objXMLOutputSoapEnvelopeDoc As XmlDocument
    'set up the namespace manager
    objNameTable = New Xml.NameTable
    objXMLNameSpaceManager = New Xml.XmlNamespaceManager(objNameTable)
    objXMLNameSpaceManager.AddNamespace("soap", Msc.Integration.Utility.Library.v4.Soap.NamespaceUri(aobjBroker.SoapMessageVersion))
    objXMLNameSpaceManager.AddNamespace("wsa", Msc.Integration.Utility.Library.v4.Soap.WsaNamespaceUri(aobjBroker.SoapMessageVersion))
    objXMLNameSpaceManager.AddNamespace("ns1", "http://crimnet.state.mn.us/mnjustice/statute/messages/4.0")
    objXMLNameSpaceManager.AddNamespace("st", "http://crimnet.state.mn.us/mnjustice/statute/4.0")
    objXmlStatuteNode = aobjXMLInputSoapEnvelopeDoc.DocumentElement.SelectSingleNode("soap:Body/GetBCAStatuteRequest", objXMLNameSpaceManager)
    objXmlStatutesDoc = New XmlDocument
    'Get the statutes
    objXmlBcaResponseDoc = New XmlDocument
    objXmlBcaResponseDoc.Load("\\j00000swebint\mscapps\deve\appfiles\temp\BcaStatutes.xml")
    objXmlStatutesDoc = New XmlDocument
    objXmlStatutesDoc.AppendChild(objXmlStatutesDoc.CreateElement("Statutes"))
    objXmlStatutesDoc.DocumentElement.SetAttribute("runType", "Request")
    objXmlStatutesDoc.DocumentElement.SetAttribute("runDateTime", Format(Now, "yyyy-MM-ddTHH:mm:ss"))
    'Create a variable to store the statute element information ns1:Statute name space
    objXmlStatuteNode = objXmlBcaResponseDoc.DocumentElement.SelectSingleNode("ns1:Statute", objXMLNameSpaceManager)
    'Add the variable objXmlStatudeNode to the object objXmlStatuteDoc
    objXmlStatutesDoc.DocumentElement.AppendChild(objXmlStatutesDoc.ImportNode(objXmlStatuteNode, True))
    'Create the SOAP envelope to return the reply to the submitter
    objXMLOutputSoapEnvelopeDoc = aobjBroker.CreateSoapEnvelope("http://www.courts.state.mn.us/StatuteService/1.0/GetStatutesResponse", _
    Msc.Integration.Utility.Library.v4.Soap.GetReplyEndpointReference(aobjXMLInputSoapEnvelopeDoc), _
    objXmlStatutesDoc.DocumentElement, , aobjConsumer, _
    aobjXMLInputSoapEnvelopeDoc.DocumentElement.SelectSingleNode("soap:Header/wsa:MessageID", objXMLNameSpaceManager).InnerText)
    'Return the response to the requester
    aobjBroker.Reply(objXMLOutputSoapEnvelopeDoc)
    End Sub
    End Class
    End Class

    winkimjr2,
    Are you aware that there's a duplicate line in the XML? It won't work with that in there so I've modified it as shown here:
    <ns1:Statutes xmlns:ns1="http://crimnet.state.mn.us/mnjustice/statute/messages/4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <ns1:Statute>
    <StatuteId xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">12875</StatuteId>
    <Chapter xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">171</Chapter>
    <Section xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">22</Section>
    <Subdivision xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">1(7)</Subdivision>
    <Year xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">1994</Year>
    </ns1:Statute>
    <ns1:Statute>
    <StatuteId xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">12875</StatuteId>
    <Chapter xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">171</Chapter>
    <Section xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">22</Section>
    <Subdivision xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">1(7)</Subdivision>
    <Year xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">1994</Year>
    </ns1:Statute>
    <ns1:Statute>
    <StatuteId xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">12875</StatuteId>
    <Chapter xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">171</Chapter>
    <Section xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">22</Section>
    <Subdivision xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">1(7)</Subdivision>
    <Year xmlns="http://crimnet.state.mn.us/mnjustice/statute/4.0">1994</Year>
    </ns1:Statute>
    </ns1:Statutes>
    The following isn't a way that I'm proud to do but I couldn't manage to work out LINQ-To-XML all the way through it. Nevertheless, this will work:
    Option Strict On
    Option Explicit On
    Option Infer Off
    Imports System.IO.Path
    Imports <xmlns:NS1="http://crimnet.state.mn.us/mnjustice/statute/messages/4.0">
    Public Class Form1
    Private Class NS1
    Private _statuteID As Integer
    Private _chapter As Integer
    Private _section As Integer
    Private _subdivision As String
    Private _year As Integer
    Public Sub New(ByVal id As Integer, _
    ByVal chapter As Integer, _
    ByVal section As Integer, _
    ByVal subdivision As String, _
    ByVal year As Integer)
    _statuteID = id
    _chapter = chapter
    _section = section
    _subdivision = subdivision.Trim
    _year = year
    End Sub
    Public ReadOnly Property Chapter() As Integer
    Get
    Return _chapter
    End Get
    End Property
    Public ReadOnly Property Section() As Integer
    Get
    Return _section
    End Get
    End Property
    Public ReadOnly Property StatuteID() As Integer
    Get
    Return _statuteID
    End Get
    End Property
    Public ReadOnly Property Subdivision() As String
    Get
    Return _subdivision
    End Get
    End Property
    Public ReadOnly Property Year() As Integer
    Get
    Return _year
    End Get
    End Property
    End Class
    Private ns1List As New List(Of NS1)
    Private Sub Form1_Load(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles MyBase.Load
    Dim desktop As String = _
    My.Computer.FileSystem.SpecialDirectories.Desktop
    Dim xmlPath As String = _
    Combine(desktop, "Example.xml")
    GetNS1Data(xmlPath)
    Stop
    ' Now hover your mouse over "ns1List" above
    ' and expand it. You'll see your data.
    End Sub
    Private Sub GetNS1Data(ByVal filePath As String)
    If My.Computer.FileSystem.FileExists(filePath) Then
    Try
    Dim xDoc As XElement = XElement.Load(filePath)
    For Each sData As XElement In xDoc...<NS1:Statute>
    Dim id As Integer
    Dim chapter As Integer
    Dim section As Integer
    Dim subdivision As String = Nothing
    Dim year As Integer
    For Each element As XElement In sData.Elements
    Select Case element.Name.LocalName
    Case "StatuteId"
    If Not Integer.TryParse(element.Value, id) Then
    Throw New ArgumentException("The StatuteID could not be parsed.")
    End If
    Case "Chapter"
    If Not Integer.TryParse(element.Value, chapter) Then
    Throw New ArgumentException("The Chapter could not be parsed.")
    End If
    Case "Section"
    If Not Integer.TryParse(element.Value, section) Then
    Throw New ArgumentException("The Section could not be parsed.")
    End If
    Case "Subdivision"
    If String.IsNullOrEmpty(element.Value) OrElse element.Value.Trim = "" Then
    Throw New ArgumentException("The Subdivision could not be parsed.")
    Else
    subdivision = element.Value
    End If
    Case "Year"
    If Not Integer.TryParse(element.Value, year) Then
    Throw New ArgumentException("The Year could not be parsed.")
    End If
    End Select
    Next
    Dim instance As New NS1(id, chapter, section, subdivision, year)
    ns1List.Add(instance)
    Next
    Catch ex As Exception
    Throw
    End Try
    End If
    End Sub
    End Class
    I hope that helps. :)
    Still lost in code, just at a little higher level.

  • How to extract full list of Index Key from DB

    Hi there,
    Is anybody can tell me how to extract a full list of index key from my database and how to rebuild index for that full list.
    Thanks alot.

    Probably a bad idea, but in SQLPlus, you would do something like
    SPOOL SHOOTMEINTHEFOOT.SQL
    SET HEADING OFF
    SET PAGESIZE 0
    SELECT 'ALTER INDEX '||owner||'.'||object_name||' REBUILD;'
      FROM DBA_OBJECTS
    WHERE object_type='INDEX'
       AND NOT owner IN ('SYS', 'SYSTEM', 'MDSYS', {list others that should not be messed with})
    SPOOL OFF

  • How to extract tax amount in item level from a Purchase order

    Hi experts,
    How to extract the tax amount data for each item in a Purchase order.
    I am using the data sources 2lis_02_itm, 2lis_02_scl, 2lis_02_S012.
    Please provide me which data source brings this tax amount data in item level and also the technical
    field name of tax amount.
    <Removed by moderator - soliciting points for answers is frowned upon>
    Regards,
    Bhadri M.
    Edited by: Arun Varadarajan on Nov 14, 2008 3:55 PM

    Dear Bhadri
    Did you look 2LIS_13_VDKON data source whther it can throw or not for billing related. Here you should look some billing conditions relates to particular document like taxable or not.
    (KAWRT, KAWRT_K, BIWGEO)
    Those informations will be maintained each with billing conditions.
    May not sure. Please look.
    Raju Saravanan

  • How to extract one of several audio tracks from a .vob file?

    Hi guys,
    hope you can help me, i'm looking for a solution for hours now but can't find one.
    I would like to know how to extract one audio track from a .vob file when there are different tracks/languages on the dvd? Media encoder does it very well, but i can't find the option for choosing the right audio track/language for extraction. Please help
    Kind regards
    Alex

    This is because the OMF specification requires mono audio files
    It really depends on what you are trying to do with the two tracks as to the best answer as far as 'grouping'
    You could select all the clips on both tracks and right mouse click and select 'group'
    You could send both tracks to a bus
    You could export the two tracks to a stereo file and bring that back into the session
    Lots more things I'm sure but a little more detail as to what you are trying to do would help

  • How to create an XML fril from an XML instance

    i have already created an instance of the xml using the classes generated from
    the SCHEMA, how will i generate an xml file from the instance i have? is it the
    same like the marshalling/unmarshalling Castor is doing? help please!!!

    It worked, Thanks so much!
    "Steve Traut" <[email protected]> wrote:
    Manuel -- If you simply want to write out the XML you've created, you
    can
    use one of the save methods exposed by your generated XMLBeans types.
    For
    example, to write the XML out to a file, you might do this:
    File myFile = new File("c:/myXml.xml");
    try
    myNewXmlDoc.save(myFile);
    catch (java.io.IOException ioe)
    System.out.println("Error while writing my XML file");
    Note that other save methods are available to write to other formats.
    Steve
    "Manuel Pantaleon" <[email protected]> wrote in message
    news:3f9f9312$[email protected]..
    i have already created an instance of the xml using the classes generatedfrom
    the SCHEMA, how will i generate an xml file from the instance i have?is
    it the
    same like the marshalling/unmarshalling Castor is doing? help please!!!

  • How to extract the data into Excel / PDF from SAP

    Hi,
    We have spool number of a report output.
    We want to extract the data into Excel / PDF from SAP directly...
    Plz guide...

    Hi ,
    Please check this [Thread|HOW TO DOWNLOAD SAP OUTPUT TO EXCEL FILE;. Hope your problem will be solved.
    You can check [this also.|http://wiki.sdn.sap.com/wiki/display/sandbox/ToConvertSpoolDataintoPDFandExcelFormatandSenditinto+Mail]
    Thanks,
    Abhijit

  • How to extract extension of  file like (jpeg from c:\prashant.jpeg)

    hi
    please tel me that howa to extract file type  from path of file
    like  c:\prashant.jpeg
    thanks

    use this code....
    PARAMETERS: infile LIKE rlgrap-filename OBLIGATORY.
    DATA: txt1 TYPE char200,
          txt2 TYPE char4.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR infile.
      PERFORM file_browse.
    START-OF-SELECTION.
      SPLIT infile AT '.' INTO txt1 txt2.
      WRITE: txt2.
    *&      Form  FILE_BROWSE
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM file_browse .
      CALL FUNCTION 'F4_FILENAME'
         EXPORTING
           program_name        = syst-cprog
           dynpro_number       = syst-dynnr
    *   FIELD_NAME          = ' '
         IMPORTING
           file_name           = infile.
    ENDFORM.                    " FILE_BROWSE

  • Using REGEXP_REPLACE to remove XML data from between XML tags

    Hello there,
    I am trying to use the REGEXP_REPLACE SQL function on a piece of XML, to remove the actual XML data from the elements. My end goal is to end up with a comma-delimited list of XML element names. As part of the first step, I just want to rip out all the actual data.
    I tested the following query, and it initially appeared to work:
    SELECT REGEXP_REPLACE('&gt;THIS IS A TEST&lt;',
                          '&gt;([[:alnum:]]\s|\S)*&lt;',
                          '&gt;&lt;' ) AS test_result
      FROM dual;Unfortunately, when I applied this to a full XML string, it didn't work. Here is the test query I used:
    SELECT REGEXP_REPLACE('&lt;ROW&gt;&lt;TEST_ELEMENT1&gt;123&lt;/TEST_ELEMENT1&gt;&lt;TEST_ELEMENT2&gt;THIS IS A TEST!&lt;/TEST_ELEMENT2&gt;&lt;/ROW&gt;',
                          '&gt;([[:alnum:]]\s|\S)*&lt;',
                          '&gt;&lt;') AS test_result
      FROM dual;I ended up with the following output:
    *&lt;ROW&gt;&lt;/ROW&gt;*
    What I was trying for was:
    *&lt;ROW&gt;&lt;TEST_ELEMENT1&gt;&lt;/TEST_ELEMENT1&gt;&lt;TEST_ELEMENT2&gt;&lt;/TEST_ELEMENT2&gt;&lt;/ROW&gt;*
    If you're reading this and you're a Posix RegExp Guru, please could you let me know exactly where I'm going wrong? RegExps are not my strong point, but I'd like to get better at them.

    jmcnaug2 wrote:
    Just out of interest, how would you go about writing the XQuery function so that it returns the actual XML Element values in comma-delimited form (This is Oracle Canonical XML, so has a very basic layout)? ;)Do you mean like this ?
    SQL> SELECT xmlquery(
      2    'for $i in $d/ROWSET/ROW
      3     return string-join($i/*, ",")'
      4    passing dbms_xmlgen.getXMLType('SELECT employee_id, last_name, first_name FROM employees WHERE rownum < 10') as "d"
      5    returning content
      6  ).getClobVal() as csv
      7  FROM dual;
    CSV
    100,King,Steven
    101,Kochhar,Neena
    102,De Haan,Lex
    103,Hunold,Alexander
    104,Ernst,Bruce
    105,Austin,David
    106,Pataballa,Valli
    107,Lorentz,Diana
    108,Greenberg,Nancy
    SQL>

  • Creating an XML instance from an XML Schema

    Hello,
    Does anyone know how to create a skeleton XML instance from the mandatory fields taken from an XML Schema?
    There might be a way with XSLT, however I cannot find the relevant tutorials for this issue.
    Can you please help me out?
    Thanks.

    Of course I meant how to achieve this "on the fly" using XSLT and Java.

  • Read xml-structure from a xml-document stored in a xmltype-column?

    Hello,
    I have several xml-documents stored in a table with a xmltype-column.
    Is it possible to read the structure of one xml-document? I need to know what data are exists in the xml-documents.
    I had read some hours here, but I dont find a suitable solution for that.
    To make a example, what I need:
    I have stored the following xml-document in the table:
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="6">
    <EMPLOYEE_ID>105</EMPLOYEE_ID>
    <FIRST_NAME>David</FIRST_NAME>
    <LAST_NAME>Austin</LAST_NAME>
    <EMAIL>DAUSTIN</EMAIL>
    <PHONE_NUMBER>590.423.4569</PHONE_NUMBER>
    <HIRE_DATE>6/25/1997 0:0:0</HIRE_DATE>
    <JOB_ID>IT_PROG</JOB_ID>
    <SALARY>4800</SALARY>
    <MANAGER_ID>103</MANAGER_ID>
    <DEPARTMENT_ID>60</DEPARTMENT_ID>
    </ROW>
    </ROWSET>
    I need to return the following:
    ROWSET
    ...ROW
    ......EMPLOYEE NUMBER
    ......FIRST_NAME VARCHAR2
    ......DEPARTMENT_ID NUMBER
    Regards,
    Mark

    Hi,
    I was on a wrong way. The datatype is not stored in xml, this was a mistake from me.
    I needed something to printout some values from a xml-file. This xml-file was generated bei MS Excel. The data are in /Workbook/Worksheet/Table/Cell and I didnt know how to access it.
    I write for that the following:
    DECLARE
    v_xml XMLType;
    v_doc dbms_xmldom.DOMDocument;
    v_node dbms_xmldom.DOMNode;
    type t_values is table of varchar2(2000) index by binary_integer;
    v_values t_values;
    type t_table is table of t_values index by binary_integer;
    v_table t_table;
    procedure node_output (v_node in out dbms_xmldom.DOMNode)
    is
    v_nodelist1 DBMS_XMLDOM.DOMNodeList;
    v_nodelist2 DBMS_XMLDOM.DOMNodeList;
    v_anzahlnodes number;
    v_anzahlrows number;
    v_node_c dbms_xmldom.DOMNode;
    v_xmlmitarbeiterid number;
    begin
    v_nodelist1 := dbms_xmldom.GETCHILDNODES(v_node);
    v_anzahlrows := DBMS_XMLDOM.GETLENGTH(v_nodelist1);
    if v_anzahlrows = 0 or DBMS_XMLDOM.GETNODENAME(v_node) = 'Table'
    then
    if v_anzahlrows > 0
    then
    for i1 in 0..v_anzahlrows - 1
    loop
    v_node := dbms_xmldom.Item(v_nodelist1,i1);
    v_nodelist2 := dbms_xmldom.GETCHILDNODES(v_node);
    v_anzahlnodes := DBMS_XMLDOM.GETLENGTH(v_nodelist2);
    for i2 in 0..v_anzahlnodes - 1
    loop
    v_node := dbms_xmldom.Item(v_nodelist2,i2);
    v_node_c := dbms_xmldom.GETFIRSTCHILD(v_node);
    v_node_c := dbms_xmldom.GETFIRSTCHILD(v_node_c);
    v_values(i2) := DBMS_XMLDOM.GETNODEVALUE(v_node_c);
    end loop;
    v_table(i1) := v_values;
    end loop;
    for i1 in 1..v_anzahlrows - 1
    loop
    select SEQ_XMLMITARBEITER.nextval into v_xmlmitarbeiterid from dual;
    for i2 in 1..v_table(i1).count - 1
    loop
    dbms_output.put_line(v_table(i1)(i2));
    end loop;
    end loop;
    end if;
    else
    v_node := dbms_xmldom.GETFIRSTCHILD(v_node);
    for i in 0..v_anzahlrows - 1
    loop
    v_node := dbms_xmldom.Item(v_nodelist1,i);
    node_output(v_node);
    end loop;
    end if;
    end;
    BEGIN
    select inhalt into v_xml FROM xmlimport WHERE name = 'F23973/mitarbeiter.xml';
    v_doc := dbms_xmldom.newDOMDocument(v_xml);
    v_node:= dbms_xmldom.makeNode(dbms_xmldom.getDocumentElement(v_doc));
    node_output(v_node);
    END;
    This gives me all data from a xml-Excel-file. Is there a better way to do that? I have Oracle 10.2.
    Regards,
    Mark

Maybe you are looking for