XML Parser and Content-type/encoding problem

I've write a little and simple XML parser and a simple "trasformer" that recive an XML file and an XSL one and return HTML, here is the code:
public static String toHTML(Document doc, String xslSource){
        ByteArrayOutputStream testo = new ByteArrayOutputStream();
        try{
            DOMSource source = new DOMSource(doc);
            TransformerFactory tFactory = TransformerFactory.newInstance();
            System.out.println("----> " + xslSource);
            Transformer transformer = tFactory.newTransformer(new StreamSource(xslSource));
            transformer.setOutputProperty(OutputKeys.INDENT, "yes");
            transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
            transformer.setOutputProperty(OutputKeys.METHOD, "html");
         transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
         transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
            transformer.transform(source, new StreamResult(testo));
        }catch(Exception ioe){
            System.out.println("2 XMLTool.toHTML " + new java.util.Date());
            System.out.println(ioe);        
        return testo.toString();
    }the problem is that I would like to put the HTML code its return into a JEditorPane; now I'm trying with this code:
JEditorPane jep1 = new JEditorPane();
jep1.setContentType("text/html");
jep1.setText(v);
// 'v' is the string returned by the code posted up (the XML/XSL transformer)but I can't see anything in my JEditorPane.
I think that the problem is this line of code that the transformer add automaticaly ad HTML code:
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">Infact if I try to delete this line from the code I can see what I want but is'n good delete a line of code without understend where is the problem.
So, can anyone help me?

good.
when u set ur output properties to html , transformer
searches for all entity references and converts accordingly.
if u r using xalan these files will be used for conversion of
Character entity references for markup-significant
output_html.properties
(this should be in templates package)
and HTMLEntities.res(should be in serialize package)
vasanth-ct

Similar Messages

  • Error after updating field and content type

    Hi,
    I have a feature with a custom list and content type.
    I changed one field type from Text to Note, and made the same change in my Schema.xml file.
    But after deploying I get an error when I visit my list.
    "The file name you specified could not be used.  It may be the name of an
    existing file or directory, or you may not have permission to access
    the file".
    I have several sites with the same list, and all gives the same error.
    What I understand from the ULS logs it can't find my schema file, but when I look at the 14 hive it is there.
    ULS
    Failed to open the file 'schema.xml'.
    Failed to retrieve the list schema for feature {4D3315CB-7F20-4DB3-9CB3-258AC110F9BC}, list template 21973; expected to find it at: "".
    Any ideas about how to fix this?
    The text expected to find it at: "" can be the problem as I have my schema file in a folder named Correspondence List.
    And in the 14 hive I find the schema at 14\TEMPLATE\FEATURES\my feature\Correspondence List\Schema.xml
    This is from my manifest file:
    <ElementManifest Location="Correspondence\Elements.xml" />
    <ElementManifest Location="Correspondence List\Elements.xml" />
    <ElementFile Location="Correspondence List\Schema.xml" />
    Any help are appriciated

    Hi,
    Any update?
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • XML parser and XML processor

    Hi,
    I am trying to load the XML Parser and XSLT processor into the XDK that i have. Please can someone tell me how this is done. So far i keep hearing about classpath and .jar files. i have no idea what to do with these. Is there a manual which will tell me how to do this? Or can anyone explain to me?. Or can anyone tell me how to check if they are already there, the technican installed the software but does not know how to use it!, so i am very lost with this and am using it for my masters project.
    Hope you can help.
    Thanks

    Hi,
    I have checked the lib folder. xmlparsev2.jar is there. Is this the classpath? if not how do i get it to the classpath? and how do i do that?
    Thanks for your help so far

  • Exception in encoding and content type

    Hello everyone,
    I am using JavaMail API 1.1.3 to download mails from POP3 servers. The application seems to be working fine except when I am seeing the following entries in the message header:
    1) Content-Transfer-Encoding: 8bits
    Exception -- Unknown encoding: 8bits
    2) Content-Type: text/plain;
         charset="utf-7"
    Unsupported encoding exception -- utf-7 [could not load class sun.io.ByteToCharutf-7]
    3) Content-Type: text/plain;
         charset="koi8-r"
    Did anyone encounter this before and/or have a resolution? Appreciate if you can share if there is a fix.
    Thanks in advance.

    By default, getContent() will return decoded text. But,some mail server will put 8bits instead of 8bit. Javamail will throw exception when encoding is "8bits". In that case, you will have to decode the message by yourself, force using "8bit".
    Part 2 & 3 of the problem - it is not able to find the character set support.

  • XML parsing and pop up window

    hi,
    i have a JSP.
    this JSP has the following code..
    Relevant code snippet...
    <form name="myform" action="Parse.jsp" method="post" target="newWin" onsubmit="return doSubmit(this);">
    <input type="hidden" name="xmldata" value=<%=array[1]%>> // array[1] is an XML string returned by a class method.
    <input type="submit" value="Parse the xml">
    </form>
    <script>
    function doSubmit(formObj) {
        window.open('','newWin','scrollbars=0,menubar=0,toolbar=0,location=0,status=0');
        return true;
    </script>this Parse.jsp wants to perse the XML given to it....
    the problem is this Parse.jsp never gets the proper xml....because you know i have the value=<%=array[1]%> in the above and this is corrupting the XML.
    so, problem is how can open a pop up and send the XML string from its parent window ?

    please code sample ? demo code is enough to try
    with.This has nothing to do with samples. You should know
    which encodings you use. You decalre it in the HTML
    i have not mentioned encoding in the HTML.
    by html encoding , i think you mean this (bold letter)
    // created by dreamweaver 2004
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    </head>
    <body>
    </body>
    </html>if you mean that...NO, I DID NOT USE that thing in my JSP. i deleted that.
    and XML headers. XML encoding, i have this at the start of XML....
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    // XML data
    Java, if nothing else is said, uses
    UTF16.
    in my form i have method="post".And what do you receive? What does "corrupted" mean?
    Not well-formed? Garbage characters? Truncated?error message: [STDOUT] xmlStringelectric.xml.ParseException: java.io.IOException: could not find 59 line 1, char 46682:
    NO, i dont blame my parser. if i provide the XML seperately, then my parser works fine.
    but when i send the XML via JSP to the parser it does not work.
    that means sending of XML is making some trouble.

  • Swapping XML Parser and XSLT to Xalan 2.7.0 - Not Working (OC4J 10.1.3)

    Hi-
    I'm trying to use the latest Xercies/Xalan classes in OC4J 10.1.3 as described in the How-To swap XML Parsers document:
    http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-swapxmlparser/doc/readme.html
    What I can see happening is that the oracle.xml shared library is successfully 'turned off', but the xalan libraries are not added. Instead, the default xml classes that are distributed with the JDK become visible. For instance, using a slightly modified version of the index.jsp page from the how-to, I get this result:
    ------ Output from JSP page ----------------
    TransformerFactory Instance: org.apache.xalan.processor.TransformerFactoryImpl
    Transformer Instance: org.apache.xalan.transformer.TransformerIdentityImpl
    Transformer Version: Xalan Java 2.4.1 (!!)
    What I expect is for that last line to say version 2.7.0, which is the version of the xalan.jar included in my shared library (code to add that line to the how-to shown below).
    I suspect what is happening is that the class loader is simply not letting a shared library override a system library - to do that you probably need to place the jar files in system endorsed directory.
    Has anyone gotten this how-to to work - actually replacing the XML parser/transform classes with the latest Xalan classes? Are you sure it is seeing the current version you placed in the shared library?
    Thanks,
    Eric Everman
    ---- My modified getXSLTDetails() method in the index.jsp page of the how-to -------
    <!-- Additional Import -->
    <%@ page import="org.apache.xalan.Version" %>
    public static String getXSLTDetails()
    Transformer transformer=null;
    TransformerFactory transformerfactory = TransformerFactory.newInstance();
         Version ver = null;
         String br = "<" + "br" + ">"; //otherwise the otn forum chocks on the break.
    try
    transformer = transformerfactory.newTransformer();
              ver = (Version) transformer.getClass().forName("org.apache.xalan.Version").newInstance();
              String ret_val =
                   "TransformerFactory Instance: "+transformerfactory.getClass().getName() + br +
                   "Transformer Instance: "+transformer.getClass().getName() + br;
              if (ver != null) {
                   ret_val = ret_val + "Transformer Version: " + ver.getVersion() + br;
              } else {
                   ret_val = ret_val + "Transformer Version not Available" + br;
              return ret_val;
    catch (Exception e)
    e.printStackTrace();
    return e.getMessage();
    }--------------------------------------------------------------------

    Steve - Thanks for responding on this.
    The Xalan SQL extension is built into Xalan. The most painless way to try it out is to run it via JEdit: www.jedit.org
    JEdit a OS Java application with a fairly painless install process (I'm assuming you already have a current JRE installed). Once its installed, you'll need to install the XSLT plugin - in JEdit goto Plugins | Plugin Manager | Install and pick the XSLT plugin. You'll need the Oracle JDBC classes on your classpath - this can be done by copying the oracle_jdbc4.jar into the [JEdit install directory]/jars directory.
    Restart to load that jar and you should be all set.
    I included a sample XSLT page at the bottom of this post that is somewhat of a template transform for the SQL extension - its more complicated then it needs to be, but it does some nice things with the results of the query. Save it as a file and make the appropriate changes to the 'datasource' parameter near the top of the file.
    Then in JEdit, open the file and make sure the XSLT plugin is visible (Plugins | XSLT | XSLT Processor Toggle - or alternately dock it in the window via global prefs). In the XSLT plugin: Allow the current buffer to be used as the source, Add that same file as a stylesheet via the '+' button, and pick a result file at the bottom. Then click the 'Transform XML' button.
    Troubleshooting: I seem to remember having some classpath errors when I tried this on windows, but others have had it work w/o issues. I do remeber that the XSLT plugin had a popup window that gave a pretty good explaintion of the problem, if it occurs. Also, for some reason the XSLT plugin will not create a new file for the output, so its often best to create a file first, then choose it as the output. Of course, you can always run a transformation from the command line or w/in an applicatoin. Full docs on the Xalan SQL extension can be found at: http://xml.apache.org/xalan-j/extensionslib.html#sql
    Here is my sample XSLT transform using the SQL extension:
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
              xmlns:sql="http://xml.apache.org/xalan/sql"
              xmlns:str="http://exslt.org/strings"
              xmlns:xalan="http://xml.apache.org/xalan"
              extension-element-prefixes="sql str xalan">
         <xsl:output indent="yes"/>
         <xsl:param name="driver">oracle.jdbc.OracleDriver</xsl:param>
         <xsl:param name="datasource">jdbc:oracle:thin:jqpublic/jqpublic@server_name:1521:dbname</xsl:param>
         <xsl:param name="jndiDatasource"><!-- jndi source for production use w/in enterprise environment --></xsl:param>
         <xsl:param name="debug">true</xsl:param>
         <xsl:variable name="connection" select="sql:new()"/>
         <xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
         <xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'"/>
         <!--
              The query:  You could pass parameters in to this query to build a where clause, but here is a simple example.
              Also, its nice to wrap the query with a max row number to prevent huge results.
         -->
         <xsl:param name="query">
         select * from (
      SELECT
              'One' FIELD_1,
              'Two' FIELD_2
         FROM DUAL
         ) where rownum < 100
         </xsl:param>
         <!-- Essentially, create a XConnection object -->
         <xsl:variable name="connection" select="sql:new()"/>
         <xsl:template match="/">
        <xsl:choose><!-- Connect using JNDI -->
          <xsl:when test="$jndiDatasource != ''">
            <xsl:if test="not(sql:connect($connection, $jndiDatasource))">
              <xsl:message>Failed to connect to db via jndi connection</xsl:message>
              <xsl:comment>Failed to connect to db via jndi connection</xsl:comment>
              <xsl:if test="$debug = 'true'">
                <xsl:copy-of select="sql:getError($connection)/ext-error"/>
              </xsl:if>
            </xsl:if>
          </xsl:when>
          <xsl:otherwise><!-- Connect using connection string -->
            <xsl:if test="not(sql:connect($connection, $driver, $datasource))">
              <xsl:message>Failed to connect to db via driver/url connection</xsl:message>
              <xsl:comment>Failed to connect to db via driver/url connection</xsl:comment>
              <xsl:if test="$debug = 'true'">
                <xsl:copy-of select="sql:getError($connection)/ext-error"/>
              </xsl:if>
            </xsl:if>
          </xsl:otherwise>
        </xsl:choose>
              <!--
              The results of the query.  The rowset is brought back in 'streaming' mode,
              so its not possible to ask it for the number of rows, or to check for zero
              rows.  There is a switch to disable streaming mode, but this requires all
              rows to be brought into memory.
              -->
              <xsl:variable name="table" select="sql:query($connection, $query)"/>
              <xsl:if test="not($table)">
                   <xsl:message>Error in Query</xsl:message>
                   <xsl:copy-of select="sql:getError($connection)/ext-error"/>
              </xsl:if>
              <page>
                   <!-- Your xalan environment -->
                   <xsl:copy-of select="xalan:checkEnvironment()"/>
                   <!-- Build a bunch of metadata about the rows -->
                   <meta>
                        <cols>
                             <xsl:apply-templates select="$table/sql/metadata/column-header"/>
                        </cols>
                   </meta>
                   <rowset>
                        <!--
                             With streaming results, you must use the apply-temmplates contruct,
                             not for-each, since for-each seems to attempt to count the rows, which
                             returns zero.
                        -->
                        <xsl:apply-templates select="$table/sql/row-set"/>
                   </rowset>
              </page>
              <xsl:value-of select="sql:close($connection)"/><!-- Always close -->
         </xsl:template>
         <xsl:template match="row">
              <row>
                   <xsl:apply-templates select="col"/>
              </row>
         </xsl:template>
         <xsl:template match="column-header">
              <col>
                   <xsl:attribute name="type">
                        <xsl:value-of select="@column-typename"/>
                   </xsl:attribute>
                   <xsl:attribute name="display-name">
                        <xsl:call-template name="create-display-name"/>
                   </xsl:attribute>
                   <xsl:value-of select="@column-name"/>
              </col>
         </xsl:template>
         <!-- Convert column names to proper caps: MY_FIELD becomes My Field -->
         <xsl:template name="create-display-name">
              <xsl:variable name="col-name">
                   <xsl:for-each select="str:tokenize(@column-name, '_')">
                        <xsl:value-of
                             select="concat(translate(substring(., 1, 1), $lowercase, $uppercase), translate(substring(.,2), $uppercase, $lowercase), ' ')"/>
                   </xsl:for-each>
              </xsl:variable>
              <xsl:value-of select="substring($col-name, 1, string-length($col-name) - 1)"/>
         </xsl:template>
         <!-- Creates data columns named 'col' with a column-name attribute -->
         <xsl:template match="col">
              <col>
                   <xsl:attribute name="column-name"><xsl:value-of select="@column-name"/></xsl:attribute>
                   <xsl:value-of select="."/>
              </col>
         </xsl:template>
    </xsl:stylesheet>

  • JSR 172 XML parser in WTK 2.5: problems compared to 2.2

    Hi,
    I'm experiencing 2 problems with the WTK 2.5 JSR 172 XML parser that do not occur with:
    -WTK 2.2
    -Sony-Ericsson Emulator WTK2
    -Sony-Ericsson devices.
    They are:
    - attributes.getLocalName(i) always returns an empty string
    - documents with multiple roots cause a parser panic
    Anyone has a hunch?
    Thanks a lot,
    Philippe
    Message was edited by:
    philippelaporte

    I wonder if anyone has encountered the same problem as I and has found a workaround about it. I am trying to create a UI builder that generates itself by reading an XML file.
    One of the elements is a Combo Box, which should be read from the following structure:
    <form>
              <combobox>
                       <value>My first value</value>
                       <value>My second value</value>
                       <value>My third value </value>
              </combobox>
    </form>Then I proceed to generate a vector of UI Elements, and process the Combobox, for example, as follows:
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    import java.util.*;
    public class UIConfHandler extends DefaultHandler{
         //For knowing to which element am I adding content
         private Stack tagStack = new Stack();
         //An interface that allows me to access content to my elements
         private UIElement element;
         //A container of the elements retrieved from the file
         private Vector envelope;
         public UIConfHandler(){
         public void startDocument() throws SAXException {
              envelope = new Vector();
         public void endDocument() throws SAXException {
         public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException{
              System.out.println("Beginning of the element");
              if(qName.equals("combobox")){
                   //I just cast my element as a Combo Box element, and add specific content from within the attributes of the tag
                   element = new ComboBoxElement(attributes.getValue("id"),attributes.getValue("label"),attributes.getValue("type"),"");
              else{
              //And I add the reference to which element am I currently in via the stack
              tagStack.push(qName);
         public void characters(char[] ch, int start, int length) throws SAXException{
              String chars = new String(ch, start, length).trim();
              if(chars.length() > 0){
                   if((qName.equals("value"))){
                        if (element instanceof ComboBoxElement ){
                             //I add a specific value to a Vector inside my ComboBox content
                             ((ComboBoxElement) element).addElementToVector(chars);
                   else{
                        System.out.println("Content with no action specified.");
         public void endElement(String uri, String localName, String qName, Attributes attributes) throws SAXException{
              System.out.println("End of the element");
              if(qName.equals("combobox")){
                   //After all the values are added inside the internal vector of the element, add the element to the container
                   envelope.addElement(element);
              //And remove the combobox element from the stack
              tagStack.pop();
         public Vector getEnvelope() {
              return envelope;
    }Afterwards, I would use this element to create a ChoiceGroup to be viewed in a MIDlet. The problem is that the code in endElement is never called. Does somebody know what this could be?
    /C�sar
    Message was edited by:
    Sigurdvh

  • XML parser not detecting character encoding

    Hi,
    I am using Jdeveloper 9.0.5 preview and the same problem is happening in our production AS 9.0.2 release.
    The character encoding of an xml document is not correctly being detected by the oracle v2 parser even though the xml declaration correctly contains
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    instead it treats the document as UTF8 encoding which is fine until a document comes along with an extended character which then causes a
    java.io.UTFDataFormatException: Invalid UTF8 encoding.
    at oracle.xml.parser.v2.XMLUTF8Reader.checkUTF8Byte(XMLUTF8Reader.java:160)
    at oracle.xml.parser.v2.XMLUTF8Reader.readUTF8Char(XMLUTF8Reader.java:187)
    at oracle.xml.parser.v2.XMLUTF8Reader.fillBuffer(XMLUTF8Reader.java:120)
    at oracle.xml.parser.v2.XMLByteReader.saveBuffer(XMLByteReader.java:448)
    at oracle.xml.parser.v2.XMLReader.fillBuffer(XMLReader.java:2023)
    at oracle.xml.parser.v2.XMLReader.tryRead(XMLReader.java:972)
    at oracle.xml.parser.v2.XMLReader.scanXMLDecl(XMLReader.java:2589)
    at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:485)
    at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:192)
    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:144)
    as you can see it is explicitly casting the XMLUTF8Reader to perform the read.
    I can get around this by hard coding the xml input stream to be processed by a reader
    XMLSource = new StreamSource(new InputStreamReader(XMLInStream,"ISO-8859-1"));
    however the manual documents that the character encoding is automatically picked up from the xml file and casting into a reader is not necessary, so I should be able to write
    XMLSource = new StreamSource(XMLInStream)
    Does anyone else experience this same problem?
    having to hardcode the encoding causes my software to lose flexibility.
    Jarrod Sharp.

    An XML document should be created with 'ISO-8859-1' encoding to be parsed as 'ISO-8859-1' encoding.

  • Xml parsing and report generation probs

    Hello everyone,
    I am facing with a peculiar problem.
    I have an xml which contains special characters like �( cent) . So I parse it before i send it to the DOM parser. BufferedReader br = new BufferedReader(new InputStreamReader(inputFileName,"ISO-8859-1"));
    and i have a function which replaces the cent with #xA2; .After i replace the special chars , i pass it to the parse method and i have some classes which update the database.the whole process works fine.
    Now I have a report generation where i generate an HTML passing the string after the values are updated in the DB . So when i pass the string , and replace #xA2 with cent symbol, it is being interrupted as '?' in the windows and unix environment
    This is something to do with the encoding.But my encoding is ISO-8859-1 as mentioned
    Can you please help me out with this prob
    Regards
    KV

    I have some sympathy with you because I had problems with the cent sign in the XML world too. But not much... you have XML parsing going on, you're writing to a database, you're generating HTML, you have a manual hack for the cent sign. One or more of these things is causing you a problem. Do not try to test them all at once, like you are doing. Test only one thing at a time.

  • Importing XML data into sys.XMLType  - encoding problem

    Hi,
    I'm using "modplsql Gateway" to upload XML file with encoding "windows-1250" with some regional characters in database table.
    The table definition:
    CREATE TABLE NAHRAJ_DATA (
    NAME VARCHAR(128) UNIQUE NOT NULL,
    MIME_TYPE VARCHAR(128),
    DOC_SIZE NUMBER,
    DAD_CHARSET VARCHAR(128),
    LAST_UPDATED DATE,
    CONTENT_TYPE VARCHAR(128),
    CONTENT LONG RAW,
    BLOB_CONTENT BLOB
    The file was uploaded correct.
    My database have
    NLS_CHARACTERSET EE8MSWIN1250
    NLS_NCHAR_CHARACTERSET AL16UTF16
    After upload, I convert data from hex(blob) to dec and with function chr() to char. BLOB -> CLOB.
    Next I create sys.XMLType from CLOB. With this progression works all in order.
    In other system where are
    NLS_CHARACTERSET AL32UTF8
    NLS_NCHAR_CHARACTERSET AL16UTF16
    BLOB_CONTENT column(table NAHRAJ_DATA) starts with "FF FE FF FE" in HEX before my XML data. Exactly convert is OK, bud if I can create sys.XMLType I get this
    ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing
    LPX-00200: could not convert from encoding UTF-8 to UCS2 Error at line 1
    ORA-06512: at "SYS.XMLTYPE", line 0
    ORA-06512: at line 1
    I haven't any idea what's wrong.
    Whats mean the HEX code in BLOB_CONTENT column after upload?
    Thangs
    Lukas

    Please post your question in XMLDB forum

  • XML attributes and object types

    I want to create an XML Document of the following form
    <family>
    <parent attr1="val1">
    <child attr2="val2" attr3="val3"/>
    </parent>
    </family>
    Using object table and object type (for the child element), I am able to produce the following XML Document (with a "select * from family" query)
    <family> <!-- rowset -->
    <parent> <!-- row -->
    <attr1>val1</attr1>
    <child>
    <attr2>val2</attr2>
    <attr3>val3</attr3>
    </child>
    </parent>
    </family>
    The question is: how am I going to query these data so that the "attr" elements are mapped to attributes (using XSU only, without XSLT)?
    I have already tried the following:
    1. Using
    SELECT attr1 as "@attr1",
    f.child.attr2 "@attr2",
    f.child.attr3 "@attr3"
    FROM family f
    all the attributes are obviously appended to the "parent" element.
    2. Using nested table for "child" and the following query
    SELECT attr1 as "@attr1",
    CURSOR (
    SELECT n.child.attr2 as "@attr2", n.child.attr3 as "@attr3"
    FROM TABLE(f.child n)
    ) AS "child"
    FROM family f
    I am getting the following document
    <family>
    <parent attr1="val1">
    <child>
    <child_ROW attr2="val2" attr3="val3"/>
    </child>
    </parent>
    </family>
    Is there a smart SQL query to produce the desired document? What data types
    is it recommended to use to define my db schema (object types, nested tables...)?
    Thank you in advance
    null

    Finally, I got the desired XML format output from relational tablse using schema based XMLType views.
    Wherein I created Object Types from relational table, generated the schema for the Object type, registered the schema and finally created XMLType Views for populating the XML data from Relational Tables.
    I guess, you all might aware of my problem, where I got struck. Instead of printing the data in XML format I am successful in generating the XML format data Using the Query Select from BLABLA_Type_view* . I am able to print the number of rows, that I require which is in the fallowing format.
    Column Name
    1. SYS.XMLTYPE ----- As a row
    The view I am querying for is printing the data in a string format, where in I got to do the fallowing query
    SELECT SYS.XMLTYPE.getStringVal(OBJECT_VALUE) FROM BLABLA_Type_view. Which ultimately gave me the required data in XML format with tags.
    Thanks for every one who tried to give a try to solve, especially "mdrake"

  • C++ XML parser error 201 - invalid encoding

    When I make a call:
    xmlpar.xmlparse((oratext *)filename, (oratext *)"UTF-8", flags)
    it results in error 201 - encoding is not valid. The same happens when I try KOI-8 encoding.
    I use XML Parser 2.0.2.0.0 (C++)/Linux,egcs-2.91.66.
    Any suggestions?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by xmlteam ([email protected]):
    Hi,
    You need to have an Oracle home with the NLS data files in it.
    Thanks,
    Oracle XML Team<HR></BLOCKQUOTE>
    I have the oraclehome with NLS files in it but stil have the problem
    null

  • JSR 172 XML parser in WTK 2.5: problems compared to 2.2 (part 2)

    Hi,
    I'm experiencing 2 problems with the WTK 2.5 JSR 172 XML parser that do not occur with:
    -WTK 2.2
    -Sony-Ericsson Emulator WTK2
    -Sony-Ericsson devices.
    They are:
    1- attributes.getLocalName(i) always returns an empty string
    I tried:
    parserFactory.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
    -> still the same
    Then I tried:
    parserFactory.setFeature("http://xml.org/sax/features/namespaces", true);
    with this I get an exception when I try to create a parser.
    2- documents with multiple roots cause a parser panic.
    It is widely known that an XML document MUST NOT have multiple roots.
    I know. So what you're saying is they fixed a bug...
    Still, since devices and the WTK 2.2 doesn't have it, I was hoping there might be a backwards-compatiblity mode.
    I am trying to use the XML parser to parse a small HTML subset. If at least the panic Exception reported the position in the stream, maybe I could just start parsing again from there.
    The point is, why has ist changed, and will the change move to all implementations.
    Anyone has a hunch?
    Thanks a lot,
    Philippe

    Hi,
    I'm experiencing 2 problems with the WTK 2.5 JSR 172 XML parser that do not occur with:
    -WTK 2.2
    -Sony-Ericsson Emulator WTK2
    -Sony-Ericsson devices.
    They are:
    1- attributes.getLocalName(i) always returns an empty string
    I tried:
    parserFactory.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
    -> still the same
    Then I tried:
    parserFactory.setFeature("http://xml.org/sax/features/namespaces", true);
    with this I get an exception when I try to create a parser.
    2- documents with multiple roots cause a parser panic.
    It is widely known that an XML document MUST NOT have multiple roots.
    I know. So what you're saying is they fixed a bug...
    Still, since devices and the WTK 2.2 doesn't have it, I was hoping there might be a backwards-compatiblity mode.
    I am trying to use the XML parser to parse a small HTML subset. If at least the panic Exception reported the position in the stream, maybe I could just start parsing again from there.
    The point is, why has ist changed, and will the change move to all implementations.
    Anyone has a hunch?
    Thanks a lot,
    Philippe

  • Oracle XML parser and IBM jdk bug

    Hello,
    From a few messages found in the XML forum it seems that IBM jvm could cause problems with oracle XML parser. ( see http://technet.oracle.com:89/ubb/Forum11/HTML/003823.html )
    I am using IBM jvm (jdk 1.3) on a linux box, and problems are starting to arise:
    I have
    - 1 BC4J based jsp app which works fine.
    - 2 XML parsing BC4J apps which cause strange errors (like parsing 40 documents fine and failing on the 41st for no apparent reason)
    Hopefully, Steven Muench provided precious advice on this (basically, disabling the JIT), however some issues are still open:
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>You should file a bug with IBM to get this fixed, using your stylesheet as a testcase. Lots of people have hit this problem.<HR></BLOCKQUOTE>
    Has anyone (from oracle or else) done this yet? I have gone (quickly) through IBM website but I didn't find any bug report utility or the like...
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Disable your JIT compiler (or switch JVM's) and you won't have the error.<HR></BLOCKQUOTE>
    Turning off the JIT indeed made the errors vanish, thanks a lot for the tip!
    I have a few more questions though :
    * As the BC4J framework uses the xml parser, It is fairly possible that the ibm jvm bug will affect it...
    I haven't had any problems (yet?) with the BC4J part of my applications, but I'm a bit concerned about having random bugs lurking around (I have more than enough of my own :) )
    Has anyone stumbled upon IBM JVM vs oracle parser issues in BC4J? (oracle.xml.parser.v2.XXXXXX exceptions...)
    * If BC4J is indeed affected, what's the solution?
    - Disable the JIT? (And forget about performance?... hmmm... no)
    - Switch parsers? (oracle parser is too tightly integrated in the BC4J Framework isn't it?.. hmm... not possible either)
    - Wait for a patch from IBM (and use another one in the meantime) / switch JVM :
    In either case, I'd really like to know what is the JVM that oracle people use / would advise.
    Thanks for your help
    null

    For those interested,
    last week i reported this bug in the ibm jvm news forum.
    They said that the problem had been investigated and would be fixed in their next service release.
    FYI: the current release (SR7, labeled "build cx130-20010329) still has various problems wih oracle XML parser.
    Remi
    null

  • Mapviewer SVG and Content-Type http header

    Hello,
    We have a Mapviewer installation that seems to be serving up the wrong Content-Type header for the SVG charts. The map is being created correctly and we can get GIF's and such.
    The wrong Content-Type causes the Adobe SVG viewer to never render the SVG map successfully. When I save the SVG file to the desktop it opens perfectly or if I statically link it in to the web page from the sever it also opens perfectly. Is there some configuration that is missing somewhere on the mapviewer or the application server to correctly set the Content-Type ?
    Notice the content type of the failing map compared to a working SVG chart we have.
    HTTP/1.x 200 OK
    Content-Length: 41979
    Cache-Control: private
    Content-Type: application/octet-streamConnection: Keep-Alive
    Keep-Alive: timeout=5, max=999
    Server: Oracle-Application-Server-10g/10.1.2.0.0 Oracle-HTTP-Server OracleAS-Web-Cache-10g/10.1.2.0.0 (N;ecid=92576875655,0)
    Last-Modified: Wed, 16 Aug 2006 20:31:58 GMT
    Date: Wed, 16 Aug 2006 20:32:01 GMT
    Accept-Ranges: bytes
    instead of a working SVG graphic
    HTTP/1.x 200 OK
    Date: Wed, 16 Aug 2006 20:35:32 GMT
    Server: Oracle9iAS/9.0.2 Oracle HTTP Server Oracle9iAS-Web-Cache/9.0.3
    Content-Length: 3831
    Content-Type: image/svg+xml; charset=utf-8Connection: Keep-Alive
    Keep-Alive: timeout=5, max=999
    This seems to be the last sticking point in successfully rolling out this mapviewer implementation. Any help would be greatly appreciated.
    Thanks, in advance.
    Thanks,
    Carl

    Hello,
    Thanks for the reply I've tried both SVG_URL and SVGZ_URL and used a http header sniffer to watch what's getting served up and the urls associated with MapViewer SVG are definitely getting served up with that wrong Content-Type.
    Our front end is an Oracle APEX environment were we use APEX's SVG charting on the same page and they are getting served up with the correct Content-Type and display correctly, which is nice cause I can watch the header difference's side by side, and we know the mapping itself is working right because we can get image files back
    Is there a sever config file or something like the httpd.conf for apache that needs to be set?
    Thanks for any help or insight
    Carl

Maybe you are looking for

  • Where did my stuff go?

    I don't understand the prompts "replace" or "merge"...merge sounded safe so I chose it but somehow the only things that got saved to my new iPhone were contacts/messages from Oct 18...nothing after plus no music, ringtones or applications. I am re-ba

  • Mac os x lion wont boot after an EFI upgrade and i am  unable to reinstall using recovery hd.

    i have macbook pro 2011 mid . it came preinstalled with lion (10.7.x) I updated my mac os x lion for an efi upadte (i don't remember the version but it was there in update list) ,java and safari . After downloading it restarted. i heard a beep sound

  • Can't install a huawei e3231 dongle on my macbook with 10.6.8

    Hi. Am in the UK and have a MacBook running OS1-0.6.8. Trying to connect a Three dongle, a Huawei e3231 and it isn't recognized.  Any suggestions?  I looked on the Huawei website, but there are no drivers for that modes on the site. Thanks

  • Track file usage by recording PC name?

    Is there any way for a pdf form file to record the PC name everytime it is opened on a new pc?

  • Using jsf with struts

    hi; i am trying to understand the proper architecture when using jsf and struts together. i think i understand the differences between the technologies . it seems to me that instead of justifying jsf there should be a focus on how the two technologie