Xmlns attribute in 8.1.7

I am trying to process an XML file with the Oracle 8.1.7 PL/SQL XDK. I'm using Steve's helper programs from the XML book. The problem is that the document in question uses XML Schema. My script chokes whenever I attempt anything with this file. After a lot of investigation I have established that it's the xmlns attibute that it doesn't like (see testcase below).
Given that I can't upgrade to 9i just yet is there anything I can do to get this code working?
Cheers In Advance, APC
This doesn't can't find my attribute...
SQL> DECLARE
2 xdoc xmldom.DOMDocument;
3 l_file varchar2(32000) := '<MYROOT xmlnsBOB="http://www.somewhere.co.uk"> '
4 || ' <MYTAG>stuff</MYTAG> '
5 || '</MYROOT>';
6 lv_file_ref varchar2(240);
7 parser xmlparser.Parser;
8 BEGIN
9 parser := xmlparser.newParser;
10 xmlparser.setValidationMode(parser, FALSE);
11 xmlparser.parseBuffer(parser,l_file);
12 xdoc := xmlparser.getDocument(parser);
13 xmlparser.freeParser(parser);
14 lv_file_ref := xpath.valueOf(xdoc, '/MYROOT/MYTAG');
15 dbms_output.put_line('!'||lv_file_ref||'!');
16* END;
PL/SQL procedure successfully completed.
but runs okay if I rename the xmlns attribute...
SQL> DECLARE
2 xdoc xmldom.DOMDocument;
3 l_file varchar2(32000) := '<MYROOT xmlnsBOB="http://www.somewhere.co.uk"> '
4 || ' <MYTAG>stuff</MYTAG> '
5 || '</MYROOT>';
6 lv_file_ref varchar2(240);
7 parser xmlparser.Parser;
8 BEGIN
9 parser := xmlparser.newParser;
10 xmlparser.setValidationMode(parser, FALSE);
11 xmlparser.parseBuffer(parser,l_file);
12 xdoc := xmlparser.getDocument(parser);
13 xmlparser.freeParser(parser);
14 lv_file_ref := xpath.valueOf(xdoc, '/MYROOT/MYTAG');
15 dbms_output.put_line('!'||lv_file_ref||'!');
16* END;
!stuff!
PL/SQL procedure successfully completed.
SQL>

I am trying to process an XML file with the Oracle 8.1.7 PL/SQL XDK. I'm using Steve's helper programs from the XML book. The problem is that the document in question uses XML Schema. My script chokes whenever I attempt anything with this file. After a lot of investigation I have established that it's the xmlns attibute that it doesn't like (see testcase below).
Given that I can't upgrade to 9i just yet is there anything I can do to get this code working?
Cheers In Advance, APC
This doesn't can't find my attribute...
SQL> DECLARE
2 xdoc xmldom.DOMDocument;
3 l_file varchar2(32000) := '<MYROOT xmlnsBOB="http://www.somewhere.co.uk"> '
4 || ' <MYTAG>stuff</MYTAG> '
5 || '</MYROOT>';
6 lv_file_ref varchar2(240);
7 parser xmlparser.Parser;
8 BEGIN
9 parser := xmlparser.newParser;
10 xmlparser.setValidationMode(parser, FALSE);
11 xmlparser.parseBuffer(parser,l_file);
12 xdoc := xmlparser.getDocument(parser);
13 xmlparser.freeParser(parser);
14 lv_file_ref := xpath.valueOf(xdoc, '/MYROOT/MYTAG');
15 dbms_output.put_line('!'||lv_file_ref||'!');
16* END;
PL/SQL procedure successfully completed.
but runs okay if I rename the xmlns attribute...
SQL> DECLARE
2 xdoc xmldom.DOMDocument;
3 l_file varchar2(32000) := '<MYROOT xmlnsBOB="http://www.somewhere.co.uk"> '
4 || ' <MYTAG>stuff</MYTAG> '
5 || '</MYROOT>';
6 lv_file_ref varchar2(240);
7 parser xmlparser.Parser;
8 BEGIN
9 parser := xmlparser.newParser;
10 xmlparser.setValidationMode(parser, FALSE);
11 xmlparser.parseBuffer(parser,l_file);
12 xdoc := xmlparser.getDocument(parser);
13 xmlparser.freeParser(parser);
14 lv_file_ref := xpath.valueOf(xdoc, '/MYROOT/MYTAG');
15 dbms_output.put_line('!'||lv_file_ref||'!');
16* END;
!stuff!
PL/SQL procedure successfully completed.
SQL>

Similar Messages

  • XSLT Mapping: Problem in appending xmlns attribute

    Hi
    This is my source message
    <?xml version="1.0" encoding="UTF-8"?>
    <soap-env:Envelope xmlns:soap-env= "http://schemas.xmlsoap.org/soap/envelope/">
    <soap-env:Body>
    <OrderID xmlns="http://dummyvalue">12345</OrderID>
    </soap-env:Body>
    My XSLT mapping
    <?xml version='1.0' ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
    <xsl:template match="/">
    <soap-env:Envelope>
    <soap-env:Body>
    <OrderID>
    <xsl:attribute name = "xmlns" >
    <xsl:value-of select="@xmlns"/>
    </xsl:attribute>
    <xsl:text>12345</xsl:text>
    </OrderID>
    </soap-env:Body>
    </soap-env:Envelope>
    </xsl:template>
    </xsl:stylesheet>
    I am getting the error message as
    ERROR: Description: The value of the 'name' attribute may not be 'xmlns'.
    Please help me how to append xmlns attribute in OrderID element ??

    Hi,
    Use <xsl:element> to create a node in the output and specify the namespace.
    <xsl:element
    name="name"
    namespace="URI"
    use-attribute-sets="namelist">  <!-- Content:template --></xsl:element>
    Thanks,
    Beena.

  • Problem with ora:output and xmlns attribute

    Using lastest XDK.
    I am using the built in extension ora:output in a stylesheet running via XSQL called from a small java prg.
    I am using this to generate several html fragments that will get processed later on not by xsql or xml/xsl but by another java prg.
    I have specifed the output as html BUT when I look at the output some of the elements have an xmlns attribute added i.e. xmlns:ora="http://www.oracle.com/XSL/Transform/java"....
    Strange thing its not on all elements, "a", "tr", "td" tags are ok but "b", "br" and "table" have this attribute added.... HELP!!
    How do I stop this attribute getting added...
    Many thanks
    Rob
    PS I know if I use an "html" tag to wrap the output then only that element ends up with the xmlns attribute but I cant/dont want to do this as the prg running later will combine many of these fragments to create a single "real" html page.

    I'm not sure whether i understand your problem,
    It doesnot need using the binding attribute If you wanna updating the value of each rows in the datatable.
    below is a sample that updating each rows of a datatable
    jsp file
    <h:dataTable value="#[sampleBean.data}" var="row">
        <h:column><h:inputText value="#{row.col1}"/></h:column>
    </h:dataTable>
    <h:commandButton value="update" action="#{sampleBean.update}"/>BackingBean:
    SampleBean.java
    public class Samplebean{
      private SampleRow[] rows[];
      public SampleRow[] getData{
              return rows;
      public String update(){
          for(int i=0; i<rows.length; i++){
             rows.update();
    return "success";
    SampleRow.java
    public class SampleRow{
      private String col1;
      public String getCol1(){
        return col1;
      public void setCol1(String col1){
        this.col1 = col1;
      public void update(){
         //write your code to save one row data to db/file here

  • Xmlns attribute appearing in top level node

    I have an xml message that is parsed and its DOM tree built. Then a portion of the message, identified by an xpath, is extracted which is stored as XMLNode, which is later printed to a stream.
    Using the latest Oracle XML library ( comes with Oracle 10 ), the top level element in the node is always appended with extra 'xmlns' attribute.
    This is an example. The original message does not have
    this extra xmlns attribute.
    <RESPONSE xmlns="http://www.nlis-hub.co.uk/NS/2001-01-10">
    <PROPERTY_1>description 1</PROPERTY_1>
    <PROPERTY_2>description 2</PROPERTY_2>
    <PROPERTY_3>description 3</PROPERTY_3>
    </RESPONSE>
    How can we turn this behaviour off ?
    Thanks,
    Dwi

    THanks for replying.
    Yes, the XML document has the namespace specified:
    <ROOT_MESSAGE xmlns="http://www.nlis-hub.co.uk/NS/2001-01-10" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.nlis-hub.co.uk/NS/2001-01-10 Schema.xsd">
    <RESPONSE>
    <PROPERTY_1>description 1</PROPERTY_1>
    <PROPERTY_2>description 2</PROPERTY_2>
    <PROPERTY_3>description 3</PROPERTY_3>
    </RESPONSE>
    </ROOT_MESSAGE>
    In our application, we are storing the <RESPONSE>
    block to db as CLOB. We have a requirement to store it
    exactly as it was received. However, the XML parser (or something) is including the xmlns attribute in the top level node of that portion
    <RESPONSE xmlns="http://www.nlis-hub.co.uk/NS/2001-01-10">
    </RESPONSE>
    This is what is done to obtain the node:
    (xpathStr is the xpath to the RESPONSE node )
    NodeList nodeList = xmlDocument_.selectNodes( xpathStr, this );
    int nodeLength = nodeList.getLength();
    StringWriter xmlStringWriter = new StringWriter();
    PrintWriter xmlPrintWriter = new PrintWriter( xmlStringWriter );
    for( int nodeIndex = 0; nodeIndex < nodeLength; ++nodeIndex )
    XMLNode node = (XMLNode)nodeList.item( nodeIndex );
    node.print( xmlPrintWriter );
    StringBuffer xmlStringBuffer = xmlStringWriter.getBuffer();
    By the time it gets to the output stream, it already has the xmlns attribute appended to the top level node.
    How can we prevent this ?
    Thanks,
    Dwi

  • JAXP puts xmlns: attributes in HTML stylesheet output!

    I'm using JAXP 1.2 to convert an XML document to HTML. The problem I am having is that it is placing xmlns: attributes in the first HTML element I output. I believe this has something to do with the fact that the template matches an element in a non-default namespace in the source document. The template is as follows:
    <xsl:template match="news:news-event">
       <table border="0" cellpadding="0" cellspacing="0" width="640">
         <xsl:apply-templates/>
       </table>
    </xsl:template>Which creates the following HTML:
    <table xmlns:news="http://www.news.qut.edu.au/"...(... inserted by me). I have declared the URI for the news namespace in the stylesheet element:
    xmlns:news="http://www.news.qut.edu.au/"I have specified the output method as HTML:
    <xsl:output method="html"/>Is there any way I can stop the transformer from specifying the xmlns: attribute in the output HTML as it is not valid and has nothing to do with the table element I am trying to generate?
    Thanks,

    You need to use the exclude-result-prefixes attribute in your xsl:stylesheet element.

  • Simple Transformations: How deserialize xmlns attributes?

    Hello all,
    during deserializing Simple Transformations ignore surplus attributes in the xml input stream. With one exception: u201Exmlnsu201C (namespace) attributes apparently are not ignored.
    Take for example the xml file:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <CITIES someattribute="XYZ">
      <CITY>Hamburg</CITY>
      <CITY>Berlin</CITY>
    </CITIES>
    This file can be processed successfully by the simple transformation:
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
      <tt:root name="CITIES"></tt:root>
      <tt:template>
        <CITIES>
          <tt:loop ref="CITIES">
            <CITY tt:value-ref="CITY"></CITY>
          </tt:loop>
        </CITIES>
      </tt:template>
    </tt:transform>
    When trying to process the following xml file by the same transformation, however, a CX_ST_MATCH_ELEMENT error is thrown.
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <CITIES xmlns="XYZ">
      <CITY>Hamburg</CITY>
      <CITY>Berlin</CITY>
    </CITIES>
    How can xmlns attributes be deserialized (ignored) with simple transformations?
    Thanks for any hint!
    Simon
    PS:
    To reproduce the error the following ABAP can be used in combination with the quoted simple transformation:
    REPORT  ztestsd13.
    TYPES: BEGIN OF lty_cities,
            city(20) TYPE c,
           END OF lty_cities.
    DATA: ls_cities TYPE lty_cities,
          lt_cities TYPE TABLE OF lty_cities,
          lv_xml TYPE string,
          lv_cities_element TYPE string,
          lv_error TYPE string,
          lo_error TYPE REF TO cx_transformation_error.
    PARAMETERS: lp_incns TYPE boolean DEFAULT ''.
    CASE lp_incns.
      WHEN 'X'.
        lv_cities_element = '<CITIES xmlns="XYZ">'.
      WHEN OTHERS.
        lv_cities_element = '<CITIES someattribute="XYZ">'.
    ENDCASE.
    CONCATENATE:
    '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
    lv_cities_element
    '<CITY>Hamburg</CITY>'
    '<CITY>Berlin</CITY>'
    '</CITIES>' INTO lv_xml.
    TRY.
        CALL TRANSFORMATION ('Z_CITIES')
          SOURCE XML lv_xml
          RESULT cities = lt_cities.
      CATCH cx_transformation_error INTO lo_error.
        lv_error = lo_error->get_text( ).
        WRITE: 'Transformation not successful'.
        SKIP.
        WRITE: lv_error.
        EXIT.
    ENDTRY.
    WRITE: 'Transformation successful'.
    SKIP.
    LOOP AT lt_cities INTO ls_cities.
      WRITE: / ls_cities-city.
    ENDLOOP.
    Edited by: Simon Dähnhardt on Oct 20, 2009 6:04 PM

    first of all your xml isn't well formatted
    root element must be only one like
    <?xml version="1.0" encoding="UTF-8"?>
    <root>
    <result xmlns="http://xmlns.oracle.com/oracleas/schema/dbserver_audittrail-11_2.xsd">
    <DB_User>DBSNMP</DB_User>
    <Userhost>localhost.localdomain</Userhost>
    </result>
    <result xmlns="http://xmlns.oracle.com/oracleas/schema/dbserver_audittrail-11_2.xsd">
    <DB_User>DBSNMP</DB_User>
    <Userhost>localhost.localdomain</Userhost>
    </result>
    </root>or may be in your case
    <?xml version="1.0" encoding="UTF-8"?>
    <result xmlns="http://xmlns.oracle.com/oracleas/schema/dbserver_audittrail-11_2.xsd">
    <DB_User>DBSNMP</DB_User>
    <Userhost>localhost.localdomain</Userhost>
    </result>for remove you can use xslt as example for xmltransform
    SQL> select * from v$version where rownum=1;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    SQL>
    SQL> with t as
      2  (select xmltype(
      3  '<?xml version="1.0" encoding="UTF-8"?>
      4  <result xmlns="http://xmlns.oracle.com/oracleas/schema/dbserver_audittrail-11_2.xsd">
      5  <DB_User xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">DBSNMP</DB_User>
      6  <Userhost xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">localhost.localdomain</Userhost>
      7  </result>') xml from dual)
      8  --
      9  select xmltransform(t.xml, xmltype('<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    10  <xsl:output method="xml" indent="no"/>
    11  <xsl:template match="*">
    12      <xsl:element name="{local-name()}">
    13        <xsl:apply-templates select="node()"/>
    14      </xsl:element>
    15  </xsl:template>
    16  </xsl:stylesheet>'))
    17  from t
    18  /
    XMLTRANSFORM(T.XML,XMLTYPE('<X
    <?xml version="1.0" encoding="utf-8"?>
    <result><DB_User>DBSNMP</DB_User><Userhost>localhost.localdomain</Userhost></res
    SQL> --add
    or try add local-name() to your main xquery
    Edited by: AlexAnd on Dec 12, 2012 12:05 AM

  • How to remove xmlns attribute from XML tag?

    Hello!
    I have a XMLType document:
    --- P R O B L E M # 1 ---
    <?xml version="1.0" encoding="windows-1257" ?>
    <RESPONSE xmlns="http://testserver" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://testserver response.xsd">
    <DATA REQUEST_ID="111">
    <ENTITY name="PACKAGE_001">
    <ATTRIBUTE name="PERS_ID" value="1111" />
    <ATTRIBUTE name="FIRST_NAME" value="OLGA" />
    <ATTRIBUTE name="SURNAME" value="NOVIKOVA" />
    </ENTITY>
    </DATA>
    </RESPONSE>
    I very need to remove from RESPONSE tag all addition information. Result I need is:
    <?xml version="1.0" encoding="windows-1257" ?>
    <RESPONSE>
    <DATA REQUEST_ID="111">
    <ENTITY name="PACKAGE_001">
    <ATTRIBUTE name="PERS_ID" value="1111" />
    <ATTRIBUTE name="FIRST_NAME" value="OLGA" />
    <ATTRIBUTE name="SURNAME" value="NOVIKOVA" />
    </ENTITY>
    </DATA>
    </RESPONSE>
    What can I do in this situation? My Oracle version is 9.2.
    --- P R O B L E M # 2 ---
    How I can create from source XML this one:
    <?xml version="1.0" encoding="windows-1257" ?>
    <MY_RESPONSE>
    <RESPONSE xmlns="http://testserver" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://testserver response.xsd">
    <DATA REQUEST_ID="111">
    <ENTITY name="PACKAGE_001">
    <ATTRIBUTE name="PERS_ID" value="1111" />
    <ATTRIBUTE name="FIRST_NAME" value="OLGA" />
    <ATTRIBUTE name="SURNAME" value="NOVIKOVA" />
    </ENTITY>
    </DATA>
    </RESPONSE>
    </MY_RESPONSE>
    Thanks for your answers!
    Flu

    Maybe the problem#1 can be solved with a simple pl/sql using REPLACE statement. start with the <RESPONSE and look for the end > and get the entire string and replace that with only <RESPONSE> or maybe you can achieve this using xmldom to delete the attributes as part of the element.
    PRoblem#2 can be solved in this way.
    select xmlelement("MY_RESPONSE",
    xmltype('<RESPONSE xmlns="http://testserver" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://testserver response.xsd">
    <DATA REQUEST_ID="111">
    <ENTITY name="PACKAGE_001">
    <ATTRIBUTE name="PERS_ID" value="1111" />
    <ATTRIBUTE name="FIRST_NAME" value="OLGA" />
    <ATTRIBUTE name="SURNAME" value="NOVIKOVA" />
    </ENTITY>
    </DATA>
    </RESPONSE>')).GetClobVal()
    from dual
    /

  • Firefox doesn't display xmlns attribute?

    e.g xml
    <root xmlns="www.myurl.com">
    <child xmlns="">this is child</child>
    </root>

    Type '''about:preferences#content'''<enter> in the address bar.
    Across from '''fonts and colors,''' press the '''Advanced''' button.
    On the bottom, turn on '''Allow Web Sites To Choose Their Own.'''
    Separate Issue;
    Your System Details shows;
    Installed Plug-ins
    Shockwave Flash 17.0 r0
    Shockwave Flash 15.0 r0
    and
    1Password 3.9.20 ([email protected])
    1Password 4.3.1 ([email protected])
    Having more than one version of a program may cause issues.
    Flash;
    Grab the uninstaller from here:
    '''[http://helpx.adobe.com/flash-player/kb/uninstall-flash-player-windows.html Uninstall Flash Player | Windows]'''
    '''[http://helpx.adobe.com/flash-player/kb/uninstall-flash-player-mac-os.html Uninstall Flash Player | Mac]'''
    Then reinstall the latest version.
    Flash Player '''Version 17.0.0.169<br>https://www.adobe.com/products/flashplayer/distribution3.html'''

  • Additional attributes (such as "xmlns:xsi") in document

    How can I add some additional attributes in in my toplevel element when creating
    a new XML document from scratch using XMLBeans. For example the attributes "xmlns:xsi"
    and "xsi:schemaLocation" in the sample below:
    <?xml version="1.0" encoding="UTF-8"?>
    <MyDoc xmlns="http://www.xxx.nl/yyy" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.xxx.nl/yyy myXsd.xsd">
    <..../>
    <..../>
    </MyDoc>
    XML does add the "xmlns" attribute itself. How can I add the two other attributes?
    Currently I have a workaround. I read an "empty" XML-file containing these attributes
    using XMLBeans (parse) and then I fill the empty structure. But I feel that there
    has to be a better solution. Unfortunately I cannot find it.
    Any help is appreciated. Thank you in advance.

    Hello Olaf -- You might trying using an XML cursor. So assuming you've
    compiled a schema to generate XMLBeans types, you might do something like
    the following.
    MyDocDocument myDocDoc = MyDocDocument.Factory.newInstance();
    MyDoc myDoc = MyDocDocument.getMyDoc();
    // Create a cursor and move it to where you want to start inserting
    attributes.
    XmlCursor cursor = myDoc.newCursor();
    cursor.toFirstContentToken();
    cursor.toLastAttribute();
    // Insert your attributes.
    cursor.insertAttributeWithValue("schemaLocation","http://www.w3.com/2001/XML
    Schema-instance", "http://www.xxx.nl/yyy myXsd.xsd");
    // ...add other attributes in a similar way...
    // Dispose of the cursor.
    cursor.dispose();
    Without a schema, you'd be working with the XmlObject returned from your
    newInstance or parse method.
    Steve
    "Olaf Wienk" <[email protected]> wrote in message
    news:4029ee05$[email protected]..
    >
    How can I add some additional attributes in in my toplevel element whencreating
    a new XML document from scratch using XMLBeans. For example the attributes"xmlns:xsi"
    and "xsi:schemaLocation" in the sample below:
    <?xml version="1.0" encoding="UTF-8"?>
    <MyDoc xmlns="http://www.xxx.nl/yyy"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.xxx.nl/yyy myXsd.xsd">
    <..../>
    <..../>
    </MyDoc>
    XML does add the "xmlns" attribute itself. How can I add the two otherattributes?
    >
    Currently I have a workaround. I read an "empty" XML-file containing theseattributes
    using XMLBeans (parse) and then I fill the empty structure. But I feelthat there
    has to be a better solution. Unfortunately I cannot find it.
    Any help is appreciated. Thank you in advance.

  • XMLTABLE function not returning any values if xml has attribute "xmlns"

    Hi,
    XMLTABLE function not returning any values if xml has attribute "xmlns". Is there way to get the values if xml has attribute as "xmlns".
    create table xmltest (id number(2), xml xmltype);
    insert into xmltest values(1,
    '<?xml version="1.0"?>
    <emps>
    <emp empno="1" deptno="10" ename="John" salary="21000"/>
    <emp empno="2" deptno="10" ename="Jack" salary="310000"/>
    <emp empno="3" deptno="20" ename="Jill" salary="100001"/>
    </emps>');
    insert into xmltest values(2,
    '<?xml version="1.0"?>
    <emps xmlns="http://emp.com">
    <emp empno="1" deptno="10" ename="John" salary="21000"/>
    <emp empno="2" deptno="10" ename="Jack" salary="310000"/>
    <emp empno="3" deptno="20" ename="Jill" salary="100001"/>
    </emps>');
    commit;
    SELECT a.*
    FROM xmltest,
    XMLTABLE (
    'for $i in /emps/emp
    return $i'
    PASSING xml
    COLUMNS empno NUMBER (2) PATH '@empno',
    deptno NUMBER (3) PATH '@deptno',
    ename VARCHAR2 (10) PATH '@ename',
    salary NUMBER (10) PATH '@salary') a
    WHERE id = 1;
    The above query returning results but below query is not returning any results because of xmlns attribute.
    SELECT a.*
    FROM xmltest,
    XMLTABLE (
    'for $i in /emps/emp
    return $i'
    PASSING xml
    COLUMNS empno NUMBER (2) PATH '@empno',
    deptno NUMBER (3) PATH '@deptno',
    ename VARCHAR2 (10) PATH '@ename',
    salary NUMBER (10) PATH '@salary') a
    WHERE id = 1;
    how to get rid out of this problem.
    Thanks,
    -Mani

    Added below one in xmltable, its working now.
    XmlNamespaces(DEFAULT 'http://emp.com')

  • XMLType extract method does not work if namespace attribute values are included

    In the example below, only the second row returns an ID from the extract function. The presence of an xmlns attribute appears to be the cause.
    SQL> drop table configs;
    Table dropped.
    Elapsed: 00:00:03.06
    SQL>
    SQL> create table configs (xml_data sys.xmltype);
    Table created.
    Elapsed: 00:00:00.02
    SQL>
    SQL> create index configs on configs (xml_data) indextype is ctxsys.context;
    Index created.
    Elapsed: 00:00:02.01
    SQL>
    SQL> insert into configs values(sys.xmltype.createxml('<config
    2 xmlns="http://www.ourcompanykscl.com/configuration">
    3 <dataformat
    4 name="F1" description="format spec" id="14082" version="2"
    5      status="started" deployed="true" lastModifiedBy="bloggsj" lastModifiedDate="2002-05-10T09:44:45">
    6 <F11Format>
    7 <SpecificationFilename>c:/formats/F1.txt</SpecificationFilename>
    8 </F11Format>
    9 </dataformat></config>'
    10 ))
    11 /
    1 row created.
    Elapsed: 00:00:01.02
    SQL>
    SQL> insert into configs values(sys.xmltype.createxml('<config>
    2 <dataformat
    3 name="F1" description="format spec" id="14082" version="2"
    4      status="started" deployed="true" lastModifiedBy="bloggsj" lastModifiedDate="2002-05-10T09:44:45">
    5 <F11Format>
    6 <SpecificationFilename>c:/formats/F1.txt</SpecificationFilename>
    7 </F11Format>
    8 </dataformat>
    9 </config>'
    10 ))
    11 /
    1 row created.
    Elapsed: 00:00:00.00
    SQL>
    SQL> BEGIN
    2 ctx_ddl.sync_index('configs');
    3 END;
    4 /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.02
    SQL>
    SQL> SELECT c.xml_data.extract('//dataformat/@id').getstringval(), c.xml_data.getstringval()
    2 FROM configs c
    3 WHERE CONTAINS(c.xml_data, '14082 INPATH (//dataformat/@id)') > 0
    4 /
    C.XML_DATA.EXTRACT('//DATAFORMAT/@ID').GETSTRINGVAL()
    C.XML_DATA.GETSTRINGVAL()
    <config
    xmlns="http://www.ourcompanykscl.com/configuration">
    <dataformat
    name="F1" description="format spec" id="14082" version="2"
    status="started" deployed="true" lastModifiedBy="bloggsj" lastModifiedDa
    te="2002-05-10T09:44:45">
    <F11Format>
    <SpecificationFilename>c:/formats/F1.txt</SpecificationFilename>
    </F11Format>
    </dataformat></config>
    14082
    <config>
    <dataformat
    name="F1" description="format spec" id="14082" version="2"
    status="started" deployed="true" lastModifiedBy="bloggsj" lastModifiedDa
    te="2002-05-10T09:44:45">
    <F11Format>
    <SpecificationFilename>c:/formats/F1.txt</SpecificationFilename>
    </F11Format>
    </dataformat>
    </config>
    Elapsed: 00:00:00.03

    Hi Amarnath,
    Thanks for looking into my issue.
    When I started writing the dynamic custom approver group, I did not use FND_NUMBER and it didnt work. After that I checked it in the AME Implementation Guide which says
    "Queries for number and currency attributes must select the number or currency
    amount converted to a varchar2 by:
    fnd_number.number_to_canonical"
    So that should not be a problem.
    Please correct me if I am wrong but Now I see two different possibilities :
    1. The seeded variable :transactionId which is being passed to the query is not able to get the value. In other words, the transactionId is not being passed.
    2. I am using wrong Attributes to identify the transaction which is being used in the Condition and that condition is used in a Rule. In this case, I am trying to identify that the Basic Person details are changed and I am using seeded attribute HR_IS_PERSON_BASIC_DETAILS_CHANGE_SS in condition.
    Any feedback?
    Appreciate all replies.
    Thanks,
    CAH

  • Xmlns in root element

    When converting exchange rates xml from http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml
    I'm getting problem with xmlns in root element.
    CALL TRANSFORMATION triggers CX_XSLT_ABAP_CALL_ERROR, but only if there is xmlns attribute in first line in input xml:
    <gesmes:Envelope xmlns:gesmes="http://www.gesmes.org/xml/2002-08-01" xmlns="http://www.ecb.int/vocabulary/2002-08-01/eurofxref">
    Without this xmlns=.....  (or when modifying e.g. abcxmlns= ) works following xslt fine:
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" version="1.0">
      <xsl:strip-space elements="*"/>
      <xsl:template match="/">
        <xsl:copy>
          <xsl:apply-templates/>
        </xsl:copy>
      </xsl:template>
      <xsl:template match="Cube/Cube">
        <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
          <asx:values>
            <ROOT2>
              <xsl:value-of select="@time"/>
            </ROOT2>
            <ROOT1>
              <xsl:apply-templates select="Cube"/>
            </ROOT1>
          </asx:values>
        </asx:abap>
      </xsl:template>
      <xsl:template match="Cube/Cube/Cube">
        <loop>
          <AMOUNT>
            <xsl:value-of select="1"/>
          </AMOUNT>
          <CCYCODE>
            <xsl:value-of select="@currency"/>
          </CCYCODE>
          <VALUE>
            <xsl:value-of select="@rate"/>
          </VALUE>
        </loop>
      </xsl:template>
    </xsl:transform>
    I'd appreciate if someone migh advise me how to alternate the xslt or tell me what the xmlns in input does.
    Cheers
    Edited by: Viktor Kunc on Sep 29, 2008 3:25 PM

    If a namespace is specified on root level, it propagates down to all children, see:
    http://www.w3.org/TR/REC-xml-names/scoping
    The namespace is part of a name. So, if you have an element <Cube> as child of the root element <root xmlns="http://www.gesmes.org/xml/2002-08-01">, then
    <xsl:apply-templates select="Cube"/>
    won't be applied, since the qualified name of the element is not Cube but {http://www.gesmes.org/xml/2002-08-01}Cube
    If you want the XSLT to work with and without namespace equally well, you have to work with local names in XPath expressions:
    <xsl:apply-templates select="local-name() = 'Cube'"/>
    The same holds for all XPath functions working with element names.
    Usually, however, the namespace is part of the contract with the client and is
    either obligatory to be used
    or obligatory to be omitted.
    But not both.
    Regards,
    Rüdiger

  • Java Mapping for attributes

    Hi experts
    I want to create a java map. My requirement is given below.
    I/P xml>>
    <?xml version="1.0" encoding="UTF-8"?>
    <TradeplaceMessage productionMode="production" xmlns="http://zhm.....">
    <TransportEnvelope>
    <Routing><To>abcd</To><From>
    I want to rename attribute value xmlns to a new name XSX
    Thanks in advance
    Dhanish Joseph

    Dhanish,
    Please check htis thread:
    How to add xmlns attributes in main node
    This should solve your query.
    Refer contribution from  "Fariha Ali ", where you have to implement java mapping and apply the code suggested in the thread.
    Let us know if issue still persists.
    Divyesh

  • Intresting problem with JDOM and xmlns in root element.

    Hi all,
    I am trying to parse a xml file using a jdom java code.This code works fine if I remove xmlns attribute in the root element.Please tell me how to fix this issue.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Xml
    <process name="CreateKBEntryService" targetNamespace="http://serena.com/CreateKBEntryService" suppressJoinFailure="yes" xmlns:tns="http://serena.com/CreateKBEntryService" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:bpelx="http://schemas.oracle.com/bpel/extension" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:nsxml0="http://localhost:8080/axis/services/CreateKBEntryService" xmlns:nsxml1="http://DefaultNamespace" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    <partnerLinks>
              <partnerLink name="client" partnerLinkType="tns:CreateKBEntryService" myRole="CreateKBEntryServiceProvider"/>
              <partnerLink name="CreateKBEntryPartnerLink" partnerLinkType="nsxml0:CreateKBEntryLink" partnerRole="CreateKBEntryProvider"/>
         </partnerLinks>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
    Java:
    import java.io.*;
    import java.util.*;
    import org.jdom.Document;
    import org.jdom.Element;
    import org.jdom.input.SAXBuilder;
    public class sample1 {
    public static void main(String[] args) throws Exception {
    // create a XML parser and read the XML file
    SAXBuilder oBuilder = new SAXBuilder();
    Document oDoc = oBuilder.build(new File("file location "));
         Element root = oDoc.getRootElement();
         System.out.println(root.getName());
         String tgtns= root.getAttributeValue("targetNamespace");
         System.out.println("tgt ns "+ tgtns);
    List list= root.getChildren("partnerLinks");
         Iterator it1= list.iterator();
         System.out.println(list.size());
         while(it1.hasNext()){
              Element partnerlinks = (Element)it1.next();
              List list2= partnerlinks.getChildren("partnerLink");
              System.out.println(list2.size());
              Iterator it2= list2.iterator();
              String[][] partnerLinkval = new String [2][list2.size()];
              int i=0,j=0;
              while(it2.hasNext())
                   Element el2= (Element)it2.next();
              String ElementName = el2.getName();
              partnerLinkval[i][j]= ElementName;
              j++;
              String Attribute = el2.getAttributeValue("myRole");
              partnerLinkval[i][j]= Attribute;
              i++;
              j--;
              System.out.println("Saving in array "+el2.getName());
              System.out.println("Saving in array "+Attribute);
              System.out.println("array length"+partnerLinkval.length);
              for (int l=0;l<2;l++){
              for(int k=0;k<partnerLinkval.length;k++)
                   System.out.println(partnerLinkval[l][k]);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Result:
    Without Xmlns in xml file
    process
    tgt ns http://serena.com/buildserviceflow
    1
    2
    Saving in array partnerLink
    Saving in array BpelServiceFlowProvider
    Saving in array partnerLink
    Saving in array null
    array length2
    partnerLink
    BpelServiceFlowProvider
    partnerLink
    null
    Result with xmlns:
    process
    tgt ns http://serena.com/CreateKBEntryService
    0

    Hi,
    I am also having the same problem using jdom, my code works fine when there is no xmlns attribute but when i put the xmlns attribute back in doesn't work.
    Did you manage to find a way to solve this problem?

  • Add xmlns tag to Xml file using DBMS_XMLGEN

    I am using Oracle Release 10.1.0.4.2 version .
    I want to create a xml file according to some data available in the relational database tables. For the same i created object types and then view with the object types since data is scattered in many tables.
    Then i used DBMS_XMLGEN.getxml to generate the xml with query from the object view.
    Is there an option to add xmlns attribute to the generated xml file.
    Please let me know if any additional details are needed.

    If you want to add the namespace declaration in the root element, I don't think it's possible with DBMS_XMLGEN directly.
    You can instruct DBMS_XMLGEN to treat some object fields as XML attributes by prefixing them with "@" (e.g. "@my_attribute") but you cannot control that for enclosing elements.
    A possible solution is to add it afterwards using XSLT, or insertChildXML, but apparently the latter is not available in your version.
    However...
    For the same i created object types and then view with the object types since data is scattered in many tables.Since the data comes from different tables, why not use SQL and SQL/XML functions to build the document?
    It's straightforward, simple, and doesn't need additional objects.
    select xmlelement("Departments",
             xmlattributes('http://xmlns.example.org' as "xmlns")
           , xmlagg(
               xmlelement("Department",
                 xmlattributes(d.deptno as "Id")
               , xmlelement("Name", d.dname)
               , xmlelement("Employees"
                 , xmlagg(
                     xmlelement("Employee",
                       xmlattributes(e.empno as "Id")
                     , xmlforest(
                         e.ename as "Name"
                       , e.job as "Job"
                     ) order by e.empno
               ) order by d.deptno
    from scott.dept d
         join scott.emp e on e.deptno = d.deptno
    group by d.deptno, d.dname
    ;Output :
    <Departments xmlns="http://xmlns.example.org">
      <Department Id="10">
        <Name>ACCOUNTING</Name>
        <Employees>
          <Employee Id="7782">
            <Name>CLARK</Name>
            <Job>MANAGER</Job>
          </Employee>
          <Employee Id="7839">
            <Name>KING</Name>
            <Job>PRESIDENT</Job>
          </Employee>
          <Employee Id="7934">
            <Name>MILLER</Name>
            <Job>CLERK</Job>
          </Employee>
        </Employees>
      </Department>
      <Department Id="20">
        <Name>RESEARCH</Name>
        <Employees>
          <Employee Id="7369">
            <Name>SMITH</Name>
            <Job>CLERK</Job>
          </Employee>
          <Employee Id="7566">
            <Name>JONES</Name>
            <Job>MANAGER</Job>
          </Employee>
          <Employee Id="7902">
            <Name>FORD</Name>
            <Job>ANALYST</Job>
          </Employee>
        </Employees>
      </Department>
      <Department Id="30">
        <Name>SALES</Name>
        <Employees>
          <Employee Id="7499">
            <Name>ALLEN</Name>
            <Job>SALESMAN</Job>
          </Employee>
          <Employee Id="7521">
            <Name>WARD</Name>
            <Job>SALESMAN</Job>
          </Employee>
          <Employee Id="7654">
            <Name>MARTIN</Name>
            <Job>SALESMAN</Job>
          </Employee>
          <Employee Id="7698">
            <Name>BLAKE</Name>
            <Job>MANAGER</Job>
          </Employee>
          <Employee Id="7844">
            <Name>TURNER</Name>
            <Job>SALESMAN</Job>
          </Employee>
          <Employee Id="7900">
            <Name>JAMES</Name>
            <Job>CLERK</Job>
          </Employee>
        </Employees>
      </Department>
    </Departments>

Maybe you are looking for

  • Is there a way to get Newstand to show up on my desktop or laptop screens?

    I am starting to use Newstand and I think it is a great service, but is it possible to get the magazines to show on the larger screens of the desktop or laptop computers in addition to the IOS5 devices?

  • Photoshop CC will not update. Have tried several things.

    I know this keeps coming up, but so far I haven't been able to get Photoshop to update since CC was installed in August. First of all, this was a brand new computer with no bloatware when CC was first installed on it. Here's a list of pertinent infor

  • Printing from linux machine to Mac shared printer?

    I have a brand new Brother MFC 6800 that is connected to my Mac (10.4.4) via USB. I have a Linux box at home (Mandriva 2006), and I'd like to be able to print through the network to this printer. I've been searching the web for instructions for how t

  • Re: No Signal from Satellite C50D-A-139 HDMI out port

    Hi I have connected toshiba Satellite C50D-A-139 ( windows 7) via HDMI port ( using hdmi cable) to tv plasma, but on TV screen appears only "there is no signal". I am sure that HDMI cable works good, becasuse it works with Playstation 3 correctly. I

  • Updating Comment Tag does not update file metadata

    Hi, If anyone has the answer to this question i'd really appreciate it. I've been through all my songs in ITunes 8 (8.0.0.35)and removed all the comments in the 'Comment' column. However when you view the details in Windows (right click on the file,