Problem in xml header syntax!!

I'm testing hibernate framework, I'm writing this mapping xml file. Regardless the fact it is a hibernate example, this is a normal xml file problem. When I write that xml to the JBuilder editor, I get an error msg. I don't know why! and this is actually the question, how to make the xml below valid?
I'd like to share my experience about this file. The problem is in the line
and this is the key to the hidden solution!! is this line like import statement so the editor doesn't see it? when I delete it, the editor then says: that <hibernate-mapping>, <class> etc must be declared!!
Thanks in advance for help
below is the xml file code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
<class name="hello.Message" table="MESSAGES">
<id name="id" column="MESSAGE_ID">
<generator class="increment"/>
<property name="text" column="MESSAGE_TEXT"/>
<many-to-one name="nextMessage" cascade="all" column="NEXT_MESSAGE_ID"/>

In my experience with XML (and not hibernate), the set of messages "{every tag name} must be declared" usually means you have not turned on validation properly in whatever is parsing your data. I don't know the magic incantation to parse with a DTD, so I cannot help you with a solution, just with a clarification of the problem.
Dave Patterson

Similar Messages

  • XML header for WebServices (SOAP)

    Hi all!
    I have quite strange problem about XML header in SOAP message for WS. Usually I don't care about XML header in SOAP message, because so far I had no problems calling load of WS on different servers. Stnadard XML header that comes out looks like this (1.0 and UTF-8 are in single quotes): <?xml version='1.0' encoding='UTF-8'?>.
    But this time, the webserver I'm trying to call accepts only double quotes, e.g. like this: <?xml version="1.0' encoding="UTF-8"?>, it doesn't understand single quotes at all and there is no way of changing it!
    JDeveloper uses apache soap for standard and makes single quotes. I tried raw http call by wrapping all text into post method -> that works, so webservice is working.
    I can't set anything except endpoint, parameters, method :(
    How can I make call that uses double quotes?
    Pseudo logic is like this:
    Vector params = new Vector();
    Call call=new Call("xxx", "xxx", params, xxx, Constants.NS_URI_SOAP_ENC);
    Response response = call.invoke(endpointURL, "xxx");

    Hacked Oracle (apache) classes and put right values in it.
    It was hard coded string, who on earth could thought that :D

  • Remove XML Header

    I am developing a Java Servlet and would like to query the database multiple times. I have used OracleXMLQuery and an array to be able to run three separate queries. My problem is occuring in my returned XML Document. Each query comes back with a XML Header such as:
    <?xml version = '1.0'?>
    <?xml version = '1.0'?>
    <?xml version = '1.0'?>
    I have assigned the header separately and would just like to be able to turn off the generated header. My problem is coming when I am trying to use an applet and it does not like when it sees the XML header more than once. Any ideas or hints on how this can be done I would appreciate it.

    Hello this did solve my issue. I have same issue infact. I used this xsl mapping  as
    <xsl:stylesheet version="1.0" xmlns:xsl="">
       <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
    But my output xml struıcture has broken. Should I  do some changing in my xsl mapping and how ?

  • Encoding missing from XML header

    I have to manipulate an XML document. Using Java 1.4.1, I build a Document object based on the XML file, manipulate the Document and output it as attached below.
    The problem is that the xml header in the output does not contain the "encoding" information. I could of course manipulate the output afterwards, but it would not be a neat solution. Any ideas?
    DOMSource domSource = new DOMSource(document);
      StreamResult streamResult = new StreamResult(
           new OutputStreamWriter(System.out , java.nio.charset.Charset.forName("UTF-8"))
      TransformerFactory tf = TransformerFactory.newInstance();
      Transformer serializer = tf.newTransformer();
      serializer.transform(domSource, streamResult);

    When you serialize your output to a Writer, the parser has no way to tell what encoding the Writer uses, so it's up to you to ensure that the parser knows what encoding the Writer is using. Otherwise it will not specify any encoding, essentially assuming the Writer is using either UTF-8 or UTF-16 encodings.
    In your case you don't have a problem, because "no encoding" means that the document is encoded in UTF-8 or UTF-16; it's easy for a parser to examine the first few bytes of the file and tell which it is. Yours is encoded in UTF-8, so it's correct.

  • Problem with XML on Linux

    hi everybody,
    I've a big problem with XML on Linux, in details I see my program stopping on Linux at the instruction
    XMLReader xr = XMLReaderFactory.createXMLReader("org.apache.crimson.parser.XMLReaderImpl");
    and it's strange because on Windows it runs and there aren't problems about permissions on files, does anyone knows what to do?
    thanks in advance!

    What happens on that line? I'm assuming you get some kind of error or exception.
    Make sure the JAR file for Crimson is in your classpath.

  • Problem with XML in APEX ORA-06502

    i, I have a problem with XML generation, I developed an application in APEX, and in a html page I have this process:
    l_XML varchar2(32767);
    select xmlElement
    xmlElement("razonSocial", J.RAZON_SOCIAL),
    xmlElement("idRepre", J.ID_REPRE),
    xmlElement("rucContador", J.RUC_CONTADOR),
    xmlElement("anio", J.ANIO),
    xmlElement("mes", J.MES),
    select xmlAgg
    --xmlAttributes(K.ID_COMPRA as "COMPRA"),
    K.COD_SUSTENTO as "codSustento",
    K.TPLD_PROV as "tpldProv",
    K.ID_PROV as "idProv",
    K.TIPO_COMPROBANTE as "tipoComprobante",
    to_char(K.FECHA_REGISTRO, 'DD/MM/YYYY') as "fechaRegistro",
    K.ESTABLECIMIENTO as "establecimiento",
    K.PUNTO_EMISION as "puntoEmision",
    K.SECUENCIAL as "secuencial",
    to_char(K.FECHA_EMISION, 'DD/MM/YYYY') as "fechaEmision",
    K.AUTORIZACION as "autorizacion",
    to_char(K.BASE_NO_GRA_IVA, 9999999999.99) as "baseNoGraIva",
    to_char(K.BASE_IMPONIBLE, 9999999999.99) as "baseImponible",
    to_char(K.BASE_IMP_GRAV, 9999999999.99) as "baseImpGrav",
    to_char(K.MONTO_ICE, 9999999999.99) as "montoIce",
    to_char(K.MONTO_IVA, 9999999999.99) as "montoIva",
    to_char(K.VALOR_RET_BIENES, 9999999999.99) as "valorRetBienes",
    to_char(K.VALOR_RET_SERVICIOS, 9999999999.99) as "valorRetServicios",
    to_char(K.VALOR_RET_SERV_100, 9999999999.99) as "valorRetServ100"
    select xmlAgg
    P.COD_RET_AIR as "codRetAir",
    to_char(P.BASE_IMP_AIR, 9999999999.99) as "baseImpAir",
    to_char(P.PORCENTAJE_AIR, 999.99) as "porcentajeAir",
    to_char(P.VAL_RET_AIR, 9999999999.99) as "valRetAir"
    xmlElement("estabRetencion1", K.ESTAB_RETENCION_1),
    xmlElement("ptoEmiRetencion1", K.PTO_EMI_RETENCION_1),
    xmlElement("secRetencion1", K.SEC_RETENCION_1),
    xmlElement("autRetencion1", K.AUT_RETENCION_1),
    xmlElement("fechaEmiRet1", to_char(K.FECHA_EMI_RET_1,'DD/MM/YYYY')),
    xmlElement("docModificado", K.DOC_MODIFICADO),
    xmlElement("estabModificado", K.ESTAB_MODIFICADO),
    xmlElement("ptoEmiModificado", K.PTO_EMI_MODIFICADO),
    xmlElement("secModificado", K.SEC_MODIFICADO),
    xmlElement("autModificado", K.AUT_MODIFICADO)
    from SRI_COMPRAS K
    into l_XML
    where J.ID_INFORMANTE =:P3_MES
    and J.RUC =:P3_ID_RUC
    and J.ANIO =:P3_ANIO
    and J.MES =:P3_MES;
    sys.htp.p('Content-Length: ' || length(l_XML));
    Now my table has more than 900 rows and only when I specifically selected 25 rows of the table "ANEXO_COMPRAS" in the where ( AND K.ID BETWEEN 1 AND 25) the XML is generated.+
    I think that the problem may be the data type declared "varchar2", but I was trying with the data type "CLOB" and the error is the same.+
    l_XML CLOB;
    --Oculta XML
    wwv_flow.g_page_text_generated := true;
    wwv_flow.g_unrecoverable_error := true;
    --select XML
    select xmlElement
    from SRI_COMPRAS K
    into l_XML
    where J.ID_INFORMANTE =:P3_MES
    and J.RUC =:P3_ID_RUC
    and J.ANIO =:P3_ANIO
    and J.MES =:P3_MES;
    sys.htp.p('Content-Length: ' || length(l_XML));
    The error generated is ORA-06502: PL/SQL: numeric or value error+_
    Please I need your help. I don`t know how to resolve this problem, how to use the data type "CLOB" for the XML can be generate+

    JohannaCevallos07 wrote:
    Now my table has more than 900 rows and only when I specifically selected 25 rows of the table "ANEXO_COMPRAS" in the where ( AND K.ID BETWEEN 1 AND 25) the XML is generated.+
    I think that the problem may be the data type declared "varchar2", but I was trying with the data type "CLOB" and the error is the same.+
    The error generated is ORA-06502: PL/SQL: numeric or value error+_
    Please I need your help. I don`t know how to resolve this problem, how to use the data type "CLOB" for the XML can be generate+The likeliest explanation for this is that length of the XML exceeds 32K, which is the maximum size that <tt>htp.p</tt> can output. A CLOB can store much more than this, so it's necessary to buffer the output as shown in +{message:id=4497571}+
    Help us to help you. When you have a problem include as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    And always post code wrapped in <tt>\...\</tt> tags, as described in the FAQ.

  • Create a new line in the xml-header structure.

    Can any one tell me how to create a new line in the xml-header structure.
    I am doing a IDOC-XI-HTTP scenario.
    Actually my mapping create this file:
    <b><?xml version="1.0" encoding="utf-8"?>
      <IDOC BEGIN="1">
        <EDI_DC40 SEGMENT="1"> </b>
    The result must look like this.
    <b><?xml version="1.0" encoding="utf-8"?>
      <IDOC BEGIN="1">
        <EDI_DC40 SEGMENT="1"> </b>
    Thanks and Regards,

    thanks for you quick answer.
    I found a xsl script.
    It works fine.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="">
    <xsl:output method="xml" indent="yes"/>
       <xsl:template match="*">
          <xsl:param name="depth">0</xsl:param>
          <!-- New line with indenting. -->
          <xsl:if test="$depth > 0">
             <xsl:text>    </xsl:text>
          <xsl:element name="{name(.)}">
             <xsl:for-each select="@*">
                <xsl:attribute name="{name(.)}"><xsl:value-of select="."/></xsl:attribute>
                <xsl:with-param name="depth" select="$depth + 1"/>
    Best regards

  • Problem in xml query

    I am working on BLS and having problem in xml query.I want to perform some calculation over xml columns.Than total of this as a new column.I can do this part in logic editor itself but can i do these both task by XSLT.
    Can be made our own XSLT for this ?
    I am feeling kind of fear to xslt. Can anybody help me in this.
    Thanks a lot in advance

    In xMII there is a list of predefined xslt transforms that do something similar to what you are explaining.  The 3 that I think may be what you are looking for are
    they are under Calculation Transformations and Subtotal Transformation take a look at these and tell me if they are doing what you want to accomplish.  In the xMII help file do a search on Inline Transforms or navigate to Advanced Topics -> Inline Transforms -> Predefined Inline Transforms.  In this section there are examples of how to use these transforms and apply them in the query templates.  If this is not what you are looking for can you explain in a little more detail along with a simple example of how you want this transform to work.  Also why do you want to use xslt if you can already accomplish this in BLS?

  • Facing problem in xml schema xsd file registration

    i am facing problem in xml schema xsd file registration when
    the number of column is more. It is showing persing error.
    if i am deleting few column from xsd file . It is working otherwise
    showing error. Is there any solution for that please suggest me.
    The Error is
    ORA-31011:XML parsing failed
    ORA_19202: Error occurred in XML processing
    LPX-00230 : (message vary time to time-like invalid tag ending etc.)
    and thanks in advance

    Where is you XML coming from. Are you sure it's valid. If you are hard coding it as a SQL String constant are you hitting the 4k / 32K limit on the size of SQL / PL/SQL constant. Have you tried loading the content from a bfile..

  • Problem for xml generation using DBMS_XMLGEN

    Hi All,
    i have problem during xml generation using Any help would be highly appreciate
    how could we publish xml data using data base API DBMS_XMLGEN in oracle applications (APPS) i.e. at 'View Output" using
    Any help would be highly appreciate.
    Let me know if need more explanation, this is High priority for me.
    Thanks and Regards,
    [email protected]
    Message was edited by:

    You can set the null attribute to true , so that the tag appears in your XML
    see the statement in Bold.
    queryCtx dbms_xmlquery.ctxType;
    result CLOB;
    -- set up the query context
    queryCtx := dbms_xmlquery.newContext(
    'SELECT empno "EMP_NO"
    , ename "NAME"
    , deptno "DEPT_NO"
    , comm "COMM"
    FROM scott.emp
    WHERE deptno = :DEPTNO'
    , 'EMP'
    , 'EMPSET'
    , 'DEPTNO'
    , 30
    result := dbms_xmlquery.getXml(queryCtx);
    insert into clobtable values(result);commit;
    select * from clobtable
    <?xml version = '1.0'?>
    <EMP num="1">
    <EMP num="2">
    <EMP num="3">
    <EMP num="4">
    <COMM NULL="YES"/>
    <EMP num="5">
    <EMP num="6">
    <COMM NULL="YES"/>

  • XML DevCon 2001: Submit schema and stylesheet problems- win XML Spy

    There are only a few days to submit schema and stylesheet problems for XML
    DevCon 2001 in London. If the workshop instructors use your submission
    during the conference, you win a copy of XML Spy.
    XML DevCon 2001 has a content-rich technical program with a faculty that
    includes Henry Thompson (W3C Fellow), Peter Chen (IEEE Fellow, ACM
    Martin Bryan (DIFFUSE Project), and authors such as Bob DuCharme, Ian
    Graham, Elliotte Rusty Harold, G. Ken Holman, Benoît Marchal, JP
    and Simon St. Laurent. There are a variety of eBusiness sessions,
    panel discussions and presentations about ebXML, Web Services, and UDDI.
    The program includes presentations by Jonathan Borden, Ron Bourret, Lee
    Buck, Alex Chaffee, Mark Colan, John Evdemon, Meike Klettke, Andy
    Ingo Macherius, Simon Nicholson, David Orchard, Sebastian Rahtz, Daniel
    Rivers-Moore, Michael Rys, Krishna Sankar, Matt Sergeant, Richard Tobin,
    Priscilla Walmsley, David RR Webber and other distinguished faculty.
    For a free pass to exhibits and special events (keynotes, joint XML UK and
    British Computer Society meeting, OASIS XPath/XSLT meeting, vendor
    Public submissions (schemas and stylesheets)
    Three members of the W3C Schema Working Group (Michael Rys, Henry
    Thompson, Priscilla Walmsley) will teach a Schema Workshop. Submit
    problem schemas to them by e-mail:
    [email protected]
    Sebastian Rahtz, Bob DuCharme, Benoît Marchal, and Ken Holman will
    present the "Stylesheets and Transformations: Best Practices" workshop on
    Thursday, February 22 in London. To submit a stylesheet or problem
    description for their workshop:
    [email protected]
    or browse to:
    ========== Ken North ======================
    See you at Javacon 2001 (New York, March 1)
    XML DevCon 2001: London (February 21-23) New York (April 8-11)

    Looks okay to me. But then I have no idea of what those "problems" are that you mentioned. Was there a particular reason you didn't tell us what they are?

  • Problem parsing XML with schema when extracted from a jar file

    I am having a problem parsing XML with a schema, both of which are extracted from a jar file. I am using using ZipFile to get InputStream objects for the appropriate ZipEntry objects in the jar file. My XML is encrypted so I decrypt it to a temporary file. I am then attempting to parse the temporary file with the schema using DocumentBuilder.parse.
    I get the following exception:
    org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element '<root element name>'
    This was all working OK before I jarred everything (i.e. when I was using standalone files, rather than InputStreams retrieved from a jar).
    I have output the retrieved XML to a file and compared it with my original source and they are identical.
    I am baffled because the nature of the exception suggests that the schema has been read and parsed correctly but the XML file is not parsing against the schema.
    Any suggestions?
    The code is as follows:
      public void open(File input) throws IOException, CSLXMLException {
        InputStream schema = ZipFileHandler.getResourceAsStream("<jar file name>", "<schema resource name>");
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = null;
        try {
          factory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
          factory.setAttribute(JAXP_SCHEMA_SOURCE, schema);
          builder = factory.newDocumentBuilder();
          builder.setErrorHandler(new CSLXMLParseHandler());
        } catch (Exception builderException) {
          throw new CSLXMLException("Error setting up SAX: " + builderException.toString());
        Document document = null;
        try {
          document = builder.parse(input);
        } catch (SAXException parseException) {
          throw new CSLXMLException(parseException.toString());

    I was originally using getSystemResource, which worked fine until I jarred the application. The problem appears to be that resources returned from a jar file cannot be used in the same way as resources returned directly from the file system. You have to use the ZipFile class (or its JarFile subclass) to locate the ZipEntry in the jar file and then use ZipFile.getInputStream(ZipEntry) to convert this to an InputStream. I have seen example code where an InputStream is used for the JAXP_SCHEMA_SOURCE attribute but, for some reason, this did not work with the InputStream returned by ZipFile.getInputStream. Like you, I have also seen examples that use a URL but they appear to be URL's that point to a file not URL's that point to an entry in a jar file.
    Maybe there is another way around this but writing to a file works and I set use File.deleteOnExit() to ensure things are tidied afterwards.

  • Adding Encoding in XML header without mapping

    Hi Gurus,
    I am stuck in a situation where in a pass through scenario, I need to add encoding type in XML header.
    Below is example -
    Current Situation - <?xml version="1.0"?>
    Expected result -  <?xml version="1.0" encoding="UTF-8"?>
    Can anybody help me in this regard? how to achieve this?
    Vidhi S

    Hi Vidhi
    Use it in the below way in the receiver adapter.
    Module name: AF_Modules/XMLAnonymizerBean
    Parameter name: anonymizer.encoding
    This will work. I have tested already.

  • Problem: Invalid BTree Header

    I don't use 9.2.2 much but could it be a problem for 10.4.7? on 9.2.2 I get: Problem: Invalid BTree Header all the time after running Disk first aid again and again. It says it fixed the problem but the error keeps comming back.
    I know this has been disscussed elsewhere but I could not find a definite answer on what to do. I will not use Norton. Please help.

    Hi Walter;
    If DW can touch the problem, about the only solution left is to reformat and reinstall now.
    One question, you did run DW while booted from another disk? If not, DW is not able to repair the disk that the operating system is running from.

  • Adding additional XML Header in Target XML structure

    Hi all,
    I have a requirement that i need add one additional XML header to target XML messages. At the moment i can see default XML header as ,
    <?xml version="1.0" encoding="UTF-8" ?>
    <Add>Test Mesage</Add>
    But i would like to have one more additional header like below,
    <?xml version="1.0" encoding="UTF-8" ?>
    <?Siebel-Property-Set EscapeNames="false"?>
    <Add>Test Mesage</Add>
    Can some one help me to find a way to adding this additional header?
    Thanks in advance.
    Prasad Babu.

    Hi Prasad,
    Yes it is possible by Java Mapping. Please check my response for similar thread
    Re: Add XML header?

Maybe you are looking for

  • Flex 3/4 Initialization Timing Changes?

    Hi there.  This isn't end-of-the-world critical, but I'm trying to better understand what's going on here. We have a relatively large and complex business app (several hundred classes split into a core application framework plus multiple dynamically-

  • Is it normall for a Macbook Pro to overheat during  browsing web pages?

    DonAnan Is it normall for a Macbook Pro 13" retina 2 weeks old to overheat during browsing web pages ? i just brought a new MacBook Pro 13" Retina ( Dual Core i5 2.6GHz , 8GB Ram , 512GB Flash Storage ) and i notes that its really get OVERHEAT on the

  • How to manage web page content via labview

    My pproblem is to get cyclic information from a web page containing an applet. Using a container I cannot manage any text and object in the page. Isn't it? Ciao

  • Adobe Reader X Japanese font problem in Windows 7

    This is happening if we open a PDF with Japanese font in Windows7 OS. Tried to install Japanese font pack for Japanese Adobe X. But that is not getting installed with an error message : 'Install Adobe X before installing Japanese font pack'. Only fon

  • Trouble with my dropdown menu

    I'm new to Java and I am getting pretty frustrated. I need a drop-down menu in my calculator and I'm probably doing this all wrong. When I compile my code, I don't get any errors but when I run it, I get: Exception in thread "AWT-EventQueue-0" java.l