Problem using namespace of XML docs gerenrated by  XMLForm

Hi community!
I am facing a problem using namespace within a XSL stylsheet. Let me describe my problem:
I am using the SAP XMLFormsBuilder within the SAP EnterprisePortal in order to provide a HTML based form for creating and editing specific XML documents. The data in the generated documents is finally presented as HTML using XSL Transformation.
In the XMLFormsBuilder you define the Schema of the XML document and the HTML GUI of the form. The Schema document looks like below (extract):
<?xml version="1.0" encoding="utf-8"?>
<schema targetNamespace="http://www.xmlspy.com/schemas/orgchart"
        xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:xyz="http://www.xmlspy.com/schemas/orgchart" Version="6.3.0">
  <element name="commodity"
           default=""
           minOccurs="1"
           maxOccurs="1"
           ns="p2p"
           xmlns:p2p="http://www.portal.p2p.com">
    <complexType>
      <sequence>
        <element name="administrative_information"
                 default=""
                 minOccurs="1"
                 maxOccurs="1"
                 ns="p2p">
          <complexType>
            <sequence>
              <element name="creation_date"
                       default=""
                       minOccurs="1"
                       maxOccurs="1"
                       type="date"
                       ns="p2p"/>
As far as I understand, each element defined in the Schama belongs to the namespace "p2p" and this is exactly what I want.
The XML document generated by the form looks like below (extract):
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="show_card.xsl"?>
<commodity xmlns:xf="http://www.sapportals.com/wcm/app/xmlforms"
           xmlns:xsi="http//www.w3.org/2001/XMLSchema-instance"
           xsi:noNamespaceSchemaLocation="/etc/xmlforms/P2PCategoryCard_TEST/P2PCategoryCard_TEST-Schema.xml">
  <administrative_information>
    <creation_date>2005-07-04</creation_date>
Consequently, the file "show_card.xsl" is the responsible XSLT stylesheet, which looks like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:p2p="http://www.portal.p2p.com">
  <xsl:output method="html"/>
  <xsl:template match="p2p:commodity">
    <html>
    <body>
      <h2>XSLT Test</h2>
      Creation Date: <xsl:value-of select="p2p:administrative_information/p2p:creation_date"/>
    </body>
    </html>
  </xsl:template>
</xsl:stylesheet>
The problem in the XSLT stylesheet is, that I want to access the XML document elements using their namespace. And this is exactly what does not work for me. On the other hand, if I remove the reference to the namespace:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:p2p="http://www.portal.p2p.com">
  <xsl:output method="html"/>
  <xsl:template match="commodity">
    <html>
    <body>
      <h2>XSLT Test</h2>
      Creation Date: <xsl:value-of select="administrative_information/creation_date"/>
    </body>
    </html>
  </xsl:template>
</xsl:stylesheet>
the stylesheet works fine, but for some technical reasons, which I don't want to explain here, I have to use the namespace when accessing the XML document elements.
For technical reasons, I cannot change the format of the Schema document and also cannot change the format of the generated XML document. The only file I can change and control is the XSLT stylsheet.
My question is now, in the case described above, if there is any way to use the namespace in the sytlesheet when accessing the XML elements?
Any help is appreciated.
Cheers,
Adam Kreuschner

duggal.ashish wrote:
3. Some XML files contain a "iso-8859-1" character with character code 146 which appears like apostrophes but actually it is : - &#146; and the problem is that words like can&#146;t are shown as can?t by database.http://en.wikipedia.org/wiki/ISO8859-1
Scroll down in that page and you'll see that the character code 146 -- which would be 92 in hexadecimal -- is in the "unused" area of ISO8859-1. I don't know where you got the idea that it represents some kind of apostrophe-like character but it doesn't.
Edit: Actually, I do know where you got that idea. You got it from Windows-1252:
http://en.wikipedia.org/wiki/Windows-1252
Not the same charset at all.

Similar Messages

  • Is it possible to create indexes & use them on xml docs with namespaces?

    I have put an XML doc in a BDBXML container which looks like this:
    *<ns1:note xmlns:ns1="http://www.testsch.org/ns">*
    *<ns1:to>Eric</ns1:to>*
    *<ns1:from>Brendan</ns1:from>*
    *<ns1:msg>How r u?</ns1:msg>*
    *</ns1:note>*
    Now, I am creating an index on the element "to", as:
    addIndex "ns1" "to" node-element-equality-string
    Though the index has been shown as getting created using the listIndexes command, if I lookup that index with the following command:
    lookupIndex node-element-equality-string "ns1" "to"
    the output is:
    *0 objects returned for eager index lookup 'node-element-equality-string'*
    Whereas, if I do the whole procedure without the namespaces in the document & the commands, the result is fine:
    *1 object returned for eager index lookup 'node-element-equality-string'*
    Can someone please tell me whether using namespaces, the indexes can be created or not? If yes, how?
    Thanks,
    Dev
    Edited by: user11871332 on Sep 7, 2009 3:53 PM

    Hi Dev,
    When using XML, the prefix for the namespace is really just syntactic sugar. The actual namespace in your example is "http://www.testsch.org/ns", and that's the value that you need to use when creating your index:
    addIndex "http://www.testsch.org/ns" "to" node-element-equality-stringJohn

  • Problems getting namespace from XML

    hi all....
    I'm trying to parse this XML using SAX.
    <soap: Envelope xmlns:..... (several namespaces)>
    <soap:Body>
    <GetResponse xmlns="http://altnamespace">
    <GetResult>data</GetResult>
    </GetResponse>
    </soap:body>
    </soap:Envelope>
    my problem is I can't get to the embedded altnamespace in GetReponse.
    here is a code snippet:
    SAXBuilder builder = new SAXBuilder();
    Document doc = builder.build(httpConn.getInputStream());
    Element root = doc.getRootElement();
    Namespace ns = root.getNamespace();
    Element element = root.getChild("Body",ns)
    ok so far -- I get the soap:Body element. But my problem is, I need that embedded "altnamespace" of the next element down, Get Response.
    I've tried:
    Namespace altNamespace = element.getChild("GetResponse").getNamespace();
    but that returns null....
    I need it so that I can execute the following code to get the data:
    Element dataElement = element.getChild("GetImageResponse",altNamespace).getChild("GetImageResult",altNamespace);
    String data = dataElement.getText();
    any help would be appreciated..... forgive my ignorance....
    sean

    hi all....
    I'm trying to parse this XML using SAX.
    <soap: Envelope xmlns:..... (several namespaces)>
    <soap:Body>
    <GetResponse xmlns="http://altnamespace">
    <GetResult>data</GetResult>
    </GetResponse>
    </soap:body>
    </soap:Envelope>
    my problem is I can't get to the embedded altnamespace in GetReponse.
    here is a code snippet:
    SAXBuilder builder = new SAXBuilder();
    Document doc = builder.build(httpConn.getInputStream());
    Element root = doc.getRootElement();
    Namespace ns = root.getNamespace();
    Element element = root.getChild("Body",ns)
    ok so far -- I get the soap:Body element. But my problem is, I need that embedded "altnamespace" of the next element down, Get Response.
    I've tried:
    Namespace altNamespace = element.getChild("GetResponse").getNamespace();
    but that returns null....
    I need it so that I can execute the following code to get the data:
    Element dataElement = element.getChild("GetImageResponse",altNamespace).getChild("GetImageResult",altNamespace);
    String data = dataElement.getText();
    any help would be appreciated..... forgive my ignorance....
    sean

  • Problem using Extract in xml

    My problem,
    declare
    v_clob clob;
    begin
    select extract(xml_details,'/ROWSET/ROW/CTRY_CODE').getStringVal() into v_clob from xml_tab where xml_name='GRN.XML';
    end;
    xml_tab description
    column
    xml_details clob
    xml_name VARCHAR2(2000)
    This block works fine for smaller xmls...but not working for large xmls.Clob can store a very large xml but using getStringVal() it cannot return large string size,how could i get large xml values from a xml.
    Error shown: ORA-06502-String size too small

    Hi,
    you can use .getClobVal()
    Ants

  • [Digester] Problem using recursion in xml rule file

    Hi!
    I am trying to parse an XML file using digester but getting a problem. The file has a recursive tag. The format of the file given below:
    <dpr-domain name="AircraftPerformances">
              <dpr-data-category name="AircraftClass" systemOption="FULLOLDI">
                   <dpr-attribute name="landingSpeed" systemOption="HALFOLDI"/>
                   <dpr-data-category name="holdingParameters" systemOption="HALFOLDI">
                        <dpr-attribute name="maximumspeed1" systemOption="FULLOLDI"/>
                   </dpr-data-category>
                   <dpr-data-category name="turnRate" systemOption="FULLOLDI,HALFOLDI">
                        <dpr-attribute name="maximumspeed2" systemOption="FULLOLDI"/>
                        <dpr-data-category name="accelerateRate" systemOption="HALFOLDI">
                             <dpr-attribute name="maximumspeed21" systemOption="FULLOLDI"/>
                             <dpr-data-category name="descendRate" systemOption="HALFOLDI">
                                  <dpr-attribute name="maximumspeed211" systemOption="FULLOLDI"/>
                             </dpr-data-category>
                        </dpr-data-category>
                   </dpr-data-category>
              </dpr-data-category>
    </dpr-domain>
    The rule file I have written for this is:
    <digester-rules>
         <pattern value="dpr-domain">
         <object-create-rule classname="check.Domain"/>
              <pattern value="*/dpr-data-category">
                   <object-create-rule classname="check.DataCategory"/>
                   <set-properties-rule/>
                   <pattern value="dpr-attribute">
                        <object-create-rule classname="check.Attribute"/>
                        <set-properties-rule/>
                        <set-next-rule methodname="addAttributes" />
                   </pattern>
                   <set-next-rule methodname="addDataCategory" paramtype="check.DataCategory"/>          
              </pattern>
              </pattern>     
    </digester-rules>
    But this is not working. If the "dpr-domain" tag is removed, then it works. Please help me by giving a solution for this problem.
    Regards,
    Arshika

    For this scenario,
    First I have used FCC for the same structure and CSV is also generated, but the CSV when opened with NOTEPAD it is not showing endSeparator , i.e my first row last element is concatenated with second row first element,there is no row seperator.
    But the same when opened with WordPad,we can see the data, row wise
    now the destination system open the file in notepad only.
    for that i tried using this Bean specified above but it is not fulfilling the requirement.
    The parameters I have mentioned in FCC are as follows:
    Recordset Structure : E1WBB01,E1WBB03,EAN_MASTER
    NAME                                      VALUE
    EAN_MASTER.fieldSeparator     ,   (comma)
    EAN_MASTER.endSeparator     'nl'
    E1WBB03.fieldSeparator            ,
    E1WBB03.endSeparator             'nl'
    E1WBB01.fieldSeparator            ,
    E1WBB01.endSeparator             'nl'
    Please provide a solution,why thr endSeparator is not shown in notepad.
    Thanks

  • Need help on processing XML doc using Java store procedure

    I am currently working on project to read, parse XML document and store data in XML document into database columns. I use JAVA API-OracleXMLSave in my java store procedure to do it, which use URL of XML doc to read, parse doc and store the data to database columns. My java store procedure works fine when XML doc is saved in server, but got "ORA-29532: Java call terminated by uncaught Java exception:
    oracle.xml.sql.OracleXMLSQLException: No such file or directory" if XML doc is in client's PC instead of in server. I think the problem comes from the URL that created using OracleXMLSave
    --createURL(fileName) based on the filename. what will be the filename if XML document located in Client PC like C:\myprojects\xmldoc.xml?
    Thank you in advance if anyone can give some hints.

    I am currently working on project to read, parse XML document and store data in XML document into database columns. I use JAVA API-OracleXMLSave in my java store procedure to do it, which use URL of XML doc to read, parse doc and store the data to database columns. My java store procedure works fine when XML doc is saved in server, but got "ORA-29532: Java call terminated by uncaught Java exception:
    oracle.xml.sql.OracleXMLSQLException: No such file or directory" if XML doc is in client's PC instead of in server. I think the problem comes from the URL that created using OracleXMLSave
    --createURL(fileName) based on the filename. what will be the filename if XML document located in Client PC like C:\myprojects\xmldoc.xml?
    Thank you in advance if anyone can give some hints.

  • Format XML doc based on values in another xml doc

    Database version : Oracle 10g
    I have an XML "data" file and an associated error file that is also XML. I want to take the XML data file and highlight visually in a html file only those fields and contents that are there in the "error" file.
    There are many fields in the data file so the error could be just about anywhere. Can someone please tell me what I should read or give me some direction on how I should proceed?
    I built a style sheet for the "data" file - but obviously that is static. Do i need 2 stylesheets and apply them both somehow? I was also thinking that I would use the "error" xml doc and just rewrite the error nodes in the "data" file and then use the style sheet to mark up the data file based on what i rewrite.
    eg
    if the data is say
    <field1>content of field 1</field1>
    and the error file has field1 in it, I would rewrite the data file to have say <error>content of field 1</error> and just mark up the <error> using the stylesheet. Is that a sensible solution? Even then I need help on the actual xml/sql functions i need to rewrite the xml data.
    I am a rank beginner in this and I apologize - This seems such a newbie question that must have been asked before - I just wish I could find it in the forum.
    Thank you!
    Edited by: user13112667 on Oct 15, 2010 12:38 PM

    Thanks for the samples.
    A couple of options I can think of :
    - XSL transformation (as you first thought of too)
    - XQuery
    Below is a test script that implements both solutions :
    DECLARE
    datadoc xmltype := xmltype(
    '<HII>
    <HII_SEQ_NUM>6084997</HII_SEQ_NUM>
    <HII_RECORD_ID>HII</HII_RECORD_ID>
    <HII_DOC_TYPE>INV</HII_DOC_TYPE>
    <HII_WSLR_ID>XXXXX</HII_WSLR_ID>
    <HII_WSLR_ABBR>COM</HII_WSLR_ABBR>
    <HII_CUST_NBR>096636</HII_CUST_NBR>
    <HII_INV_DATE>100203</HII_INV_DATE>
    <HII_INV_NUMB>829608-1102</HII_INV_NUMB>
    <HII_ORD_NUMB>830412</HII_ORD_NUMB>
    <HII_TP_ID>007839602</HII_TP_ID>
    <HII_WSLR_DUNS>000073669</HII_WSLR_DUNS>
    <HII_TRANS_TYPE>DI</HII_TRANS_TYPE>
    <HII_CAVN_ID>77873</HII_CAVN_ID>
    <HII_VER_NUM>22</HII_VER_NUM>
    </HII>'
    errordoc xmltype := xmltype(
    '<document>
    <error>
    <segment>HII</segment>
    <element>HII_INV_DATE(Inv Date)</element>
    <msg>Invoice date must be in the format yyyymmdd</msg>
    <data>100203</data>
    </error>
    <error>
    <segment>HII</segment>
    <element>HII_TP_ID(TP ID)</element>
    <msg>Data must be 12 digits long</msg>
    <data>007839602</data>
    </error>
    </document>'
    xsldoc xmltype := xmltype(
    '<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html" version="4.0"/>
    <xsl:template match="/">
    <HTML>
      <BODY>
       <STYLE type="text/css">
        <![CDATA[
        TR.err { background-color: red }
        TD { border: 1px solid }
        TABLE { border-collapse: collapse }
        ]]>
       </STYLE>
       <TABLE>
       <xsl:apply-templates select="root/datafile/HII/*"/>
       </TABLE>
      </BODY>
    </HTML>
    </xsl:template>
    <xsl:template match="HII/*">
    <xsl:variable name="msg" select="/root/errorfile/document/error[segment=name(current()/..) and substring-before(element,''('')=name(current())]/msg"/>
    <TR>
      <xsl:if test="$msg"><xsl:attribute name="class">err</xsl:attribute></xsl:if>
      <TD><xsl:value-of select="name(.)"/></TD>
      <TD><xsl:value-of select="."/></TD>
      <TD><xsl:value-of select="$msg"/></TD>
    </TR>
    </xsl:template>
    </xsl:stylesheet>'
    html_res1 clob;
    html_res2 clob;
    BEGIN
    -- XSL Transformation
    SELECT XMLTransform(
      xmlelement("root",
       xmlconcat( xmlelement("datafile",datadoc),
                  xmlelement("errorfile",errordoc) )
      xsldoc
    ).getClobVal()
    INTO html_res1
    FROM dual;
    -- XQuery
    SELECT XMLQuery(
      '<HTML>
        <BODY>
         <STYLE type="text/css">
          TR.err {{ background-color: red }}
          TD {{ border: 1px solid }}
          TABLE {{ border-collapse: collapse }}
         </STYLE>
         <TABLE>
          for $i in $d/HII/*
          let $n := name($i)
          let $v := $i/text()
          let $msg := xs:string($e/document/error[segment=name($i/..) and substring-before(element,"(")=$n]/msg)
          return
            element TR {
              if ($msg) then
                attribute class {"err"}
              else (),
              <TD>{$n}</TD>,
              <TD>{$v}</TD>,
              <TD>{ $msg }</TD>
         </TABLE>
        </BODY>
       </HTML>'
      passing datadoc as "d",
              errordoc as "e"
      returning content
    ).getClobVal()
    INTO html_res2
    FROM dual;
    END;
    /Same principle for the two methods : looping through the data document and searching for a matching occurrence in the error document using XPath.
    It produces an HTML document (html_res1 and html_res2) like this :
    <HTML>
    <BODY>
      <STYLE type="text/css">
        TR.err { background-color: red }
        TD { border: 1px solid }
        TABLE { border-collapse: collapse }
        </STYLE>
      <TABLE>
       <TR>
        <TD>HII_SEQ_NUM</TD>
        <TD>6084997</TD>
        <TD></TD>
       </TR>
       <TR>
        <TD>HII_RECORD_ID</TD>
        <TD>HII</TD>
        <TD></TD>
       </TR>
       <TR>
        <TD>HII_DOC_TYPE</TD>
        <TD>INV</TD>
        <TD></TD>
       </TR>
       <TR>
        <TD>HII_WSLR_ID</TD>
        <TD>XXXXX</TD>
        <TD></TD>
       </TR>
       <TR>
        <TD>HII_WSLR_ABBR</TD>
        <TD>COM</TD>
        <TD></TD>
       </TR>
       <TR>
        <TD>HII_CUST_NBR</TD>
        <TD>096636</TD>
        <TD></TD>
       </TR>
       <TR class="err">
        <TD>HII_INV_DATE</TD>
        <TD>100203</TD>
        <TD>Invoice date must be in the format yyyymmdd</TD>
       </TR>
       <TR>
        <TD>HII_INV_NUMB</TD>
        <TD>829608-1102</TD>
        <TD></TD>
       </TR>
       <TR>
        <TD>HII_ORD_NUMB</TD>
        <TD>830412</TD>
        <TD></TD>
       </TR>
       <TR class="err">
        <TD>HII_TP_ID</TD>
        <TD>007839602</TD>
        <TD>Data must be 12 digits long</TD>
       </TR>
       <TR>
        <TD>HII_WSLR_DUNS</TD>
        <TD>000073669</TD>
        <TD></TD>
       </TR>
       <TR>
        <TD>HII_TRANS_TYPE</TD>
        <TD>DI</TD>
        <TD></TD>
       </TR>
       <TR>
        <TD>HII_CAVN_ID</TD>
        <TD>77873</TD>
        <TD></TD>
       </TR>
       <TR>
        <TD>HII_VER_NUM</TD>
        <TD>22</TD>
        <TD></TD>
       </TR>
      </TABLE>
    </BODY>
    </HTML>Performance-wise, you'll have to test on real documents, but I think XSLT is better.

  • Still problems serializing xml-docs with xml-parser for java v2.0.2.7

    Hi !
    I'm using the Oracle XML Parser 2.0.2.7.0 and get some problems when serializing the XMLDocument.
    In one class (DOMOut) I parse a xml-file with the oracle.xml.parser.v2.DOMParser, then obtain the XMLDocument and write it to System.out
    In another class (DOMIn) I fetch the XMLDocument from System.in, search for a given Element and print it's TextValue (if existing) to System.out
    That is where the error occurs.
    I get the XMLDocument from System.in but the returning NodeList from doc.getElementsByTagName() is empty. [nl.getLength()==0] even if it shouldn't be.
    Look at this code and output:
    [DOMOut]
    DOMParser parser = new DOMParser();
    parser.parse(url);
    XMLDocument doc = (XMLDocument)parser.getDocument();
    ObjectOutputStream out = new ObjectOutputStream(System.out);
    out.writeObject(doc); out.flush();
    [DOMIn]
    ObjectInputStream in = new ObjectInputStream(System.in);
    XMLDocument doc = (XMLDocument)in.readObject();
    doc.print(System.out);
    NodeList nl = doc.getElementsByTagName("Name");
    System.out.println("Length of NodeList: "+nl.getLength());
    if (nl.getLength()==0)
    System.out.println(argv[0] + ": not in this document!");
    else {
    XMLNode node = (XMLNode) nl.item(nl.getLength()-1);
    System.out.println(node.getNodeName() + ": " + (node.getFirstChild()).getNodeValue());
    This is the relevant code.
    I javac both classes and then do this:
    java DOMOut xmltestfile.xml > xx
    java DOMIn Name < xx
    And get this as output:
    <?xml version = '1.0'?>
    <!DOCTYPE course [
    <!ELEMENT course (Name,Dept,Instructor,Student)>
    <!ELEMENT Name ((#PCDATA)*)*>
    <!ELEMENT Dept ((#PCDATA)*)*>
    <!ELEMENT Instructor (Name)>
    <!ELEMENT Student (Name)*>
    ]>
    <course>
    <Name>Calculus</Name>
    <Dept>Math</Dept>
    <Instructor>
    <Name>Jim Green</Name>
    </Instructor>
    <Student>
    <Name>Jack</Name>
    <Name>Mary</Name>
    <Name>Paul</Name>
    </Student>
    </course>
    Length of NodeList: 0
    Name: not in this document!
    Has anyone an idea?
    If I do all this stuff without serializing it works.
    If I do not search for argv[0], but the string "Name" it fails.
    If I do search for "*" it works fine!
    I'm very confused could anybody please help me a bit??
    Stefan.
    [[email protected]]

    The link has been fixed. You will go to the v2 download page
    now. Sorry for the inconvience.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    Renilton Oliveira (guest) wrote:
    : I didn't find the file for version 2.0.0.0 as well.
    : Renilton
    : Andrei Filimonov (guest) wrote:
    : : I tried to download XML Parser for Java v2 it seems that
    only
    : v
    : : 1.0.1.4 is available. Could you please give an exact URL for
    : v2
    : : download?
    : : Andrei Filimonov
    : : Oracle XML Team wrote:
    : : : The Oracle XML v2 parser is now available for download
    here
    : as
    : : : an early beta release and is written in Java. It features
    : an
    : : : improved architecture over the Oracle XML v1 parser and
    has
    : : : shown better performance on small to large XML documents.
    : It
    : : : will also be able to format the XML document according to
    a
    : : : stylesheet, having integrated an XSLT processor.
    : : : Version 2 of the XML Parser for Java, besides
    incorporating
    : an
    : : : XSLT processor, has been re-architected from version 1.
    This
    : : has
    : : : resulted in a number of changes to the class names
    : especially
    : : : those that support Namespaces. See v2changes.txt and
    : the .diff
    : : : difference files in the sample directory.
    : : : Oracle XML Team
    : : : http://technet.oracle.com
    : : : Oracle Technology Network
    null

  • Problems while writing xml doc to a  file

    Hi all , in my project (of distributed xml databases) i need to write the xml files from the main server to the clients.
    These xml files i had formed by fragmenting one xml doc and i did the fragmentation using ....
    TransformerFactory tf = TransformerFactory.newInstance();
              Transformer transformer = tf.newTransformer();
              transformer.transform(new DOMSource(root),
              new StreamResult(new FileOutputStream(outputFile)));
    Now the problem is that on the client where these fragments reside..i m not able to do the indexing of the document properly ie...
    some extra text nodes with no values are coming in the index...
    i dont know how to deal wid the extra nodes that i m getting after parsing the file and craeting an index for the same..
    may be its coz of the transformer func i m using....don know(???)
    Note : i m fragmenting the xml files into text files using the above function and then sending thm to the client via sockets.
    Also,after fragmenting i am getting sumthng like
    <?xml version="1.0" encoding="UTF-8"?>
    in all the files..is this a source of any problem....
    plz reply soon....

    You have not described how you "index" the files and what you mean by that.
    Are you processing them with SAX or DOM, or one of the variations of those means?
    Is there a chance that the "extra" nodes are simply text nodes with newlines ("\n")? There are usually a lot of extra text nodes in a file each containing only one newline.
    If you are using SAX, there is no requirement for the parser to collect all of the text inside an element into a single block before calling the characters method. You may get several calls to characters between the start of an element and the end. If you change parsers, you may even get a different number of calls, but the character data will always be the same.
    Dave Patterson
    As to the <?xml version="1.0" encoding="UTF-8"?> line, that is perfectly fine. It means that your file thinks it is valid XML. Whether or not it REALLY is valid depends on a validation of the file.

  • Problem using xsl to convert xml to xml

    I have and xml doc that has a format similar to this:
    <HEADER>
    <ORDER_NUMBER>
    <ORDER_DATE>
    <LINE>
    <LINE_NUMBER>
    <ITEM>
    </LINE>
    <LINE_NUMBER>
    <ITEM>
    </LINE>
    </HEADER>
    When I convert from xml to xml using xsl I do not get the second occurence of <LINE>, everything else looks fine.
    Please help.
    Thanks, John

    Hi John,
    I also have problems to convert xml to xml by xsl at command-line interface as follows.
    CLASSPATH=$ORACLE_HOME/rdbms/jlib/xsu12.jar:$ORACLE_HOME/lib/xmlparserv2.jar:$ORACLE_HOME/jdbc/lib/classes12.zip
    java oracle.xml.parser.v2.oraxsl source.xml -s myxsl.xsl destination.xml
    and I received error message as "Error occurred while processing myxsl.xsl: Error in expression: '*|/'."
    Actually, the source xml file and xsl script I used were copied from the book "Professional XML".
    Do you know what's the problem and could you show me setting for the classpath?
    Thanks.
    Yi

  • How to use Xpath to query elements loaded from different xml docs?

    I have a big DBLP XML doc (95mb), to load into the container, i splitted the doc into many small xml docs by the publication types, such as articles, books, inproceedings, etc.
    I tried to use xpath query such as
    query 'collection()/dblp[article/author]/book[title]'
    I got empty answers.
    but if i use XQuery such as
    query 'let $r:=collection()/dblp,$a :=$r/inproceedings/author
    for $l2 in $r/book
    where $a and $l2/title
    return <result> {$l2}{$a}</result>'
    i got answers. However, if i remove {$a} from the return clause, i still got empty answers.
    is there any problem with my Xpath query and flwor Xquery?
    regards,
    xiaoying

    Hi John,
    Following is the procedure i have used to load the xml docs (after the indexes have been created):
    private static void loadXmlFiles(File path2DbEnv,String theContainer, File file) throws Throwable {
         //Open a container in the db environment
              XmlManager theMgr = null;
              XmlContainer openedContainer = null;
              myDbEnv env;
              try {
              env = new myDbEnv(path2DbEnv);
         theMgr = new XmlManager(env.getEnvironment(), new XmlManagerConfig());
         //use node container
         theMgr.setDefaultContainerType(XmlContainer.NodeContainer);
                   try{
                   openedContainer = theMgr.createContainer(theContainer);
                   }catch (XmlException e){
                        //if the container alreay exist, then open it;     
                        openedContainer = theMgr.openContainer(theContainer);
              //Get an update context.
              XmlUpdateContext updateContext = theMgr.createUpdateContext();
                   String theFile = file.toString();
                   String docName=file.getName();
              //Get the input stream.
              XmlInputStream theStream = theMgr.createLocalFileInputStream(theFile);
              System.out.println("Adding " + theFile + " to container " +
                             theContainer);
         //     Do the actual put
              openedContainer.putDocument(docName, // The document's name
              theStream, // The actual document.
              updateContext, // The update context
         //     (required).
              null); // XmlDocumentConfig object
              System.out.println("done.");
              //XmlException extends DatabaseException, which in turn extends Exception.
              // Catching Exception catches them all.
              } catch (XmlException e){
                   System.err.println("Error loading files into container " + theContainer);
                   System.err.println(" Message: " + e.getMessage());
                   //In the event of an error, we abort the operation
                   // The database is left in the same state as it was in before
                   // we started this operation.
                   throw e;
              finally {
              cleanup(theMgr, openedContainer);
    Unfortunately, i waited for around 20 hours 148mb doc was not loaded; so i gave up.
    Could you please give me some suggestions on how to load the large doc efficiently ? thanks.
    regards,
    xiaoying

  • Problem Loading Large XML Doc

    I'm running 10.2.0.3 on a Linux box and I'm having problems loading a large XML document (about 100 MB). In the past, I would simply load the XML file into a XMLType column like this:
    INSERT INTO foo VALUES (XMLType(bfilename('XMLDIR', 'test.xml'). nls_charset_id('AL32UTF8')));
    But when I try this with a large file, it runs for 10 minutes and then returns an ORA-03113. I'm assuming the file is just too large for this technique. I spoke to Mark Drake when I was at OpenWorld and he suggested I use Oracle XML DB, so I created and registered a schema and tried using sqlldr to load the doc, but it ran for 2 1/2 hours before returning:
    Parse Error on row 1 in table FOO
    OCI-31038: Invalid integer value: "129"
    I tried simplifying both the XML file and schema to just the following:
    <schedules>
    <s s="2009-09-21T04:00:00" d="21600" p="335975" c="19672"/>
    <s s="2009-09-21T04:00:00" d="21600" p="335975" c="15387"/>
    <s s="2009-09-21T04:00:00" d="25200" p="335975" c="5256"/>
    <s s="2009-09-21T04:00:00" d="86400" p="335975" c="26198">
    <k id="5" v="2009-09-21 09:00:00.000"/>
    <k id="6" v="2009-09-22 03:59:59.000"/>
    <k id="26" v="0.00"/><k id="27" v="US"/>
    </s>
    <s s="2009-09-21T04:00:00" d="21600" p="335975" c="11678"/>
    <s s="2009-09-21T04:00:00" d="21600" p="335975" c="26697"/>
    <s s="2009-09-21T04:00:00" d="21600" p="335975" c="25343"/>
    <s s="2009-09-21T04:00:00" d="21600" p="335975" c="25269"/>
    <s s="2009-09-21T04:00:00" d="86400" p="335975" c="26200">
    <k id="5" v="2009-09-21 09:00:00.000"/>
    <k id="6" v="2009-09-22 03:59:59.000"/>
    <k id="26" v="0.00"/><k id="27" v="US"/>
    </s>
    </schedules>
    <?xml version="1.0" encoding="UTF-8"?>
    <!--W3C Schema generated by XMLSpy v2008 sp1 (http://www.altova.com)-->
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
         xmlns:xdb="http://xmlns.oracle.com/xdb"
        version="1.0"
        xdb:storeVarrayAsTable="true">
         <xs:element name="schedules" xdb:defaultTable="SCHEDULES">
              <xs:complexType xdb:SQLType="SCHEDULES_T">
                   <xs:sequence>
                        <xs:element ref="s" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="s">
              <xs:complexType>
                   <xs:choice minOccurs="0">
                        <xs:element ref="f" maxOccurs="unbounded"/>
                        <xs:element ref="k" maxOccurs="unbounded"/>
                   </xs:choice>
                   <xs:attribute name="s" use="required" type="xs:dateTime"/>
                   <xs:attribute name="p" use="required" type="xs:int"/>
                   <xs:attribute name="d" use="required" type="xs:int"/>
                   <xs:attribute name="c" use="required" type="xs:short"/>
              </xs:complexType>
         </xs:element>
         <xs:element name="k">
              <xs:complexType>
                   <xs:attribute name="v" use="required" type="xs:string"/>
                   <xs:attribute name="id" use="required" type="xs:byte"/>
              </xs:complexType>
         </xs:element>
         <xs:element name="f">
              <xs:complexType>
                   <xs:attribute name="id" use="required" type="xs:byte"/>
              </xs:complexType>
         </xs:element>
    </xs:schema>
    Keep in mind both the actual XML file and corresponding XSD is much more complex, but this particular section is about 70 MB so I wanted to see if I could just load that.  I used the following sqlldr script:
    LOAD DATA
    INFILE *
    INTO TABLE schedules_tmp TRUNCATE
    XMLType(xml_doc)(
         lobfn FILLER CHAR TERMINATED by ',',
         xml_doc LOBFILE(lobfn) TERMINATED BY EOF
    BEGINDATA
    /tmp/schedules.xmlThis worked fine on a small doc - loaded correctly and I could query it fine - but when I tried using the 70 MB file it ran for a couple of hours before dying with a memory problem.
    So what am I doing wrong? Is there a better way to load a large file?
    Thanks for the help.
    Pete
    Edited by: mdrake on Nov 9, 2009 8:46 PM

    Mark:
    Answers to your questions:
    Do you use direct load ? -> Yes. I tried again using UNRECOVERABLE LOAD DATA to try to speed up performance, but it still ran for a couple of hours before dying.
    Which DB Release are you working with ? -> 10.2.0.3
    Can you see if you can upload via FTP ? -> I added noNamespaceSchemaLocation to my XML file and ftp'd it to my XML directory, but it wasn't recognized. Is there something else I have to do?
    The change for unsignedInt should have code rid of the issue with the value 129. Did it ? -> I didn't try it again on the whole XML file (I'm just working with the schedules section), so I haven't verified this.
    I'm still stumped as to why sqlldr takes so long. I could write something to parse the XML file into a flat file and then use sqlldr to load it into a relational table, and the load would only take a few minutes. But then I wouldn't be using XML DB which I thought would be faster. What am I doing wrong?
    Pete

  • MII 12.1.5 problem: XML-Doc not initialized in second transaction call

    (Sorry- I don't know why the lines are not seperated as in my input text...)
    Hello!
    We are migrating our projects from MII 12.5 to 12.1.5(Build 99).
    Most of the problems we found last year during our 12.1 rampup tests are fixed now.
    We are very happy about the improved expression parser- it now finds all syntax errors which are ignored in 12.0 (like missing parenthesis).
    The new tracing options make is easy to remove such errors.
    We found some small problems but this problem ist not easy to see and the result are some hundred wrong SAP postings:
    In a called transaction we have a XML-Doc action block  which manually configured fields.
    Then we adds rows to this document using the ROW-action block.
    Note: In the calling main transaction the option "reload transaction after each execution" is UNchecked (the default)
    This works fine for the first call of this transaction.
    The problems starts with the second call.
    Some initalization for the XML-Doc ist not executed (see trace below)
    VERY BAD: the ROW-actions to fill the document are executed WITHOUT errors!
    Result: an EMPTY XML-Doc!
    The solution is to check the option "reload transaction after each execution" in the Transaction call action.
    In MII 12.0 the XML-Doc was initalized and filled correctly for both calling options.
    Questions:
    - Is this a bug or a known behaviour?
      During the rampup test we found some problems with local variables and discussed this with SAP (Mr Schuette).
      what I remeber: with the unchecked option the local transaction variables should keep the old values of the last call -
      but XML-Docs should be initialzed always. The big problem is that the ROW action don't raise an error. 
    - Should the option "reload transaction after each execution" be checked as default?  
    - Are there performance differences for both options?
    Best regards,
    Roger Zuehlsdorf
    Trace output:
    ==========================================================
    FIRST CALL of Sub-Transaction
    [DEBUG] [TESTSUB1] Loading action: Document_0, type: IlluminatorDocument
    [DEBUG] [TESTSUB1] [Sequence]: Started sequence execution
    [DEBUG] [TESTSUB1] [Document_0]: Started action execution
    [DEBUG] [TESTSUB1] [Document_0]: Type: IlluminatorDocument, Description:
    [DEBUG] [TESTSUB1] [Document_0]: [Initializing Action][Initializing Parameters: [Document_0.EndDate = Document_0.EndDate=[timestamp:2010-08-23T12:58:51]][Document_0.StartDate = Document_0.StartDate=[timestamp:2010-08-23T12:58:51]][Document_0.Output = Document_0.Output=[xml:<?xml version="1.0" encoding="UTF-8"?>
    <Rowsets DateCreated="2010-08-23T16:09:59" EndDate="2010-08-23T12:58:51" StartDate="2010-08-23T12:58:51" Version="12.1.5 Build(99)">
    <Rowset>
    <Columns>
    <Column Description="" MaxRange="1" MinRange="0" Name="TESTTEXT" SQLDataType="1" SourceColumn="TESTTEXT"/>
    </Columns>
    <Row>
    <TESTTEXT>STRING</TESTTEXT>
    </Row>
    </Rowset>
    </Rowsets>]][Document_0.ColumnSpecifications = Document_0.ColumnSpecifications=[xml:<?xml version="1.0" encoding="UTF-8"?>
    <ColumnSpecifications>
    <ContextItem>
    <Name>TESTTEXT</Name>
    <Description/>
    <MinRange>0</MinRange>
    <MaxRange>1</MaxRange>
    <Value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="string">STRING</Value>
    <ReadOnly>false</ReadOnly>
    </ContextItem>
    </ColumnSpecifications>]]]
    [DEBUG] [TESTSUB1] [Document_0]: Resolving Input Links
    [DEBUG] [TESTSUB1] Action parameter creating time [ <1 ms]
    [DEBUG] [TESTSUB1] Entering action 'Document_0' implementation.
    [DEBUG] [TESTSUB1] Exiting action 'Document_0' implementation
    [DEBUG] [TESTSUB1] [Document_0]: Resolving Output Links
    [DEBUG] [TESTSUB1] [Document_0]: Finished[ <1 ms] Succeeded: true
    Add Row***
    [DEBUG] [TESTSUB1] [Row_0]: Started action execution
    [DEBUG] [TESTSUB1] [Row_0]: Type: IlluminatorRow, Description:
    [DEBUG] [TESTSUB1] [Row_0]: [Initializing Action][Initializing Parameters: [Row_0.IlluminatorDocument = Row_0.IlluminatorDocument=[string:Document_0.Output]]]
    [DEBUG] [TESTSUB1] [Row_0]: Resolving Input Links
    [DEBUG] [TESTSUB1] [Row_0]: Link Stats: Row_0.TESTTEXT, Type [Assign], Time [ <1 ms], Expression: "xxxxxx xTHIS IS MY TEXT xxxxxxxxx "
    [DEBUG] [TESTSUB1] Action parameter creating time [ <1 ms]
    [DEBUG] [TESTSUB1] Entering action 'Row_0' implementation.
    [DEBUG] [TESTSUB1] Exiting action 'Row_0' implementation
    [DEBUG] [TESTSUB1] [Row_0]: Resolving Output Links
    [DEBUG] [TESTSUB1] [Row_0]: Finished[ <1 ms] Succeeded: true
    >>>> Result  OK, Teststring is added to Document_0
    [INFO] [TESTSUB1] [Tracer_0]Exit SUB: TESTTEXT in XML: <?xml version="1.0" encoding="UTF-8"?>
    <Rowsets DateCreated="2010-08-23T16:14:15" EndDate="2010-08-23T12:58:51" StartDate="2010-08-23T12:58:51" Version="12.1.5 Build(99)">
    <Rowset>
    <Columns>
    <Column Description="" MaxRange="1" MinRange="0" Name="TESTTEXT" SQLDataType="1" SourceColumn="TESTTEXT"/>
    </Columns>
    <Row>
    <TESTTEXT>xxxxxx xTHIS IS MY TEXT xxxxxxxxx </TESTTEXT>
    </Row>
    </Rowset>
    </Rowsets>
    ===============================================================================
    SECOND CALL of Sub-Transaction => XML-Doc NOT initalized!?
    [DEBUG] Entering action 'Transaction_Call_0' implementation.
    [DEBUG] [TESTSUB1] [Sequence]: Started sequence execution
    [DEBUG] [TESTSUB1] [Document_0]: Started action execution
    [DEBUG] [TESTSUB1] [Document_0]: Type: IlluminatorDocument, Description:
    [DEBUG] [TESTSUB1] [Document_0]: [Initializing Action][Initializing Parameters: ]
    [DEBUG] [TESTSUB1] [Document_0]: Resolving Input Links
    [DEBUG] [TESTSUB1] Action parameter creating time [ <1 ms]
    [DEBUG] [TESTSUB1] Entering action 'Document_0' implementation.
    [DEBUG] [TESTSUB1] Exiting action 'Document_0' implementation
    [DEBUG] [TESTSUB1] [Document_0]: Resolving Output Links
    [DEBUG] [TESTSUB1] [Document_0]: Finished[ <1 ms] Succeeded: true
    Add Row***  =>  NO error message!?
    [DEBUG] [TESTSUB1] [Row_0]: Started action execution
    [DEBUG] [TESTSUB1] [Row_0]: Type: IlluminatorRow, Description:
    [DEBUG] [TESTSUB1] [Row_0]: [Initializing Action][Initializing Parameters: ]
    [DEBUG] [TESTSUB1] [Row_0]: Resolving Input Links
    [DEBUG] [TESTSUB1] [Row_0]: Link Stats: Row_0.TESTTEXT, Type [Assign], Time [ <1 ms], Expression: "xxxxxx xTHIS IS MY TEXT xxxxxxxxx "
    [DEBUG] [TESTSUB1] Action parameter creating time [ <1 ms]
    [DEBUG] [TESTSUB1] Entering action 'Row_0' implementation.
    [DEBUG] [TESTSUB1] Exiting action 'Row_0' implementation
    [DEBUG] [TESTSUB1] [Row_0]: Resolving Output Links
    [DEBUG] [TESTSUB1] [Row_0]: Finished[ <1 ms] Succeeded: true
    >>>>  Result=> PROBLEM !??? Document_0 is empty:
    [INFO] [TESTSUB1] [Tracer_0]Exit SUB: TESTTEXT in XML: <?xml version="1.0" encoding="UTF-8"?>
    <Rowsets DateCreated="2010-08-23T16:14:15" EndDate="2010-08-23T12:58:51" StartDate="2010-08-23T12:58:51" Version="12.1.5 Build(99)">
    <Rowset>
    <Columns>
    <Column Description="" MaxRange="1" MinRange="0" Name="TESTTEXT" SQLDataType="1" SourceColumn="TESTTEXT"/>
    </Columns>
    </Rowset>
    </Rowsets>
    ===================================================================================
    Edited by: Roger Zuehlsdorf on Aug 24, 2010 4:51 PM

    Hi.
    It is very hard to read your description, but have a look at SP6 patch 2. This contains a fix for initialising of XML documents in transactions. I am not sure weather that is your problem but have a look.
    BR
    Poul.

  • XML doc with multiple namespaces

    Hi,
    a little stupid question...
    Is it possible to get a xml file that assigns two different namespaces and I don't want to use a prefix?
    example:
    xml doc uses namespace xmlns:a="someuri" and xmlns:b="otheruri"
    <?xml version="1.0" encoding="UTF-8"?>
    <Root xmlns="someuri" xmlns:b="otheruri">
    <test/>
    <b:rest/>
    </Root>
    Some way to get prefix b out of it?
    Thanx

    okay, it was a stupid question...
    solution:
    <?xml version="1.0" encoding="UTF-8"?>
    <Root xmlns="someuri" xmlns:b="otheruri">
    <test/>
    <rest xmlns="otheruri"/>
    </Root>

  • Problem combining "use  namespace mx_internal" and events

    Hi,
    I'm using the AutoSizingAdvancedDataGrid from WorkDay
    (here)
    . I need to extend it so that it dispatches a new event when it
    creates the rows and columns.
    However, putting [Event(name="heightChanged",
    type="mx.events.Event")] after the import statements as normal does
    not reveal the heightChanged event in the calling code as it
    should. If I comment out the "use namespace mx_internal" line, then
    the event is exposed, but obviously the compile fails because it
    needs the namespace for the getHeaderInfo() (and other) functions.
    Now, I have gotten around this problem by extending the
    AutoSizingAdvancedDataGrid again to AutoSizingADG and overriding
    the makeRowsAndColumns function, but I would like to know why the
    original won't work, and if there's any other way to solve it?
    Thanks for your help

    quote:
    Originally posted by:
    peterent
    SWF files that are assigned to the local-trusted sandbox can
    interact with any other SWF files and can load data from anywhere
    (remote or local). "
    So how can we do this?
    For example, I want to write a flex blog reader, which is
    suppose to run locally, and packed it with an installer.
    User run the installer and copy the swf to target directory,
    but the target directory is not a development environment.
    What can we do to deal with this?
    The crossdomain.xml is absolutely absent from the blog sites,
    at least, not 100% avaiable.
    The flash player security is a good thing, but since the user
    noticed the installation agreement, so it shouldn't be a major
    concern as he/she should be noticed of the blog reader needed to
    connect to internet.
    Flex absolutely went through the sandbox locally, there
    should be way.
    The focus is, how can we do this?

Maybe you are looking for

  • Can't access Aperture support forum

    Hi all, not sure whether this is the right place to report a problem with the Aperture Support forum - I couldn't find anywhere to report the problem so posted here. When I try to enter it I get the following error message "Unsupported Browser detect

  • How to use Rand()  (ANSI Function)as such in Oracle

    I need to use Rand() function as such in ANSI format in oracle how to use it. I don't want to use the available DBMS_RANDOM.RANDOM(), i want to use ANSI Function as such in Oracle Please help me

  • One source File should be sent to Receivers based on Message type

    Hi All, I am facing with a problem, the scenario is File to IDOC... The file which comes has different message types if Message type is VERIFY then IDOC <b>_-AFS_-DELVRY03</b> has to be triggered and if Message type is MIGO101 then IDOC <b>_-AFS_-WMM

  • Filter to modify html files problem with SC_NOT_MODIFIED

    Hello ! I am trying to create filter to modify html files before sending to client. I created ResponseWrapper using CharArrayWriter, then I can modify the cached output and later send it to client. This code works fine. BUT the browser caches the htm

  • Where is the list of pending driver updates?

    I saw mentioned somewhere on these discussions that HP had a "list of pending updates". Anybody know where that might be? Like others I subscribed to HP Alerts, and all I get is SPAM.