BLS, extract parts of an XML

Hi.
I may have asked before, but can not find the answer anywhere. I have an XML which I want to extract parts of. It this possible an how?
I want to get the part
/ns1:GetProductionSchedule
/ns2:GetProductionSchedule
/ns2:DataArea
/ns3:ProductionSchedule
and everything below it....
The XML is as follows.
<?xml version="1.0" encoding="UTF-8"?>
<GetProductionSchedule xmlns="http://Wonderware.WWEI.Services">
     <GetProductionSchedule xmlns="http://www.wonderware.com/wwei/v0201/schemas">
          <ApplicationArea>
               <Sender>
                    <LogicalID/>
                    <ComponentID/>
                    <TaskID/>
                    <ReferenceID/>
                    <ConfirmationCode/>
                    <AuthorizationID/>
               </Sender>
               <CreationDateTime/>
               <BODID/>
               <UserArea/>
          </ApplicationArea>
          <DataArea>
               <ProductionSchedule xmlns="http://www.wbf.org/xml/b2mml-v02">
                    <ID>000003176585</ID>
                    <Description/>
                    <Location>
                         <EquipmentID/>
                         <EquipmentElementLevel OtherValue=""/>
                         <Location>
                              <EquipmentID/>
                              <Any/>
                         </Location>
                         <Any/>
                    </Location>
                    <PublishedDate/>
                    <StartTime/>
                    <EndTime/>
                    <EquipmentElementLevel OtherValue=""/>
                    <Any/>
               </ProductionSchedule>
          </DataArea>
     </GetProductionSchedule>
</GetProductionSchedule>

Poul,
Ignore my previous message.  Still mentally working in 11.5. 
I assume you are using a tracer to display the extracted xml?  I built a little test transaction and you were right.  There does not appear to be any extracted xml in the Tracer.Message property.  So I did used an XML Saver to save it using the path: "db://ProjectA/WEB/test.xml".  Lo and behold the xml was extracted just as Michael and I had expected.  So the problem appears to be in the Tracer rather than in the method.  This is apparently a problem similar to trying to use a Tracer to display the xml output of a repeater.  Which should be fixed in 12.1.
Let me know what you find out.  I am working in 12.0.5.
Good luck,
Mike
Edited by: Michael Appleby on Oct 14, 2008 5:17 PM

Similar Messages

  • Extract part of xml into CLOB or XMLType

    I need to extract part of XML into CLOB or some another type. But I don't need only extract data, by whole part od xml with elements. How could I do it in PL/SQL?
    For example from this xml:
    <bookstore>
    <book category="COOKING">
    <title lang="en">Everyday Italian</title>
    <author>Giada De Laurentiis</author>
    <year>2005</year>
    <price>30.00</price>
    </book>
    <book category="CHILDREN">
    <title lang="en">Harry Potter</title>
    <author>J K. Rowling</author>
    <year>2005</year>
    <price>29.99</price>
    </book>
    </bookstore>
    I need to get:
    "<book category="COOKING">
    <title lang="en">Everyday Italian</title>
    <author>Giada De Laurentiis</author>
    <year>2005</year>
    <price>30.00</price>
    </book>"
    THX

    That's why I need to process every book alone - to know which authors belongs to single book.For that specific requirement, a single query would do.
    Assuming variable "v_xml_clob" holds the XML document :
    <bookstore>
      <name>nameOfBookstore</name>
      <address>1st Avenue 24, SF</address>
          <book category="COOKING">
            <title lang="en">Everyday Italian</title>
            <author>
              <name>Giada De Laurentiis</name>
              <birth>1956</birth>
            </author>
            <author>
              <name>xxx</name>
              <birth>1955</birth>
            </author>
            <year>2005</year>
            <price>30.00</price>
          </book>
          <book category="CHILDREN">
            <title lang="en">Harry Potter</title>
            <author>
              <name>Rowning</name>
              <birth>1977</birth>
            </author>
            <author>
              <name>xxx</name>
              <birth>1955</birth>
            </author>
            <year>2005</year>
            <price>29.99</price>
          </book>
    </bookstore>You can do :
    SELECT *
    FROM XMLTable(
    'for $i in distinct-values($d//book/author/name)
      where count($d//book/author[name=$i]) = 1
      return $i'
    passing xmltype(v_xml_clob) as "d"
    columns author_name varchar2(80) path '.'
    AUTHOR_NAME
    Rowning
    Giada De Laurentiis

  • How can I delete only one part of my xml file?

    Hello,
    I stored more than 100 users in only one xmltype column. For instance
    Create table agro(users XMLTYPE);
    ... and I inserted all users inside
    INSERT INTO agro values(XMLTYPE
    ('<?xml version="1.0" encoding="ISO-8859-1"?>
    <authentication><users><user>
    <name>cocoon</name>
    <password>cocoon</password>
    <role>admin</role>
    <title>Mr.</title>
    <firstname>Walter</firstname>
    <lastname>Cocoon</lastname>
    <company />
    <street />
    <zipcode />
    <city />
    <country>DE</country>
    <phone />
    <fax />
    <email />
    <bankid />
    <bankname />
    <accountid />
    </user>
    ... another user, etc.
    </users></authentication>'));
    Now I tried to delete only one part of this file. For example all persons with the name"cocoon".
    I used for this target the following statement:
    DELETE FROM agro agro
    WHERE agro.users.extract('authentication/users/user/text()').getStringVal()= 'cocoon';
    When I execute this statement, Oracle DB delete all users and not only with the name "Cocoon".
    How can I delete only one part of my xml file?
    Kind Regards
    M R

    This the expected behavoir. You uploaded a document containing multiple users and then asked XML DB to delete any documnet that contained a user with the name in question. The problem here is that you are creating a mega document that contains an aggregation of user documents but then trying to work with individual user documents. This is a bad idea.
    In general XML does not understand the concept of a collection of documents. It can only operate on one document at a time. Hence the tendancy to aggregate individual documents into a single larger document. Once you have an XML database, you can perform operations on collections of document, as easily as you can perform operations on individual documents, so the need to aggregate the individual documents together disappears.
    If you store each user document as a seperate document then your delete will work as expected.

  • Extract part of clob

    Hi ,
    sorry I am posting it again here as this section is more appropritate one I guess.
    I am not an extensitve sql or pl/sql writer. I am basically java developer, I want help in extracting a part of xml in clob data field.
    the Clob field has data like this
    field name is messagedata and say the table name is messages
    <message>
    <rootcause>Short to Lead-Time Requirement</rootcause>
    <contactphone>123456</contactphone>
    <contactname>Jonathan Keen</contactname>
    <partname>Test, Name</partname>
    <shutdownsource>94in HT</shutdownsource>
    <enginesn>123456</enginesn>
    <partnumber>testpart</partnumber>
    <comment>test</comment>
    <promisedate>Today</promisedate>
    <productcenter>CANMC-Nozzles</productcenter>
    <enginemodel>GG-8</enginemodel>
    </message>
    I need to extract value within the xml tags <partname>Test, Name</partname>
    I tried
    SELECT dbms_lob.substr(messagedata,50,dbms_lob.instr(messagedata,'<partnumber>'))
    from messages
    I know above will give 50 characters from the word <partnumber>, but how to extract exact vaue
    I also tried
    SELECT regexp_substr( (dbms_lob.substr(messagedata,50,dbms_lob.instr(messagedata,'<partnumber>')) ), '[^</partnumber>]+') "REGEXP_SUBSTR"
    from messages;
    it is giving wiered values , some of them are exact partnumber values but some are not.
    how to fix this.
    thanks in advance.
    SK.

    Are you dealing with a xml clob? If so why not simply
    SQL> with t as (
    select to_clob('<message>
    <rootcause>Short to Lead-Time Requirement</rootcause>
    <contactphone>123456</contactphone>
    <contactname>Jonathan Keen</contactname>
    <partname>Test, Name</partname>
    <shutdownsource>94in HT</shutdownsource>
    <enginesn>123456</enginesn>
    <partnumber>testpart</partnumber>
    <comment>test</comment>
    <promisedate>Today</promisedate>
    <productcenter>CANMC-Nozzles</productcenter>
    <enginemodel>GG-8</enginemodel>
    </message>') cl from dual
    select extractvalue(xmltype(t.cl), '//partname') partname
      from t
    PARTNAME                                                                       
    Test, Name                                                                     
    1 row selected.?

  • Using XSLT to extract value of a XML node with namespace

    I have a XML source code here.
    <?xml version="1.0" encoding="utf-8" ?>
    <rss version="2.0" xmlns:job="http://www.pageuppeople.com">
      <channel>
        <title>SMH Jobs</title>
        <link>internalrecruitment.smhgroup.com.au/jobsrss.ashx?stp=di</link>
        <description>A listing of jobs available here</description>
        <item>
          <title>eCommerce Optimisation Advisor</title>
          <description>A new and exciting opportunity exists for an experienced eCommerce Advisor to join</description>
          <job:location PUReferenceID="3711">Sydney - Inner Suburbs & CBD</job:location>
        </item>
      </channel>
    </rss>
    I want to use XSLT to extract value of a XML node with namespace <job:location>, and the returned value should be string 'Sydney - Inner Suburbs & CBD'. I tried a few XSL code below, but failed with error or nothing was returned.
    <xsl:value-of select="job:location" disable-output-escaping="yes"/>
    <xsl:value-of select="job/location" disable-output-escaping="yes"/>
    <xsl:value-of select="job\location" disable-output-escaping="yes"/>
    <xsl:value-of select="location" disable-output-escaping="yes"/>
    This might be an easy question for you, but I would appreciate if anyone can help.

    Hi Suncorp IT Learner,
    We need to tell the XSLT that some elements are in another namespace. Copy the xmls declarations for the prefixes you need to use. Then use the xsl format as:
    <xsl: value-of select=”job:location/@PUReferenceID”/>
    In following issue, Chriztian has a good explanation:
    http://our.umbraco.org/forum/developers/xslt/33353-XSLT-reading-XML-attribute-value
    Thanks,
    Qiao Wei
    TechNet Community Support

  • Load multiple parts of an XML file into one dynamic Text Field

    Hi I am trying to load text from an external XML file into a dynamic text box. I have so far managed to load single parts of the XML file into a dynamic text field. I now want to be able to load different parts of the XML file (something similar to a string with appendText) into the same text Field.
    I have so far managed to achive this using the String and append text properties, but would like to use XML file to do it instead.
    Any tips please?
    Thanks

    In essence you can just do:
    TextField.text = XML.node1 + XML.node2;

  • How can I extract part of a PDF file and copy it to a new PDF file?

    How can I extract part of a PDF file and copy it to another PDF file?

    You will need Adobe Acrobat for this.

  • I'm trying to update my iPad 2 but an error keeps popping up after the extracting part...

    im trying to update it to OS 5.0.1 or whatever, and it gets through everything until the extracting part and an error pops up. i have the most recent iTunes, i temporarily disabled the antivirus and firewall, and i reset my whole ipad... what now!

    If you continue and you lose everything, you will be able to download most of the content again for free as long as you use the same Apple ID. You can read this about downloading past purchases.
    http://support.apple.com/kb/HT2519
    But before you continue and lose everything, try this.
    Eject your iPad, quit iTunes and restart your computer. Then launch iTunes and go to Edit>Preferences>Devices. See if you have mutliple iPad backups showing in there. If you have multiple backups, delete all but one of them. Also check the box at the bottom that turns off auto sync .... Prevent iPods ......Click OK and Then quit iTunes.
    Connect the iPad again and launch iTunes. Right click on your iPad name on the left side of iTunes and select backup. See if the iTunes will create a backup. If it does, after it finishes, click on the Summary Pane on the right and click on check for update. Try to update again.
    If it all goes OK, after you update the iOS you can back to Edit>Preferences>Devices and turn on atuo sync again - assuming that is how you want to sync.

  • Extract part of image & save with transparent background

    What is the best way to extract part of an image & save it with a transparent background?  I had hoped to the extracted images in 2 different ways.
    Firstly just to paste into another image.
    Secondly I'd like to try to open both the extracted item as well as the whole original photo in different video editing programs including Premiere Elements & sony Vegas.  What is the best  way to do this?

    Here's what you could do.
    First make sure you have both images open in editor
    1. Open the image and select the area using the magnetic lasso/quick selection tool.
    2.  Select Layer -> New -> Layer Via Copy
    3. Now in the layers palette, right click the layer and select 'Dulicate Layer'
    4. In the duplicate layer dialog, in document - select the other image, where you would like to paste the image to.
    5. You and ajust the poition of the pasted area/resize it using the move tool or transform tool (Ctrl + T).
    6. Save the image with a new name
    If you simply want to save the image with transparency (after step #2) - you may -
    > hide the previous layer and Save the image as a png/gif so transparency is presereved.
    Hope that helps.
    When you have teh saved documents you can open them up in different editors.
    Regards,

  • Hiding some part of rendered XML form

    Hi all,
    is it possible to hide some part of displayed xml form? For example, I have XML form with texts in two languages (two schema nodes, one for each language). I would like to show only text in users language. Users language could be determined from UME or from personalization of iView.
    Thank you very much for answers.
    Zdenek

    Hi Wassilios,
    thanks for helpful answer. Exists some documentation about these xsl files (I mean KM specific information)?
    Regards,
    Zdenek
    Message was edited by: Zdenek Smolik

  • Extracting part of a subject title

    Hello,
    I'm looking to extract part of a subject title sandwiched between two special characters ([ & ]) and use that to create a new subject title in a new e-mail.
    So for example, if the subject title of the e-mail says "[This is the main subject title] but not this part", I want to extract the bit between the two brackets and create a new subject title in a new e-mail which in this case would say "This is the main subject title". Obviously this text can vary.
    Can this be done by use of filters within a Cisco ESA? Would appreciate any pointers how to extract it if it can be done.

    You can use either a content filter or a message filter.
    Search using a regex like this one...   (?<=\[)[^]]+(?=\])
    I got that from here:http://stackoverflow.com/questions/2403122/regular-expression-to-extract-text-between-square-brackets
    You may have to fiddle with it...
    Then for the action, set the subject to "$MatchedContent" (look at the online help for the content or message filters)

  • How to extract part of a pdf page and save that as a pdf page on its own?

    I need to extract part of a pdf page. I know how to extract full page, but that is not what I want. I need to extract part of it, ideally, using the mouse to select some rectangular area, and export the selected part to either separate pdf page, or to export to  vector graphics such as .svg
    Is there a tool to allow one to do this? Currently I take screen shot of the page, and use other tools to extract the parts I want. thanks.

    thank you. The crop tools helps. But I am still not sure what to do after I select the area I want. I looked at Acrobat Help | Crop PDF pages
    So, after I select the crop tool and select the area. Now what to do?
    If I double click the cropped area, as the help says, it will just delete everything on the page except the cropped area.
    How do I tell it to either export the selected area to .svg, or save the selected area to a separate one page pdf file?  I do not want to modify the original PDF file, I just want to make a copy of the cropped area, either to .svg image, or to separate pdf file, so I can include that in another document.

  • Extracting parts for film score

    I am scoring a film, and I need to record live strings over my sampled strings.
    I have quantized most of the score, but when I was working with the director and editor, I had to sometimes manually slide the in-point of the cue to line up with a specific frame or spot. When this happens, I often fall off the beat- meaning, that when I am in the matrix edit window, the first note may appear between two 16th notes, or something like that. Is there any way to adjust the arrange/matrix window to have the first beat land exactly where my cue begins so when I extract parts, they will land on a down beat? Otherwise, my part is going to be all over the place. Hopefully this makes sense…
    Best,
    Adam

    Hi Adam ... how about this for a solution:
    1 - create a new document for the cue that needs to shift. Save your document as "Cue Experiment" or something..
    2 - set your left locator at the very beginning of the document - bar 1 or OO.00 -
    3 - Set the right locator at the very beat that you want to become the downbeat (select the note, go to it with SPL and then set right locator by Song Position Line. making sure you zoom in very big because you are making such a small change
    4 - Select all then go to the Menu: Region>Cut/Insert Time>Snip: Cut time and move by locators ... this will shave off a fraction of the time and could move the whole cue forward onto the right beat.
    This may or may not do the trick but I am sure the film scorers on the Forum will surely come up with the right answer

  • Bash script to extract certain parts of an xml

    Here is what i'm dealing with, i have 2 files, one xml file and one file containing certain class names from the first one, the point is to filter the xml file so the newly created file only contains the classes defined in the second or list file. So far i've come up with an idea but got stuck on the last step, hope someone is willing to point me in the right direction
    The xml file is called description.xml and the list is list.txt
    #!/bin/bash
    # First i extract all the required class names and put in the missing parts
    cat list.txt | awk '{print "<class name=\"" $1 "\">"}' > filter.txt
    # Next i filter out all the line numbers of the required classes
    grep -n -f filter.txt description.xml | cut -d: -f1 > names.txt
    # Now i need to use something like awk '/NR=$n/,/^$/' so it filters
    out the whole class definition using the line number as the starting
    point and a newline as the ending of a class, and of course save it all
    in a new xml but so far nothing i tried worked :)
    The list file is one class name per line:
    java/net/xyz
    java/net/xzy
    java/net/yxz
    And a snippet from the description.xml:
    <class name="java/net/xyz">
    </class>
    <class name="java/net/xzy">
    </class>

    Ahh I see what you're doing. That is a smart approach. I would have gone for a script that reads every line and extracts the java/net/xzy if it has one and grep -q it to the list.txt, and then maintain a variable that says whether it should print the class that gets set to false when </class> comes.
    In this case it is a bit hard to use awk because you need to process the line numbers from a file and the data too, and line numbers aren't the easiest to work with.
    But sed can do that easily
    IFS="
    for sedcmd in $(sed 's~$~,/^$/p~' numbers.txt); do sed -n "$sedcmd" xmlfile.xml; done
    Last edited by Procyon (2009-04-14 00:49:41)

  • Re: extract part  of xml with SAX

    alternatively do a XLST to extract the required node?

    would that be possible if i'm using the xerces sax2 parser to extract data?

Maybe you are looking for

  • Unusual start up problem - Zen Nomad freez

    Hi, dont know if anyone can help me. I have a Creative Zen Nomad and have not used it for about 5 months. Anyway, I decided today to see what MP3's I had left on it, and as the battery was flat I started recharging it. So, there I was waiting for it

  • Resized RAW Pictures

    I have LR 1.4 with XP as OS.Camera is Nikon 40DX with AF-S Nikkor 18-200 mm lens. Optimize image setting "Normal". This is the first time I have taken pictures in RAW format. All pictures I have taken in vertical turned into Thumbnail size after I do

  • How to post custom after GR

    Hi All Please read the case: we purchase the imported material, now we should do the MIRO first for the custom duty, but we didnot do this. directly done the GRN. In GRN also we did not capture the excise. Now we have to pay the custom, how can we do

  • Anyone with a possible answer apptreciated

    im curious is there a way to have a confrimation when the person you sent a text to opens/recieves it?

  • Implementação de PM (Plan Maintenance)

    Bom dia a todos, Estou neste momento a acompanhar um processo de implementação de PM numa empresa do ramo petrolífero, gostaria de saber se alguém já fez um projecto deste género numa outra empresa. Se sim, gostaria também de saber se me podem facult