Extract xml attributes

I have simple xml passed by porgram and want to extract all the tag values, Can any body please tell me how to do that,
xml
=====
<SearchParams>
<Params fieldid="12" Value ="aa"/>
<Params fieldid="13 value="bb"/>
</SearchParams>
Now this I have to extract and print the tag values looping thru th above xml
Thanks in advance
Murthy

Please don't post the same question twice

Similar Messages

  • Extracting XML attributes

    Hi!
    I'm working on a big XML document that I will import into inDesign. Many tags have the following structure:
    <verse value="1" chapter="1">...some text...</verse>
    I need to extract the numbers of the 'value' and 'chapter' attributes to add them in the text and style them with character styles. Can this be done with inDesign or with some simple script? Or do I have to use XSLT? I have absolutely no experience of XSLT but I'll be looking into it. I'm assuming this should be quite easy for someone who knows these things though so if someone could give me a hand I'd be grateful.

    Ok, I've made some progress. I managed to put together the following XSL code, which creates tags based on the attribute types and puts the values as tag content:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="verse">
        <xsl:if test="@value = 1">
                  <chapter-number><xsl:value-of select="@chapter"/></chapter-number>
        </xsl:if>
        <verse-number><xsl:value-of select="@value"/></verse-number>
        <xsl:apply-templates/>
    </xsl:template>
    </xsl:stylesheet>
    The problem is that it removes all other tags. How can I keep this effect and still keep all the other tags?
    My other problem is that inDesign won't allow me to use this XSLT before import. It just says "could not write data to output". It works when I open the XML in a browser though so the code seems valid.

  • Extract XML attribute value for multi-item sequence

    Guys,
    I have already posted this in the XML DB forum, but am relying that some of you might help me.
    I have been searching for a solution for this and couldn't quite get it. I'm trying to get attribute values from multiple entries in a Node. It workes for a single node, but for multiple nodes, it fails. Could you please give me a solution?
    SQL> select extractvalue(column_value, '/WORLD/COUNTRY/@NAME') COUNTRY_NAME
      2        ,extractvalue(column_value, '/WORLD/COUNTRY/CITY/@NAME') CITY_NAME
      3        ,extractvalue(column_value, '/WORLD/COUNTRY/CITY/@POPULATION') POPULATION
      4  from xmltable('WORLD' passing xmltype('
      5  <WORLD>
      6  <COUNTRY NAME="INDIA">
      7  <CITY NAME="MUMBAI" POPULATION="10000"></CITY>
      8  </COUNTRY>
      9  </WORLD>'
    10  ));
    COUNTRY_NAME CITY_NAME POPULATION
    INDIA MUMBAI 10000When I execute the same for multiple nodes, it fails, please guide me. Please also let me know how to handle if I have an XML file containing this data.
    SQL> select extractvalue(column_value, '/WORLD/COUNTRY/@NAME') COUNTRY_NAME
      2        ,extractvalue(column_value, '/WORLD/COUNTRY/CITY/@NAME') CITY_NAME
      3        ,extractvalue(column_value, '/WORLD/COUNTRY/CITY/@POPULATION') POPULATION
      4  from xmltable('WORLD' passing xmltype('
      5  <WORLD>
      6  <COUNTRY NAME="INDIA">
      7  <CITY NAME="MUMBAI" POPULATION="10000"></CITY>
      8  <CITY NAME="CHENNAI" POPULATION="2000"></CITY>
      9  <CITY NAME="BANGALORE" POPULATION="13000"></CITY>
    10  <CITY NAME="HYDERABAD" POPULATION="14000"></CITY>
    11  </COUNTRY>
    12  </WORLD>'
    13  ));
    select extractvalue(column_value, '/WORLD/COUNTRY/@NAME') COUNTRY_NAME
    ERROR at line 1:
    ORA-19025: EXTRACTVALUE returns value of only one nodeCheers
    Sarma.

    So, this is the first step:
    SQL> with test as
      2  (select xmltype('<WORLD>
      3                 <COUNTRY NAME="INDIA">
      4                 <CITY NAME="MUMBAI" POPULATION="10000"></CITY>
      5                 <CITY NAME="CHENNAI" POPULATION="2000"></CITY>
      6                 <CITY NAME="BANGALORE" POPULATION="13000"></CITY>
      7                 <CITY NAME="HYDERABAD" POPULATION="14000"></CITY>
      8                 </COUNTRY>
      9  </WORLD>') resp from dual)
    10  select country
    11       , cities
    12  from xmltable('WORLD/COUNTRY' passing (select resp from test)
    13                         columns country varchar2(50) path '/COUNTRY/@NAME'
    14                               , cities xmltype path '/COUNTRY/CITY') world
    15  /
    COUNTRY         CITIES
    INDIA           <CITY NAME="MUMBAI" POPULATION="10000"/><CITY NAME
                    ="CHENNAI" POPULATION="2000"/><CITY NAME="BANGALOR
                    E" POPULATION="13000"/><CITY NAME="HYDERABAD" POPU
                    LATION="14000"/>two columns, one varchar2 and one xmltype.
    Then do the same thing with the second column, pass the XML to an XMLTABLE function
    SQL> with test as
      2  (select xmltype('<WORLD>
      3                 <COUNTRY NAME="INDIA">
      4                 <CITY NAME="MUMBAI" POPULATION="10000"></CITY>
      5                 <CITY NAME="CHENNAI" POPULATION="2000"></CITY>
      6                 <CITY NAME="BANGALORE" POPULATION="13000"></CITY>
      7                 <CITY NAME="HYDERABAD" POPULATION="14000"></CITY>
      8                 </COUNTRY>
      9  </WORLD>') resp from dual)
    10  select country
    11       , cit.name
    12       , cit.population
    13  from xmltable('WORLD/COUNTRY' passing (select resp from test)
    14                         columns country varchar2(50) path '/COUNTRY/@NAME'
    15                               , cities xmltype path '/COUNTRY/CITY') world
    16     , xmltable ('CITY' passing cities
    17                columns name varchar2(50) path '@NAME'
    18                      , population number path '@POPULATION'
    19                ) cit
    20  ;
    COUNTRY         NAME                                               POPULATION
    INDIA           MUMBAI                                                  10000
    INDIA           CHENNAI                                                  2000
    INDIA           BANGALORE                                               13000
    INDIA           HYDERABAD                                               14000

  • Extracting the Attributes values of an XML Element

    Dear Forum Members
    Please tell me any XML Function which is used to extract the Attribute value of an XML Element.
    Given below
    <BRKCD_STREDSWTINVIN_C Key="6708">
    is an Element With some Key value.
    I want to have that Key value.
    Using Extract and Extractvalue I am not able to get the Attribute value.
    Is there any way..
    Regards
    Madhu K

    Your xml is not really complete ;), but this should get you started:
    michaels>  with t as
    (select xmltype('<BRKCD_STREDSWTINVIN_C Key="6708"></BRKCD_STREDSWTINVIN_C>') xml from dual)
    select d.xml, d.xml.extract('//BRKCD_STREDSWTINVIN_C/@Key') key
      from t d
    XML                                                            KEY    
    <BRKCD_STREDSWTINVIN_C Key="6708"></BRKCD_STREDSWTINVIN_C>     6708   

  • Extracting XML Data to a flat file

    I have an application which is puting an XML string into a field in the database... now my problem is that I have to extract that information and put it in either 1. a flat file, or 2. a seperate table containing a column for each XML attribute... Does anyone know of the best way to approach either solution?
    cheers.

    And your Oracle version is?
    There are many different ways to put something into a file. How about UTL_FILE?http://www.psoug.org/reference/utl_file.html
    How to get it out of the table in the first place?
    I usually try a SELECT statement. They seem to work.
    PS: Databases don't have fields ... table's don't either. Check your verbiage.
    Try looking of the word "FIELD" in the Oracle docs. Then try "COLUMN."

  • Getting at a top-level XML attribute

    It's Friday afternoon... I'm fried and can't seem to figure
    out how to get at a top-level XML attribute.
    Some specifics...
    My XML doc has a single attribute in the top node followed by
    several "version" nodes
    <projData projectName="Spry Project">
    <version>
    I successfully load and create an xml data set from said XML
    file. Later on, I use the getDocument() method to refer to the XML
    DOM doc used by the original xml data set. I need to extract the
    value of the attribute "projectName" into a javascript variable.
    The xpath query should be "projData/@projectName" but all I
    get returned is an undefined value.
    Any ideas? I'm sure it's something simple that I'm
    overlooking.

    > can you please helo.
    This is impossible.
    Obviously your ABAP mapping is wrong. Fix it.

  • File-Adapter: Variable substitution form payload XML-attribute

    Hi experts,
    is possible to use XML-attribute-content for variable substitution in file-Adapter?
    extract from XML:
    <?xml version="1.0" encoding="utf-8" ?>
    - <all>
    - <transaction <b>file="filename"</b>>
    - <table name="BPAADDRESS" options="insertIfUpdateFails">
    - <record id="1">
      <hkeycol name="BPAMAINHKEY">0010500345</hkeycol>
      <hkeycol name="USAGE">Invoice</hkeycol>
      </transaction>
    I want to get the value "filename" = attribute file of transaction.
    Is this possible?
    Thanks a lot,
    Florian

    I have done this taking a field from the XML.
    You have to map the location of the field within the XML...
    Taken from:
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm
    Variable Substitution (Target Directory/File Name Scheme)
    If you set the Enable indicator, you can enter variables for the Target Directory and File Name Scheme. Enter the names of the variables and references in the table.
    &#9679;      Enter each variable that you reference in the Target Directory and File Name Scheme fields without the surrounding percentage sign under Name of Variables in the table.
    The variables can refer to attributes of the message header or elements of the message payload.
    &#9675;       If the variables are to refer to an attribute of the message header, add the prefix message: to the name of the variable under Reference. You can specify the following attributes of the message header:
    sender_party, sender_service, receiver_party, receiver_service, interface_name, interface_namespace,
    message_id (message ID with hyphens, for example 9fbe1ff1-9a0d-11d9-8665-cbf10a126331)
    message_id_hex (message ID in hexadecimal format, for example 9fbe1ff19a0d11d98665cbf10a126331)
    For example, if you want to specify the interface name from the message header in the target directory or in the file name scheme, enter message:interface_name as the reference.
    If one of the message attributes contains characters that are not permitted in a file name, for example \, /, :, *, ?, ", <, >, |, then these characters are replaced by an underscore ("_").
    &#9675;       If the variable refers to an element in XML schema, add the prefix payload: to the information under Reference. The reference then comprises a pseudo path description in the form of a comma-separated list with the schema namea,na,nameb,nb,....
    namea,nameb,... corresponds to the element name and na,nb,... corresponds to the occurrence of the element name at the respective level in the document.
    The description begins at the root of the document and ends at the respective element.
    To reference the element that is in bold in the example, the following expression is used: payload:root,1,e1,1,e2,2
    The parser searches for the first occurrence of the root element at the first level. It then searches for the first occurrence of e1 at the second level and for the second occurrence of e2 at the third level. The content of the last element (“Example Value”) is set as the value for a specified variable.
    <?xml version="1.0" encoding="UTF-8" ?>
    <root>
      <dummy>
         <e1>
            <e2>Data_1</e2>
            <f/>
            <g attr="abc">text</g>
            <e2>Data_2</e2>
         </e1>
      </dummy>
      <e1>
         <e2>illegal/value</e2>
         <f/>
         <g attr="abc">text</g>
         <e2 attr="fghij">Example Value</e2>
      </e1>
    </root>
    &#9679;      To disable the check the adapter performs for the element data, set the Disable Security Checks indicator.
    Otherwise, the adapter checks whether the element data contains characters that could lead to security risks in the file system environment. The check includes the characters “/“, “\“, and “..“.

  • XML attribute Undefined?!?

    Hey Flashers!!
    I need some help on the following:
    I am on AS2.0, CS4:
    i am trying to extract the following data from the XML attribute:
    <?xml version="1.0" encoding="utf-8"?>
    <mytext>
    < text ida="Hello world!" idb= "bye World!">
    </mytext>
    Here's my AS2.0 code, i tried to load the xml attributes into the two separate dinamic text fields:
    //load css
    var styles:TextField.StyleSheet = new TextField.StyleSheet();
    styles.setStyle("a:link",{textDecoration:'underline'});
    styles.setStyle("a:hover",{color:'#FF0000'});
    _parent.home_text.styleSheet = styles;
    //load in XML
    var meuXML:XML = new XML();
    meuXML.load("xml/content.php");
    meuXML.ignoreWhite = true;
    meuXML.onLoad = function() {
    _parent.home_text.htmlText = this.childNode[0].childNodes[0].attributes.ida;
    _parent.contacts_text.htmlText = this.childNodes[0],childNode[0].attributes.idb;
    I keep getting an Undefined error...
    Anyone??
    Thanks!!
    Cheers!

    Is this correct? i can't get it work anyway...
    <?xml version="1.0" encoding="utf-8"?>
    <mytext>
    <text ida="Hello world!" idb= "bye World!"></text>
    </mytext>
    AS2.0 code:
    //load css
    var styles:TextField.StyleSheet = new TextField.StyleSheet();
    styles.setStyle("a:link",{textDecoration:'underline'});
    styles.setStyle("a:hover",{color:'#FF0000'});
    _parent.home_text.styleSheet = styles;
    //load in XML
    var meuXML:XML = new XML();
    meuXML.load("xml/content.php");
    meuXML.ignoreWhite = true;
    meuXML.onLoad = function() {
    _parent.home_text.htmlText = this.childNodes[0].childNodes[0].attributes.ida;
    _parent.contacts_text.htmlText = this.childNodes[0],childNodes[0].attributes.idb;

  • Re-Using XML file from decode barcode + extract xml process

    I was hoping someone could put me in the right direction here. I am decodeing the information stored in a 2D Bar code and sending this information to an XML file, then I am trying to combine that xml file with a blank PDF template but the process is failing beacuse there are some additional tag fields the XML data from the  Decode->Extract XML process.
    The XML file from the decode process gives the structure below..notice therer some extra tags (lines 2- 4)
    <?xml version="1.0" encoding="UTF-8"?>
    <xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">
    <xfa:datasets>
    <xfa:data>
    <form1>
    The XML structure that is expected by the PDF template is as follows
    <?xml version="1.0" encoding="UTF-8"?>
    <form1>
    So the xml output of the Decode barcode + Extract XML process has three extra lines of tag. Is there a way I could use a process within liveCycle to clean out those three lines in real-time before sending the xml to be recombined with the PDF template.
    Thanks

    Hi,
    What you may do is to use the SetValue and its xpath builder functions to "serialize" the xml into string, "substring" to remove the extra tags, and "concat" to add the extra tags and then "deserialize" it again to an xml to be merged with your form.
    Greetings,
    Yasser

  • Process XML attributes of all tables in a structured document

    Hi all,
    I try to process the XML attributes of all tables in a structured document.
    When I use SelectedTbl everything works fine for the selected table and the attributes of the tabelle Element are written correctly to the Console.
    doc = app.ActiveDoc;
    table = doc.SelectedTbl;
    if (table.TblElement)
        Console('Elementname: ' + table.TblElement.ElementDef.Name);
        tblEle = table.Element;
        attrs = tblEle.GetAttributes();
        for (i = 0; i < attrs.len; i++) {
            aName = attrs[i].name;
            aWert = attrs[i].values;
            Console( "     " + aName + "    " + aWert);     
    However when I use GetText(Constants.FTI_TblAnchor) to walk through all tables of the documens neither ElementDef.Name nor Attributes are processed.
    var flow = doc.FirstFlowInDoc;
    var textItems = flow.GetText(Constants.FTI_TblAnchor);
    while(iTab<textItems.length) {
    table = textItems[iTab].obj;
    if (table.TblElement)
        Console('Elementname: ' + table.TblElement.ElementDef.Name);
        tblEle = table.Element;
        attrs = tblEle.GetAttributes();
        for (i = 0; i < attrs.len; i++) {
            aName = attrs[i].name;
            aWert = attrs[i].values;
            Console( "     " + aName + "    " + aWert);     
    Any Suggestions?
    Yours
    Wolfgang

    You'll probably want all the tables from the main flow. Try
    var flow = doc.MainFlowInDoc;
    Kind regards
    JoH

  • XML attributes as a response

    My skills are rudimentary, I'm a new flex developer. I have
    done all of the tutorials and examples and I'm just struggling with
    using an XML attribute checking a response.
    I've written a simple flex 3 app to talk to Asterisk AJAM.
    I'm writing the login piece-- and i'm having trouble parsing this
    response from an http service (successful login) my problem comes
    in with the value not being as such
    <item>valuehere</item> it's part of the tag, an
    attribute i would suppose.:
    <ajax-response>
    <response type="object" id="unknown">
    <generic response="Success" message="Authentication
    accepted"/>
    </response>
    </ajax-response>
    What I have is a simple app with a http service and a login
    form. I have an event handler for the HTTP service, but I don't
    know how to parse for that generic response tag. Anyone know how to
    format an XML object for that type of response and throw a simple
    if statement looking for that attribute?
    Failure looks like this BTW:
    <ajax-response>

    <response type="object" id="unknown">
    <generic response="Error" message="Authentication
    failed"/>
    </response>
    </ajax-response>
    Thank you,
    Brian

    I've came up with the following code trying to use XML
    attributes from the response above--- it doesn't work but here is
    what I have (right now the if statement is commented out.... i'm
    trying to have it do an alert which doesn't work either):
    ---source---
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:states>
    <mx:State name="Logged In">
    <mx:SetProperty target="{panel1}" name="width"
    value="95%"/>
    <mx:SetProperty target="{panel1}" name="height"
    value="95%"/>
    <mx:RemoveChild target="{password}"/>
    <mx:RemoveChild target="{username}"/>
    <mx:RemoveChild target="{label1}"/>
    <mx:RemoveChild target="{Submit}"/>
    <mx:RemoveChild target="{label2}"/>
    <mx:SetProperty target="{panel1}" name="title"
    value="Once Logged In"/>
    <mx:AddChild relativeTo="{panel1}"
    position="lastChild">
    <mx:Label x="10" y="10" text="You properly
    authentictaed!"/>
    </mx:AddChild>
    <mx:AddChild relativeTo="{panel1}"
    position="lastChild">
    <mx:Label x="10" y="62" text="Label"/>
    </mx:AddChild>
    </mx:State>
    </mx:states>
    <mx:Script>
    <![CDATA[
    import mx.rpc.events.ResultEvent;
    var MyXML:XML;
    private function checkLogin(evt:ResultEvent):void
    MyXML = evt.result.channel.item;
    mx.controls.Alert.show(MyXML.@*);
    trace(MyXML.@*.toXMLString());
    /* if (MyXML.attribute(ajax-response.response.@generic) ==
    "Success") {
    if (MyXML.ajax-response.response.(@generic == "Success"))
    currentState = "Logged In";
    if (MyXML.ajax-response.response.(@generic == "Error"))
    mx.controls.Alert.show('Invalid username/password');
    ]]>
    </mx:Script>
    <mx:HTTPService id="login_user"
    result="checkLogin(event)" showBusyCursor="true" method="GET" url="
    http://72.22.224.90:8088/asterisk/mxml"
    useProxy="false">
    <mx:request xmlns="">
    <action>login</action>
    <username>
    {username.text}
    </username>
    <password>
    {password.text}
    </password>
    </mx:request>
    </mx:HTTPService>
    <mx:Panel resizeEffect="Resize" width="250" height="200"
    layout="absolute" title="Login System" horizontalCenter="0"
    verticalCenter="-2" id="panel1">
    <mx:Label x="10" y="10" text="Username:" id="label1"/>
    <mx:TextInput x="10" y="36" id="username"/>
    <mx:Label x="10" y="66" text="Password:" id="label2"/>
    <mx:TextInput x="10" y="92" id="password"
    displayAsPassword="true"/>
    <mx:Button x="10" y="122" label="Submit" id="Submit"
    click="login_user.send();"/>
    </mx:Panel>
    </mx:Application>

  • XML attributes instead of elements in data contract serialisation in Rest WCF implementation

    I want to uses XML attributes instead of elements, I implemented IXmlSerializable and
    public partial class Id : IXmlSerializable {
    /// <remarks/>
    [XmlAttribute]
    public string lmsId;
    /// <remarks/>
    [XmlAttribute]
    public string unitId;
    /// <remarks/>
    [XmlAttribute]
    public string lmsPresId;
    /// <remarks/>
    [XmlAttribute]
    public string callId;
    public System.Xml.Schema.XmlSchema GetSchema()
    return null;
    public void ReadXml(System.Xml.XmlReader reader)
    //implement if remote callers are going to pass your object in
    public void WriteXml(System.Xml.XmlWriter writer)
    writer.WriteAttributeString("lmsId", lmsId.ToString());
    writer.WriteAttributeString("unitId", unitId.ToString());
    writer.WriteAttributeString("lmsPresId", lmsPresId.ToString());
    writer.WriteAttributeString("callId", callId.ToString());
    But my service help is showing request and response as unknown
    I tried even XmlSerializerFormat public partial class Id : IXmlSerializable {
    /// <remarks/>
    [XmlAttribute]
    public string lmsId;
    /// <remarks/>
    [XmlAttribute]
    public string unitId;
    /// <remarks/>
    [XmlAttribute]
    public string lmsPresId;
    /// <remarks/>
    [XmlAttribute]
    public string callId;
    public System.Xml.Schema.XmlSchema GetSchema()
    return null;
    public void ReadXml(System.Xml.XmlReader reader)
    //implement if remote callers are going to pass your object in
    public void WriteXml(System.Xml.XmlWriter writer)
    writer.WriteAttributeString("lmsId", lmsId.ToString());
    writer.WriteAttributeString("unitId", unitId.ToString());
    writer.WriteAttributeString("lmsPresId", lmsPresId.ToString());
    writer.WriteAttributeString("callId", callId.ToString());
    then I am getting everything in the xml as xmlElements instead of XmlAttributes But I am getting all the data as elements instead of Xmlattributes

    I will test it.
    I sale myself ONLY half CNY!

  • Maximum size of an XML attribute?

    What is the maximum size of an XML attribute?
    I can't find this define in the OMG XML specification. Does the Oracle XML parser have a maximum size of an XML attribute? Do other XML parsers on the market have any limitation? ... we need to exchange XML documents with other vendors. Thanks.

    While I can't speak for other parsers, the Oracle ones do not have an attribute size limit.
    Oracle XML Team
    null

  • Extract XML from an XML File

    Hi All,
    I have an xml file from which data has to be extracted and inserted into table. XML file looks like this..
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!DOCTYPE labels SYSTEM "label.dtd">
    <labels FORMAT="Harvest Label for Lot Project" QUANTITY="1" PRINTERNAME="PFP3400E006" JOBNAME="JA272017">
    <label>
    <variable name= "ITEM">PM191_JTEST</variable>
    <variable name= "ITEM_DESC">6 Pack Blue Assembled 2004 JTEST</variable>
    <variable name= " LOT ">ja28-10</variable>
    <variable name= "QUANTITY">1</variable>
    </label>
    </labels>
    In the above xml, if i remove <!DOCTYPE labels SYSTEM "label.dtd"> and use the below query, I am able to get the details.
    SELECT EXTRACTVALUE(VALUE(x), 'labels/@_FORMAT') format
    ,EXTRACTVALUE(VALUE(x), 'labels/@_QUANTITY') QUANTITY
    ,EXTRACTVALUE(VALUE(x), 'labels/@_PRINTERNAME') PRINTERNAME
    ,EXTRACTVALUE(VALUE(x), 'labels/@_JOBNAME') JOBNAME
    FROM (SELECT XMLTYPE
    ('<?xml version="1.0" encoding="UTF-8" standalone="no"?> <labels FORMAT="Harvest Label for Lot Project" QUANTITY="1" PRINTERNAME="PFP3400E006" JOBNAME="JA272017"> <label> <variable name= "ITEM">PM191_JTEST</variable> <variable name= "ITEM_DESC">6 Pack Blue Assembled 2004 JTEST</variable> <variable name= " LOT ">ja28-10</variable> <variable name= "QUANTITY">1</variable> </label> </labels>' ) xml
    FROM DUAL),
    TABLE(XMLSEQUENCE(EXTRACT(xml, 'labels'))) x
    But <!DOCTYPE labels SYSTEM "label.dtd"> tag is there means then i am getting error as
    Invalid resource handle or path name "/label.dtd"
    Please let me know how we can parse the xml and insert into table. OR how can i remove <!DOCTYPE labels SYSTEM "label.dtd"> tag and process it further.
    Thanks and Regards,
    Mahesh
    Edited by: magu on Sep 2, 2009 3:15 PM
    Edited by: magu on Sep 2, 2009 3:16 PM

    I don't understand why the DOCTYPE is in the XML, but it appears that Oracle is trying to resolve label.dtd to a registered resource. As you discovered, it may be easier to remove the DOCTYPE from the XML then try to register the label.dtd resource within Oracle. To do this, some options are
    - Use the REPLACE command
    - treat the data as a CLOB and instr/substr to build a new clob without the DOCTYPE tag in it.
    - Use the REGEXP_REPLACE command
    Also, if your DB version supports XMLTable, here is the way to do it with that.
    SELECT *
      FROM XMLTABLE('/labels'
                    PASSING XMLTYPE('<?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <labels _FORMAT="Harvest Label for Lot Project" _QUANTITY="1" _PRINTERNAME="PFP3400E006" _JOBNAME="JA272017">
         <label>
              <variable name="ITEM">PM191_JTEST</variable>
              <variable name="ITEM_DESC">6 Pack Blue Assembled 2004 JTEST</variable>
              <variable name=" LOT ">ja28-10</variable>
              <variable name="QUANTITY">1</variable>
         </label>
    </labels>
                    COLUMNS
                    format    VARCHAR2(15) PATH '@_FORMAT',
                    quantity  VARCHAR2(15) PATH '@_QUANTITY',
                    printername  VARCHAR2(15) PATH '@_PRINTERNAME',
                    jobname  VARCHAR2(15) PATH '@_JOBNAME');

  • Using BPEL console testing with XML attributes

    I'm having trouble with using an XML attribute in my BPEL process. When I put an attribute on my input element, the BPEL Console test page no longer works. Here's what I'm doing:
    I create a synchronous new BPEL project in JDeveloper using the default input and output XSDs, and add a simple assign to assign the input to the output. When I deploy this and look at it in BPEL console, I can see the input field and enter my value to test.
    Now I go back into JDeveloper and add an attribute to the input element, and then redeploy my process. Now when I go into BPEL console, the Initiate tab no longer has any field for me to enter my value. Clicking the XML Source radio button doesn't help either. (I also tried invoking the BPEL process web service through the app server control - same issue.)
    I'm using JDeveloper 10.1.3.3 with App Server 10.1.3.3.0. Does anyone know how to make the BPEL Console testing work with XSDs that contain attributes?
    Thanks,
    Skip

    A bit more info on this. It doesn't appear that the problem is limited to the console tester. I created another BPEL process which calls my original process, and attempted to set the attribute on the input using the Assign activity. JDeveloper generated this:
    <assign name="Assign_1">
    <copy>
    <from variable="inputVariable" part="payload"
    query="/client:TestAttributes2ProcessRequest/client:input"/>
    <to variable="Invoke_1_process_InputVariable" part="payload"
    query="/ns1:TestAttributesProcessRequest/ns1:input"/>
    </copy>
    <copy>
    <from expression="'bob'"/>
    <to variable="Invoke_1_process_InputVariable" part="payload"
    query="/ns1:TestAttributesProcessRequest/ns1:input/@attribute1"/>
    </copy>
    </assign>
    As you can see this is mapping a variable into the /TestAttributesProcessRequest/input element and then attempting to set the attribute of that element to the value 'bob'. This compiles just fine but when this code is executed, this error occurs:
    Error in <assign> expression: <to> value is empty at line "87". The XPath expression : "" returns zero node, when applied to document shown below:
    oracle.xml.parser.v2.XMLElement@7efe7efe
    (Line 87 is query="/ns1:TestAttributesProcessRequest/ns1:input/@attribute1"/>)
    Is there something wrong with this generated code? Do I need to do some kind of custom code to set attributes, instead of using the graphical tools in JDeveloper?

Maybe you are looking for