[Solved] Parsing findmnt output?... Is it reliable/portable in bash.

Solution/better suggestion in second post...
There seems to be little about using anything other than the output of mount or fstab when dealing with filesystems in scripting. Most of what I've read on it uses awk or cut for parsing "mount" but what about findmnt when needing  some of the same info. particularly "findmnt -rn" which prints the same raw information as mount but space separated and without the words like "type" and "on". I'm not entrirely concerned with posix compliance as most of it amount to makings it compatible with much much older systems. Personally I think bash has been around long enough to be portable in and of itself in most circumstances but that's just my opinion. Is "findmnt" as portable as "mount" for scripting? that is really my question.
An example would be say I wanted only the "target" and "source" information stored with process substitution in bash.
with mount I could use
#mount | cut -d ' ' -f 1,3
to get that info for all mounted filesystems
OR
#mount | grep sdb1 | cut -d ' ' -f 3
to get where a particular partition (/dev/sdb1) is mounted.
with findmnt it would be just as simple but take the words "on" and "type" out of the parsing.
#findmnt -rn | cut -d ' ' -f 1,2
or for the second example using mount...
#findmnt -rn | grep sdb1 | cut -d ' ' -f 1
if neither of these are the best for getting simple information then I can accept other suggestions as well.
Think of the pipe to grep section having a variable with the needed string instead of "sdb1" for instance...
maybe this is just a minor formatting discrepancy. If so feel free to point it out... I'm kinda on my journey of do's and don't's in shell scripting with only google and the man pages as my resources for learning.
Last edited by Thme (2012-12-22 19:55:58)

falconindy wrote:
Thme wrote:
with findmnt it would be just as simple but take the words "on" and "type" out of the parsing.
#findmnt -rn | cut -d ' ' -f 1,2
or for the second example using mount...
#findmnt -rn | grep sdb1 | cut -d ' ' -f 1
This is an entire misuse of findmnt. If you're going to talk about "portable" or "POSIX", then you can't even use mount.
If you want specific columns from findmnt, then ask for them. Specifically, the -o option is your friend, i.e.
$ findmnt -runo source,target /dev/sdb1
/dev/sdb1 /home
If you're looking for some absurd level of portability where you might encounter systems that don't have findmnt, then you'll need to build a parser for /etc/mtab, and even that isn't portable.
That's clear enough to me. And no I wasn't too interested in POSIX compliance. It seems like overkill in most circumstances. As for the findmnt options.. I should have read the man page a little more... totally skimmed over it... I'll mark this as solved...

Similar Messages

  • How do I create individual xml files from the parsed data output of a xml file?

    I have written a program (DOM Parser) that parses data from a XMl File. I would like to create an individual file with the corresponding name for each set of data parsed from the xml document. If the parsed output is Single, Double, Triple, I would like to create an individual xml file (Single.xml, Double.xml, Triple.xml)with those corresponding names. How do I create the xml files and give each file the name of my parsed data output? Thanks in advance for your help.
    import java.io.IOException;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.xml.sax.SAXException;
    public class MyDomParser {
      public static void main(String[] args) {
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      try {
      DocumentBuilder builder = factory.newDocumentBuilder();
      Document doc = builder.parse("ENtemplate.xml");
      doc.normalize();
      NodeList rootNodes = doc.getElementsByTagName("templates");
      Node rootNode = rootNodes.item(0);
      Element rootElement = (Element) rootNode;
      NodeList templateList = rootElement.getElementsByTagName("template");
      for(int i=0; i < templateList.getLength(); i++) {
      Node theTemplate = templateList.item(i);
      Element templateElement = (Element) theTemplate;
      System.out.println("Template" + ": " +templateElement.getAttribute("name")+ ".xml");
      } catch (ParserConfigurationException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      } catch (SAXException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();

    Ive posted the new code but now I'm getting a FileAlreadyExistException error. How do I handle this exception error correctly in my code?
    import java.io.IOException;
    import java.nio.file.FileAlreadyExistsException;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.xml.sax.SAXException;
    public class MyDomParser {
      public static void main(String[] args) {
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      try {
      DocumentBuilder builder = factory.newDocumentBuilder();
      Document doc = builder.parse("ENtemplate.xml");
      doc.normalize();
      NodeList rootNodes = doc.getElementsByTagName("templates");
      Node rootNode = rootNodes.item(0);
      Element rootElement = (Element) rootNode;
      NodeList templateList = rootElement.getElementsByTagName("template");
      for(int i=0; i < templateList.getLength(); i++) {
      Node theTemplate = templateList.item(i);
      Element templateElement = (Element) theTemplate;
      System.out.println(templateElement.getAttribute("name")+ ".xml");
      for(int i=0; i < templateList.getLength(); i++) {
      Node theTemplate = templateList.item(i);
      Element templateElement = (Element) theTemplate;
      String fileName = templateElement.getAttribute("name") + ".xml";
      Files.createFile(Paths.get(fileName));
      System.out.println("File" + ":" + fileName + ".xml created");
      } catch (ParserConfigurationException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      } catch (SAXException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();

  • Error while parsing SRVCTL output.

    OS : Sun 5.10 SPARC Machine
    DB :11.2.0.1 (Cluster Nodes)
    On DB Control, while checking "Cluster Managed Database Services " getting below error.
    Error while parsing SRVCTL output. Ensure that SRVCTL is functioning properly. I have checked the status of all the processes on that node, looks gsd process is down and in the db control log file getting below error .
    at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
    at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    at java.lang.Thread.run(Thread.java:595)
    2010-11-02 10:05:39,751 [Thread-42] ERROR db.rac parseStatusConfig.1010 - SrvctlDatabaseInfo.parseStatusConfig: no parsable status l
    ines.
    2010-11-02 10:38:50,440 [EMUI_10_38_49_/console/rac/racSitemap] WARN em.MetricEngine getCachedData.316 - Metric RAC_HOMETAB contain
    s no cached data!
    2010-11-02 10:38:51,260 [EMUI_10_38_49_/console/rac/racSitemap] WARN em.MetricEngine getCachedData.316 - Metric RAC_HOMETAB contain
    s no cached data!
    2010-11-02 10:39:11,514 [Thread-48] ERROR db.rac parseStatusConfig.1010 - SrvctlDatabaseInfo.parseStatusConfig: no parsable status l
    ines.
    What could be the issue ?

    what command did you execute?
    does it work from the second node?
    did you try rebooting the node?
    did you check clusterware services? some of the processess may have not started properly or died ...
    has it worked before ? or its a new installation ?

  • [SOLVED] Parsing output of pacman -Qm to an bash array

    Hey guys,
    I'm currently writing a small bash script to check if there are any updates for my packages installed from the AUR. For this I need to get an array from the output of
    pacman -Qm
    . I've tried this
    packages=(`pacman -Qm`)
    , but this isn't that what I've intended for.
    I want to have an array like this
    packages=("packagename version", "packagename version" ...)
    Does anybody know the way, how to solve this problem?
    Best regards,
    the_metalgamer
    Last edited by the_metalgamer (2013-02-23 22:24:11)

    Just to clarify this:
    With the solution in post #2 the IFS variable will contain just an "n". So any package name containing an "n" will be cut into pieces.
    $ echo ${packages[1]}
    e emyli es3 1.2-1
    The correct splitting is not caused by the IFS variable but by the read command which ALWAYS stops reading at a newline no matter what the IFS is set to. So there is no need to set the IFS variable to anything different and just use
    packages=(); while read -r; do packages+=("$REPLY"); done < <(pacman -Qm)

  • Parse and output XML document while preserving attribute order

    QUESTION: How can I take in an element with attributes from an XML and output the same element and attributes while preserving the order of those attributes?
    The following code will parse and XML document and generate (practically) unchanged output. However, all attributes are ordered a-z
    Example: The following element
    <work_item_type work_item_db_site="0000000000000000" work_item_db_id="0" work_item_type_code="3" user_tag_ident="Step" name="Work Step" gmt_last_updated="2008-12-31T18:00:00.000000000" last_upd_db_site="0000000000000000" last_upd_db_id="0" rstat_type_code="1">
    </work_item_type>is output as:
    <work_item_type gmt_last_updated="2008-12-31T18:00:00.000000000" last_upd_db_id="0" last_upd_db_site="0000000000000000" name="Work Step" rstat_type_code="1" user_tag_ident="Step" work_item_db_id="0" work_item_db_site="0000000000000000" work_item_type_code="3">
    </work_item_type>As you may notice, there is no difference in these besides order of the attributes!
    I am convened that the problem is not in the stylesheet.xslt but if you are not then it is posted bellow.
    Please, someone help me out with this! I have a feeling the solution is simple
    The following take the XML from source.xml and outputs it to DEST_filename with attributes in a-z order
    Code:
    private void OutputFile(String DEST_filename, String style_filename){
         //StreamSource stylesheet = new StreamSource(style_filename);
         try{
              File dest_file = new File(DEST_filename);
              if(!dest_file.exists())
                  dest_file.createNewFile();
              TransformerFactory tranFactory = TransformerFactory.newInstance();
              Transformer aTransformer = tranFactory.newTransformer();
              aTransformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
              Source src = new DOMSource("source.xml");
              Result dest = new StreamResult(dest_file);
              aTransformer.transform(src, dest);
              System.out.println("Finished");
         catch(Exception e){
              System.err.print(e);
              System.exit(-1);
        }

    You can't. The reason is, the XML Recommendation explicitly says the order of attributes is not significant. Therefore conforming XML serializers won't treat it as if it were significant.
    If you have an environment where you think that the order of attributes is significant, your first step should be to reconsider. Possibly it isn't really significant and you are over-reaching in some way. Or possibly someone writing requirements is ignorant of this fact and the requirement can be discarded.
    Or possibly your output is being given to somebody else who has a defective parser which expects the attributes to be in a particular order. You could quote the XML Recommendation to those people but often XML bozos are resistant to change. If you're stuck writing for that parser then you'll have to apply some non-XML processing to your output to fix it up on their behalf.

  • How to parse the output of a JSP?

    Hi,
    I need to parse the generated contents of a JSP file from within the web application (i.e. another JSP). Any ideas how this might work? It seems that XPath will not parse a file which doesn't end in .xml, and even if it did, I get the feeling it would parse the source file rather than the output.
    Cheers,
    Catalin

    It is a javascript bit taken directly from the XPath example at W3Schools ( [Example Page|http://www.w3schools.com/XPath/xpath_examples.asp], or [Code|http://www.w3schools.com/XPath/tryit.asp?filename=try_xpath_select_pricenodes_text] ).
    Edited by: K-tutzah on May 19, 2008 5:05 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Sun Studio 11 do not parse make output and create link to file?

    Hi,
    Running Sun Studio 11 and can only get file links in the output window when I run a make command that uses CC -g (debug option). We have integrated other tools into our make system (flexlint, cppUnit..) and even though we make sure that the syntax is exactly the same as the compiler output and matches regular expression under tools->options->building->make settings->error expression, it doesn't work. Why do you have to debug compile to get sun studio to create a file link in the output window? Doesn't sun studio just parse the text from the make command?
    example of flexlint output for which no link is created:
    "/vobs/project/oss/fm/fm4/fm-fmalib/fmbal/fmaaulib/src/FMA_List.cc", line 440: Error 84: sizeof object is zero or object is undefined'�
    example of make debug output for which we do get a link:
    "/vobs/project/oss/fm/fm4/fm-fmalib/fmbal/SunOS5.10/inc/FMA_alarm_record.hh", line 1310: Warning (Anachronism):Info "static" is not allowed and is being ignored.
    Regards,
    Ola

    I'd second Maxim's suggestion: try NetBeans 5.5 with C/C++ Development Pack. The official release of NetBeans C/C++ Development Pack 5.5 has happened a few days ago. You can download it from
    http://www.netbeans.info/downloads/all.php?b_id=2284
    Some of the changes between the beta3 build and FCS are:
    * Significant performance improvements in the code parser resulting in faster results in the Class View and Code Completion
    * Programs now run in an external terminal (system dependent) by default. This allows better input control
    * Significant performance improvement in the debugging module
    * Significant functionality improvement in the debugging module
    * New project type "C/C++ Project From Existing Code" which simplifies creating a project from existing code
    * Macro support in code completion
    * Hyperlink navigation for macro usages and #include directives
    * Reformat code
    * Code folding
    * Code completion
    All these features will appear in next Sun Studio release, so you can
    consider NetBeans C/C++ Development Pack 5.5 as a preview of new
    Sun Studio IDE.

  • Text file parsing and output

    Hi,
    I'm extremely new to Java and need to read and parse a text file and generate a new text file with modifications as follows:
    1. Ignore and rewrite comments
    2. Ignore and rewrite compiler commands
    3. (a) Modify function prototypes be removing their return values, if any,
    (b) append an '_VAR' to the function name and args
    (c) add an ampersand to the args when passed by reference
    sample input file:
    /***** comment *****/
    #if (INCLUDE_STATIC_BUILD == OS_FALSE)
    extern OS_MEMORY_POOL *MEM_Non_Cached;
    #endif
    UINT16 TLS_IP_Check (const UINT16 *s, UINT16 len);
    INT32 MEM_Copy_Data(NET_BUFFER buf_ptr, const CHAR HUGE buffer, INT32 numbytes, UINT16 flags);
    sample output file:
    /***** comment *****/
    #if (INCLUDE_STATIC_BUILD == OS_FALSE)
    extern OS_MEMORY_POOL *MEM_Non_Cached;
    #endif
    UINT16_VAR = TLS_IP_Check (&UINT16_VAR, UINT16_VAR);
    INT32_VAR = MEM_Copy_Data(&NET_BUFFER_VAR, name, INT32_VAR, UINT16_VAR);
    I would appreciate any help!
    Thanks.

    Check replies on the other post
    http://forum.java.sun.com/thread.jspa?threadID=680728&tstart=0

  • [Solved] i3 workspace output woes

    Semi-recently switched to i3, loving everything about it so far other than one fairly large issue that is stopping me using it like a true WM.
    Basically, I'm trying to set 4 workspaces on each monitor (of which I have 2), and it just straight up doesn't work. Both outputs have at least 8 (I only have 1-8 switch keys bound) workspaces that are independent, and if I launch applications before switching, they get ignored and other workspaces get created.
    My .i3 config
    My xorg.conf
    Output of xrandr
    An example of what I mean about it ignoring the preset workspaces.
    Happy to post anything else needed, thanks!
    Last edited by elken (2014-02-07 08:24:40)

    I took a break from i3 for a day as this was really bugging me, had a sleep, woke up this morning and I've sorted it. It's a very hacked solution, but it does the job. Instead of having
    bindsym $mod4+<num> workspace <num>
    I now have
    bindsym $mod4+<num> exec "i3-msg focus output <monitor>; i3-msg workspace <num>"
    Which I know will probably cause problems later, but it does the job for now. Marking as solved.

  • [SOLVED] Parsing simple config files in pure bash

    Hi everyone,
    I'd like to implement a bash function to parse a simple config file for a script I've wrote. The conifg file contains different sections for different scenarios. Here's an example how it should look like:
    # configuration file
    # global settings
    global {
    DATE_PREFIX="-I"
    SSHFS_OPTS="-C"
    EXT_FULL="full"
    EXT_DIFF="diff"
    EXT_CATALOGUE="catalogue"
    DAR_OPTS="-v -m 256 -y -s 600M -D"
    DAR_NOCOMPR="-Z '*.gz' -Z '*.bz2' -Z '*.zip' -Z '*.png'"
    # system settings
    system {
    DAR_OPTS="-v -m 256 -y -s 200M -D"
    It contains some settings which are global for the whole script and special settings groups which can be used to overwrite global settings.
    The function to parse this config file looks as follows:
    #!/bin/sh
    CONFIG="/home/chi/.daruprc"
    function readconf() {
    match=0
    while read line; do
    # skip comments
    [[ ${line:0:1} == "#" ]] && continue
    # still no match? lets check again
    if [ $match == 0 ]; then
    # do we have an open tag ?
    if [[ ${line:$((${#line}-1))} == "{" ]]; then
    # strip "{"
    group=${line:0:$((${#line}-1))}
    # do we have a match ?
    if [[ ${group} -eq $1 ]]; then
    match=1
    continue
    fi
    continue
    fi
    # found close tag but still no match - continue
    elif [[ ${line:0} == "}" && $match == 0 ]]; then
    continue
    # found close tag after config was read - exit loop
    elif [[ ${line:0} == "}" && $match == 1 ]]; then
    break
    # got a config line return it
    else
    echo $line
    fi
    done < "$CONFIG"
    for line in $(readconf "system"); do
    echo $line
    done
    As you can see I try to just echo the lines at the moment. And here's the problem: It seems I have some " escape issues, if I run it I get the following output:
    ./parseconfig.sh
    DATE_PREFIX="-I"
    SSHFS_OPTS="-C"
    EXT_FULL="full"
    EXT_DIFF="diff"
    EXT_CATALOGUE="catalogue"
    DAR_OPTS="-v
    -m
    256
    -y
    -s
    600M
    -D"
    DAR_NOCOMPR="-Z
    '*.gz'
    -Z
    '*.bz2'
    -Z
    '*.zip'
    -Z
    '*.png'"
    As you can see there are way to much newlines - which leads to problems when I try to use "eval" to initialize the variables.
    I am sure I am missing something simple here, however I am looking for a solution for a few days now - maybe one of the bash gurus on this board can enlighten me ;-).
    Thanks in advance
    PS.: I am trying to do this in pure bash because the script also needs to run on embedded machines with very low memory like my router on which I don't have sed or awk or the like. I also know that I could for example just use different config files to circumvent the whole parsing - but I am just curious if this could work the way I like ;-).
    Last edited by chimeric (2007-11-04 23:20:58)

    chimeric wrote:
    Hi MrWeatherbee,
    well yes, but I want to assign (eval) these lines to get variables out of them. Since the while loop is trapped in its' own subshell I need to return the lines into the parent one to be able to make these variables "visible" in the script itself.
    Right. But I was trying to show you that the way you were going about it wouldn't work at a very fundamental level.
    Without changing too much code just for a quick and dirty demo,
    change:
    # got a config line return it
    else
    echo $line
    fi
    done < "$CONFIG"
    # got a config line return it
    else
    line_array=( "${line_array[@]}" "$line" )
    fi
    done < "$CONFIG"
    numarrayelements=${#line_array[@]}
    and then in the main program code, do this:
    readconf "system"
    for index in $( seq $numarrayelements ); do
    line=${line_array[(($index-1))]}
    echo $line
    done
    Using an array to collect the good lines from the function allows you to reuse them later for whatever purpose. Although other ways exist, you certainly don't want to do what you originally did.
    Edit:
    I posted the code with an incorrectly referenced variable and had to fix it.
    Last edited by MrWeatherbee (2007-11-04 22:46:34)

  • [SOLVED] External sound output silent since upgrade to GNOME 3.16

    Hi.
    I just upgraded my machine to GNOME 3.16 (pacman log). Since then, sound output (whether the GNOME Sound applet test, or Clementine, or YouTube from Firefox)...
    ... works fine when outputting to the laptop speakers.
    ... is silent when I plug my external speakers to the computer's jack 3.5" out. I have two outputs, am using the same as before the upgrade but tried both nevertheless, and plugging an mp3 player works.
    Here is my config:
    laptop = Dell XPS 1645
    uname -a = Linux x 3.19.3-3-ARCH #1 SMP PREEMPT Wed Apr 8 14:10:00 CEST 2015 x86_64 GNU/Linux
    pulseaudio = pulseaudio 6.0-1
    Any idea? Debug suggestions? Need more info? Thanks for the help.
    EDIT: Problem solved after a second reboot :-/
    Last edited by ronjouch (2015-04-10 09:56:41)

    LeCrayonVert wrote:Removed both options...still the same thing.
    I've tried to reinstall kernel26-lts...and even with this kernel, the same error occurs...It's most likely related to the mkinitcpio creation process.
    Did you try the fallback initramfs?

  • [SOLV]PulseAudio - Simultaneous Output works until I close pavucontrol

    Hello,
    I'm having a odd issue....
    I just installed PulseAudio on my machine (Avoided it for so long, still prefer just plain ALSA) and I'm using a ALSA backend. I installed it for the need to simultaneously output my system audio to my headphones and my speakers at the same time. Everything seems to be all right except for when I play Minecraft or WoW... Those are the two things I notice it with most. Haven't tried anything else. But, unless pavucontrol is running minimized in the background, or just open in general... Simultaneous output is VERY choppy on those apps. Switching back to a single output works just fine. But I'd very much rather use the simultaneous output...
    I've been searching for the better part of yesterday to figure out why having pavucontrol open in the background would truly make a difference. I was hoping you guys over here that may have some PulseAudio experience to give me a helping hand.
    I'm not exactly sure what configs to post... but here's my daemon.conf. I can post anything needed.
    Any support would be appreciated.
    Thanks,
    Matt
    EDIT: Marked at [SOLV]... [ED] Wouldn't fit.
    Last edited by themattbeballin (2012-04-12 18:00:27)

    Looking further into the issue this morning... It seems to be a problem with the timer based scheduler...
    I disabled the scheduler using tsched=0 and now those apps work fine, except for the helicopter-like noise that it's producing now.
    Any ideas how to fix that?

  • Parse BPEL output using PL/SQL

    Hello,
    I am invoking WSDL from PL/SQL and WSDL is returning following output.
    +<?xml version="1.0" encoding="UTF-8"?>+
    +<SOAP-ENV:Envelope+
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    +<SOAP-ENV:Header+
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"></SOAP-ENV:Header><SO
    AP-ENV:Body>
    +<ser-root:soapIntefraceASVOutput+
    xmlns:ser-root="http://eai.corpit.microsoft.com/microAccountValidation/provider/Acc
    ountStringValidator"><acctStringValidateOutput>
    +<status>112</status>+
    +<message>In+
    valid account segment
    code</message></acctStringValidateOutput></ser-root:soapIntefraceASVOutput></SOA
    P-ENV:Body>
    +</SOAP-ENV:Envelope>+
    I wanted to parse this XML in my PL/SQL Block and wanted to retrieve <status> and <message> element Value.
    Please help me on this.
    Thank You
    AB,

    This is probably not a good pattern for invoking webservices from database, it would be better to invoke this webserivce asynchronously via a queue/table and have another webservice invoked from that webservice, which would process the response, wrapping the pl/sql logic - but then your case may be unique.
    To parse this XML in pl/sql, you would do the following if the varchar2 variable v_response_string contains the soap response from the web service:
    v_response := XMLType.createXML(v_response_string);
    v_status := v_response.extract('/soap:Envelop/soap:Body/ser-root:soapIntefraceASVOutput/acctStringValidateOutput/status/text()'
    , 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" '||
    'xmlns:ser-root="http://eai.corpit.microsoft.com/microAccountValidation/provider/AccountStringValidator"'
    v_ message := v_response.extract('/soap:Envelop/soap:Body/ser-root:soapIntefraceASVOutput/acctStringValidateOutput/message/text()'
    , 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" '||
    'xmlns:ser-root="http://eai.corpit.microsoft.com/microAccountValidation/provider/AccountStringValidator"'
    Hope this helps,
    Thanks,
    Shanmu.
    http://www.prshanmu.com/articles/

  • Parse BPEL Output in PL-SQL

    Hello,
    I am invoking WSDL from PL/SQL and WSDL is returning following output.
    +<?xml version="1.0" encoding="UTF-8"?>+
    +<SOAP-ENV:Envelope+
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    +<SOAP-ENV:Header+
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"></SOAP-ENV:Header><SO
    AP-ENV:Body>
    +<ser-root:soapIntefraceASVOutput+
    xmlns:ser-root="http://eai.corpit.microsoft.com/microAccountValidation/provider/Acc
    ountStringValidator"><acctStringValidateOutput>
    +<status>112</status>+
    +<message>In+
    valid account segment
    code</message></acctStringValidateOutput></ser-root:soapIntefraceASVOutput></SOA
    P-ENV:Body>
    +</SOAP-ENV:Envelope>+
    I wanted to parse this XML in my PL/SQL Block and wanted to retrieve <status> and <message> element Value.
    Please help me on this.
    Thank You
    AB,

    using XPATH and a SQL you can get it.
    eg:
    -- test with 10gR2
    CURSOR grab_one_value(xt IN xmltype, path_to IN VARCHAR2) IS
    SELECT extractvalue(xt, path_to, c_namespace)
    FROM dual;
    OPEN grab_one_value(xml_in, tag_in);
    FETCH grab_one_value
    INTO v_out;
    CLOSE grab_one_value;
    RETURN v_out;
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • [SOLVED] PulseAudio wrong output balance at startup

    Hello,
    I'm using GNOME 3.2 with PulseAudio. PulseAudio sets my audio output balance to 90% right channel each time. restarting it does not help.
    Any ideas?
    I'll be happy to supply any logs needed if you point me to them. I've made no changes to any of the files at /etc/pulse.
    amixer -c0:
    Simple mixer control 'Master',0
    Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum
    Playback channels: Mono
    Limits: Playback 0 - 64
    Mono: Playback 37 [58%] [9.25dB] [on]
    Simple mixer control 'Headphone',0
    Capabilities: pvolume pswitch penum
    Playback channels: Front Left - Front Right
    Limits: Playback 0 - 64
    Mono:
    Front Left: Playback 64 [100%] [0.00dB] [on]
    Front Right: Playback 64 [100%] [0.00dB] [on]
    Simple mixer control 'PCM',0
    Capabilities: pvolume penum
    Playback channels: Front Left - Front Right
    Limits: Playback 0 - 255
    Mono:
    Front Left: Playback 253 [99%] [0.40dB]
    Front Right: Playback 255 [100%] [0.00dB]
    Simple mixer control 'Front',0
    Capabilities: pvolume pswitch penum
    Playback channels: Front Left - Front Right
    Limits: Playback 0 - 64
    Mono:
    Front Left: Playback 13 [20%] [-51.00dB] [on]
    Front Right: Playback 64 [100%] [0.00dB] [on]
    Simple mixer control 'Front Mic',0
    Capabilities: pvolume pswitch penum
    Playback channels: Front Left - Front Right
    Limits: Playback 0 - 31
    Mono:
    Front Left: Playback 0 [0%] [-34.50dB] [off]
    Front Right: Playback 0 [0%] [-34.50dB] [off]
    Simple mixer control 'Front Mic Boost',0
    Capabilities: volume penum
    Playback channels: Front Left - Front Right
    Capture channels: Front Left - Front Right
    Limits: 0 - 3
    Front Left: 1 [33%] [10.00dB]
    Front Right: 1 [33%] [10.00dB]
    Simple mixer control 'Surround',0
    Capabilities: pvolume pswitch penum
    Playback channels: Front Left - Front Right
    Limits: Playback 0 - 64
    Mono:
    Front Left: Playback 64 [100%] [0.00dB] [on]
    Front Right: Playback 64 [100%] [0.00dB] [on]
    Simple mixer control 'Center',0
    Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum
    Playback channels: Mono
    Limits: Playback 0 - 64
    Mono: Playback 64 [100%] [0.00dB] [on]
    Simple mixer control 'LFE',0
    Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum
    Playback channels: Mono
    Limits: Playback 0 - 64
    Mono: Playback 64 [100%] [0.00dB] [on]
    Simple mixer control 'Side',0
    Capabilities: pvolume pswitch penum
    Playback channels: Front Left - Front Right
    Limits: Playback 0 - 64
    Mono:
    Front Left: Playback 64 [100%] [0.00dB] [on]
    Front Right: Playback 64 [100%] [0.00dB] [on]
    Simple mixer control 'Line',0
    Capabilities: pvolume pswitch penum
    Playback channels: Front Left - Front Right
    Limits: Playback 0 - 31
    Mono:
    Front Left: Playback 0 [0%] [-34.50dB] [off]
    Front Right: Playback 0 [0%] [-34.50dB] [off]
    Simple mixer control 'IEC958',0
    Capabilities: pswitch pswitch-joined penum
    Playback channels: Mono
    Mono: Playback [on]
    Simple mixer control 'IEC958 Default PCM',0
    Capabilities: pswitch pswitch-joined penum
    Playback channels: Mono
    Mono: Playback [on]
    Simple mixer control 'Capture',0
    Capabilities: cvolume cswitch penum
    Capture channels: Front Left - Front Right
    Limits: Capture 0 - 46
    Front Left: Capture 16 [35%] [0.00dB] [on]
    Front Right: Capture 16 [35%] [0.00dB] [on]
    Simple mixer control 'Capture',1
    Capabilities: cvolume cswitch penum
    Capture channels: Front Left - Front Right
    Limits: Capture 0 - 46
    Front Left: Capture 0 [0%] [-16.00dB] [off]
    Front Right: Capture 0 [0%] [-16.00dB] [off]
    Simple mixer control 'Auto-Mute Mode',0
    Capabilities: enum
    Items: 'Disabled' 'Enabled'
    Item0: 'Enabled'
    Simple mixer control 'Input Source',0
    Capabilities: cenum
    Items: 'Rear Mic' 'Front Mic' 'Line'
    Item0: 'Front Mic'
    Simple mixer control 'Input Source',1
    Capabilities: cenum
    Items: 'Rear Mic' 'Front Mic' 'Line'
    Item0: 'Rear Mic'
    Simple mixer control 'Rear Mic',0
    Capabilities: pvolume pswitch penum
    Playback channels: Front Left - Front Right
    Limits: Playback 0 - 31
    Mono:
    Front Left: Playback 0 [0%] [-34.50dB] [off]
    Front Right: Playback 0 [0%] [-34.50dB] [off]
    Simple mixer control 'Rear Mic Boost',0
    Capabilities: volume penum
    Playback channels: Front Left - Front Right
    Capture channels: Front Left - Front Right
    Limits: 0 - 3
    Front Left: 0 [0%] [0.00dB]
    Front Right: 0 [0%] [0.00dB]
    Last edited by elik (2012-02-17 09:02:45)

    apparently just deleting the configuration directory ~/.pulse and restarting solves the issue.

Maybe you are looking for

  • No Longer have "Sent" mailbox?

    Hi, I used to have a box on the left side of mail under inbox, drafts, trash that said "sent mail." It's no longer there. I have one called outbox. What's up please? How can I get back the Sent. Thanks.

  • IPhoto 2.0.1: Missing photos

    My iPhoto photos are missing. I've had some other weirdness with other applications, e.g. Mail and Safari, but I've resolved those issues on my own and with help from other forum angels. Now I'd like some help finding my photos that used to be in iPh

  • Intel Bluetooth Service View has stopped working

    I have a Windows 7 laptop model dv4t-4000 CTO Entertainment Notebook PC (product number LH989AV) and I get this error message ("Intel Bluetooth Service View has stopped working") every time I try to connect to my Bluetooth Earbuds. The pairing seems

  • Access private variables from javascript

    Hi. How can i access my objects and varibles, in my java code from my javascript.

  • Will amendments be lost if fonts are missing until I can purchase the new font?

    Hi There, We have a document produced by an outside design agency using fonts that we do not own.  We need to make many amendments to the document and want to start these now before our very lengthy procurement process provides us with the missing fo